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:
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.
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.
I took me so much time I had to share:
I am using MAC OS X Yosemite
HandBrake Batch - http://www.osomac.com/apps/osx/handbrake-batch/ - use it to convert files, but click at the "keep file creation and modification dates" box in the "Preferences" menu.
Then, I imported the videos to Lightroom 5, but they still not keeping creation dates. But, most importantly, the files showed in Finder with the correct Creation date. So I selected all of them in the Lightroom library --> Metadata (right dialog column) --> Capture Time --> Change to File's creation date --> Change All.
And it worked!
I had 850 old family videos - I had to do this process in 100/100. Handbrake crashes with a lot of files.
Hope it Helps!