<p>The following exemplary FFmpeg command takes an MP4 file, doesn't do any re-encoding, but simply writes the output to an MKV file:</p>
<pre><code>ffmpeg -i input.mp4 -c copy output.mkv
</code></pre>
<p>If I run the same command twice, with two different output files:</p>
<pre><code>ffmpeg -i input.mp4 -c copy output1.mkv
ffmpeg -i input.mp4 -c copy output2.mkv
</code></pre>
<p>The resulting files will have differing checksums:</p>
<pre><code>aa46d308197cb08d71f271c61d5412ad  output1.mkv
8b48c3ebdbf2384705fcb78e864d12e3  output2.mkv
</code></pre>
<p>This difference disappears if I convert them back to an MP4 container:</p>
<pre><code>ffmpeg -i output1.mkv -c copy output1.mp4
ffmpeg -i output2.mkv -c copy output2.mp4
</code></pre>
<p>For differing MKV input files I'm getting the same checksum for the MP4 output files:</p>
<pre><code>24e92b3e228db780b5feab14255870e4  output1.mp4
24e92b3e228db780b5feab14255870e4  output2.mp4
</code></pre>
<p>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?</p>

CC BY-SA 4.0
2024-04-16T11:20:19.043Z
See [answer](https://stackoverflow.com/a/78319520/17502540) for the same question.
Alain1A45
CC BY-SA 4.0
2024-04-16T11:41:40.913Z
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
<ffmpeg><encoding><mp4><mkv><metadata>
Same FFmpeg command produces different Matroska MKV output file checksum
finefoot
# Same FFmpeg command produces different Matroska MKV output file checksum

(Asked by: username_0 on 2024-04-15)

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?

**Tags:** ffmpeg, encoding, mp4, mkv, metadata

> **Comments:**
> **username_1**: See [answer](https://stackoverflow.com/a/78319520/17502540) for the same question.  
> **username_0**: 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.  

---

## 0 answers

