Handbrake is an awesome video compression tool, but it doesn't seem to preserve the original capture time after a video is compressed. Any idea how to fix this?
You can copy the existing metadata from one file to another without needing to re-encode the video using FFmpeg. It basically takes one second. To do this, let's assume three files:
The FFmpeg command to copy the complete metadata record to the new file would then be:
Explanation of syntax:
To break it down, this does the following:
After that, you could obviously rename
As an example, here's part of the metadata record of my original file:
Here's the file after Handbrake conversion:
Here's the final file after mapping the metadata:
If you want to do all with FFmpeg:
Actually, you don't really need to use Handbrake if you can use FFmpeg, which Handbrake relies on anyway. In the simplest case you can do your conversion like this:
This will convert the input with the x264 encoder and FAAC audio to an output file, copying the original metadata. In order to change the quality of the output, you can:
I found an easier way to do this, using a different software called
It doesn't have all the advanced settings like HandBrake but it does the job (also using ffmpeg) and retains the metadata I need.
Unfortunately it seems handbrake can't do it on its own, but similarly to the ffmpeg example, the timestamps can be copied from the original after compression by using the
this will set the timestamp on the compressed file to the same as the given reference file.