Coder Social home page Coder Social logo

tdmstovideo_converter's Introduction

Python scripts to convert .tdms video files from mantis to .mp4

Installation

Open your anaconda prompt and use the following commands to create an environment to use the convert [or use a pre-existing one].

conda create -n tdmsconverter python=3.7

Once the environment is created activate it with conda activate tdmsconverter and install with:

pip install git+https://github.com/BrancoLab/tdmstovideo_converter.git

Don't forget to clone this repository somewhere.

All done!

Usage

Command line usage

In anaconda prompt with the environment activated, you can use it with:

tdmstovideo_converter  path_to_video path_to_metadata

And if unsure, get help with:

tdmstovideo_converter  -h

Single file

The simplest way to use the converter is with this command (in the anaconda prompot with tdmsconverter environemnt activated):

  cd path_to_where_this_repo_is_cloned
  python converter.py path_to_video path_to_metadata

converter.py takes two arguments: path_to_video should be the path to the video.tdms you need to convert while path_to_metadata should be the path to the metadata.tdms file produced by mantis.

If you want to specify the path where the video.mp4 should be saved you can use the -op argument. Otherwise the file will be saved as ../tdmsvideo.mp4.

Batch processing

You can use the converter to process multiple videos at once. The converter expects that your files are organised like so:

  folder
    subfolder1
        videoname.tdms
        metadataname.tdms
    subfolder2
        videoname.tdms
        metadataname.tdms
    ...

If that is the case, then you can use:

  cd path_to_where_this_repo_is_cloned
  python batch_converter.py path_to_folder videoname metadataname

If you wish you can pass the additional argument --dest-fld path_to_dest_folder to specify a folder where the videos will be saved. Alternative each video.mp4 file will be saved in its respective subfolder. The video.mp4 files will be saved as: ../subfoldername_videoname.mp4

Other

If you forget what the arguments to each script are you can always to something like: python converter.py -h to get a reminder.

For any issue/feature request get in touch or submit an issue.

tdmstovideo_converter's People

Contributors

fedeclaudi avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

maxmatu

tdmstovideo_converter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.