Proof of Concept
Here is the list of the commands used for transcoding a sequence of 16-bit DPX files, using the FFV1 codec, into a Matroska container, and then to transcode back the generated file to a sequence of 16-bit DPX files.
I wish to acknowledge the help provided by Kieran O’Leary from the Irish Film Archive.
Note: For the presentation done at The Reel Thing XXXVIII the HEAD version of FFmpeg was needed, because the capability to handle RGB with 16 bit per channel (planar gbrp16 and packed rgb48) has just been implemented into FFV1, and is currently tested. In the near future any official release will work.
Set the desktop as working space in order to find the generated files easier
cd ~/Desktop
Compute MD5 hash values for the original DPX files
ffmpeg -i ORIGINAL/original_%06d.dpx -f framemd5 md5_original.txt
Command syntax
- ffmpeg
- starts the command
- -i ORIGINAL/original_%06d.dpx
- path, name and extension of the input files
The regex %06d matches six digits long numbers, possibly with leading zeroes. This allows to read in ascending order, one image after the other, the full sequence inside the folder. The filename must, of course, match the naming convention actually used.
- -f framemd5
- The library framemd5 calculates an MD5 checksum of the image content of each frame.
- md5_original.txt
- path, name and extension of the output file
Transcode the RGB content inside the DPX file, using FFV1, into Matroska
ffmpeg -i ORIGINAL/original_%06d.dpx -c:v ffv1 -level 3 -strict -2 test.mkv
Command syntax
- ffmpeg
- starts the command
- -i ORIGINAL/original_%06d.dpx
- path, name and extension of the input files
The regex %06d matches six digits long numbers, possibly with leading zeroes. This allows to read in ascending order, one image after the other, the full sequence inside the folder. The filename must, of course, match the naming convention actually used.
- -c:v ffv1
- The video codec FFV1 is chosen.
- -level 3
- The version 3 of FFV1 is selected.
- -strict -2
- For the presentation done at The Reel Thing XXXVIII this debugging parameter was needed, because the capability to handle RGB with 16 bit per channel (planar gbrp16 and packed rgb48) has just been implemented into FFV1, and is currently tested. As soon as the next official version of FFmpeg has been released, this parameter will not longer be needed.
- test.mkv
- path, name and extension of the output file
Create a folder for the new DPX
mkdir COPY
Transcode the content of the Matroska file into new DPX files
ffmpeg -i test.mkv COPY/copy_%06d.dpx
Command syntax
- ffmpeg
- starts the command
- -i test.mkv
- path, name and extension of the input files
- COPY/copy_%06d.dpx
- path, name and extension of the output file
Compute MD5 hash values for the new DPX files
ffmpeg -i COPY/copy_%06d.dpx -f framemd5 md5_copy.txt
- ffmpeg
- starts the command
- -i COPY/copy_%06d.dpx
- path, name and extension of the input files
- -f framemd5
- The library framemd5 calculates an MD5 checksum of the image content of each frame.
- md5_copy.txt
- path, name and extension of the output file
Compare the MD5 hash values
diff md5_original.txt md5_copy.txt
2018-07-18
|