Quick introduction
Vantage has a widely used open worflow feature that allows a downstream action to consume a file while the upstream action is creating it. This feature relies on an intermediary file that is “open” in nature; that is to say it is structured in such a way that it can be read while the file is still growing. Typically, this would be a TIFO file or an open MXF Op1a file.
In order to test code that handles reading or writing open files, a command line utility opencopy
has been created. This is available in the Telestream Enterprse Engineering’s BitBucket project. To clone this repository, issue the following command.
git clone https://bitbucket.org/Telestream/opencopy.git
git submodule init
git submodule update
Command line tool
After compiling the source code, the tool can be run to reveal the command line options with the –help argument
Options:
-h,--help Print this help message and exit
-i TEXT REQUIRED The input file for the copy.
-o TEXT REQUIRED The output file for the copy.
-t INT The timeout in milliseconds
--standard BOOLEAN Use standard file stream.
-s INT The block size in bytes.
-f Flush writes to disk.
--throttle INT Throttle in bytes / second.
Trying it out on the command line
To create an open file, the command line utility can be used to slowly copy a completed file to a new destination by specifying the bitrate for the transfer in bytes per second using the throttle argument.
OpenCopy -i d:\media\tifo.tifo -o d:\media\tifo2.tifo --throttle 1024000000 -f
The -f
argument flushes the file to disk after every write which will allow the filesize to be updated by the operating system more deterministically.
To consume an open file (e.g., the one created with the above command) using the same mechanism as Dib.
OpenCopy -i d:\media\tifo2.tifo -o d:\media\tifo3.tifo -t 10000
The -t
argument specifies the timeout in milliseconds. i.e. the elapsed time at which the open copy will be completed if the file is not seen to grow.