The following exemplary FFmpeg command takes an MP4 file, doesn't do any re-encoding, but simply writes the output to an MKV file:

ffmpeg -i input.mp4 -c copy output.mkv

If I run the same command twice, with two different output files:

ffmpeg -i input.mp4 -c copy output1.mkv
ffmpeg -i input.mp4 -c copy output2.mkv

The resulting files will have differing checksums:

aa46d308197cb08d71f271c61d5412ad  output1.mkv
8b48c3ebdbf2384705fcb78e864d12e3  output2.mkv

This difference disappears if I convert them back to an MP4 container:

ffmpeg -i output1.mkv -c copy output1.mp4
ffmpeg -i output2.mkv -c copy output2.mp4

For differing MKV input files I'm getting the same checksum for the MP4 output files:

24e92b3e228db780b5feab14255870e4  output1.mp4
24e92b3e228db780b5feab14255870e4  output2.mp4

So obviously the video itself hasn't been modified and there's some metadata in the MKV container that's responsible. What data is it and how do I prevent this data from being added?

  • See answer for the same question.
    – Alain1A45
    Apr 16 at 11:20
  • Original question has been closed and when voting to close, it seems like migration from StackOverflow to here isn't an option. I've already messaged Gyan to post their answer here again. However, feel free to post an answer yourself. :) For example, I'm still wondering if -bitexact has further implications, other than avoiding random track ids.
    – finefoot
    Apr 16 at 11:41


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.