Handbrake: Add an option to copy the date/time info of the original video to the new one

Created on 3 Jan 2016  Â·  32Comments  Â·  Source: HandBrake/HandBrake

Hi, I use Handbrake mainly to convert videos to reduce space. The boring thing is that the original date/time infos are lost creating the new videos. I have to open every file and change manually the date/time information (creation date, modified date) because I need to sort my video and photos by date.

This is a very boring and time-consuming operation. Please add a simple option in HANDBRAKE for copy the date/time informations from the original video to the new one.

Sure, it is an useful thing that I want from Handbrake. Thanks!

Enhancement Rejected

Most helpful comment

I get your point @sr55, but I don't think most users require full metadata pass-through and that is not what we're asking for.

A lot of users come across Handbrake looking for reducing their disk space (just like the guy that created this issue). They don't want to lose video quality but they want to reduce size. In this regard Handbrake is awesome. The problem is when you want to keep the same creation/modification date to use videos in services like Google Photos, which use chronological order.

There are some tools that allow you to change creation/modification date, but only selecting a particular date for all videos, or an offset (ex: -10 days), which doesn't help _at all_ if you convert videos from different years (ex: 01/01/2002, 01/01/2008) in the same day (01/01/2018).
I spent hours investigating and trying different tools and couldn't find any solution for an average user.

So I think the solution could be just adding for example a checkbox (unchecked by default if you want) under Preferences\Output files:

  • [x] Keep original file Creation and Modification dates

I don't think that's too complicated to implement, but for sure will help tons of people!
(perhaps a more complex metadata pass-through could be addressed later)


Seriously, if you do a quick search in Google you'll see people asking for this:

All 32 comments

Handbrake seems to copy/retain some metadata tag information but not all. I would also like to see more (close to all) metadata retained/copied to new Handbrake encoded media.

Most of the media I'm re-encoding/transcoding has the following meta: Name, Genre, Release Date, TV Show, TV Episode #, TV Season, Studio, Cast. Sometimes also Description, Long Description, poster artwork, Media Kind. Handbrake retains/copies Name, Genre and Long Description. The other metadata information (including the poster artwork) n is not retained/copied to new media encoded.

Anticipating Handbrake developers give this a low priority (or decided against any work in this area) I've recently started to think about other possible solutions. Perhaps SublerCLI, PySubler (https://github.com/moogar0880/PySubler) and write a simple python script to automate copying metadata tag information from source media to Handbrake/handbrakeCLI encoded destination media.

If a Handbrake developers/contributor is adding this feature be sure TV Season data can handle/manage larger integers. In some situations it is better to use year in the season field rather than 1, 2, 3… convention. The 1, 2, 3… numbering convention suits some types/classes/kinds of media (TV series drama, comedy etc) but not others (TV news and current affairs, lecture recordings, sporting events etc). EmmGunn's MP4tools (a GUI wrapper to ffmpeg tools) copies TV Episode # and TV Season when creating Matroska Multimedia Container (MKV) container files but screws-up large numbers in these two fields.

In summary, I would be very happy if Handbrake could retain/copy all (excluding any "Encoded by") metadata tag information.

(I love Handbrake and HandbrakeCLI)

i agree with this metadata addon specifically the date and time as i plan to parse thru my file using C++/C# to read files with this related information or TAGs

We don't plan to extend the metadata functioanlity at this point

I wish this issue could be reconsidered. Losing the information on the original metadata should be avoided if possible IMVVHO. I spend a lot of time re-adding it afterwards (and for the creation date and time, it's not as trivial as it might be for some of the other fields).

I would recommend to use the iTunes metadata format "date" field instead of the ambiguous ISOBFF creation and modification date fields (if you are using mp4).

I can use iTunes or even various metadata tools out there after the fact to re-enter the tags, but I'd much rather simply not lose the information to start with :-)
I have several hundred home video files to convert and I am NOT looking forward to correct the media creation date after the facts… :-> Luckily for me, I have the dates and times in the file names so I'll be able to create a shell script to restore the dates through exiftool.
I saw several threads out there of users complaining that different metadata fields were lost upon conversion so it doesn't look like it's an isolated/rare request.

I agree with cortig, this is not a rare request. I would just like a option to keep the date, and time. This is a great tool, and if I knew C I would fork this and add it.

In the meanwhile, you can always use the power of bash scripts to perform the automatic metadata copy (for windows you have to install cygwin).

So, to do this copy automatically, just run this script:

cd directory-where-your-original-videos-are
for file in ls; do touch -r $file directory-where-your-converted-videos-are/$file; done

Note: original and converted files need to have the same filename.

I agree with many of those who commented previously.

I'll give you an example to what happens to me:
Let's say I have 3 files from my old gallery:

video-01.avi [modified date: 01/01/2002]
video-02.wmv [modified date: 01/01/2008]
video-03.mov [modified date: 01/01/2015]

After using Handbrake, I upload those videos to, for example Google Photos (which order media files by date). I have my entire gallery there since 2001 (about 10,000 photos and videos). So now I need to _manually_ change the datetime of those 3 videos so they are properly ordered in my gallery.

Now, imagine the same scenario with 1,000 files... it is horrible time-consuming and as far as I've investigated I wasn't able to find any tool to copy/paste original metadata (already tried with BulkFileChanger, Attribute Changer, etc).

I think this is not a trivial feature, it seems to be quite aligned to Handbrake main focus and it seems to be a highly appreciated improvement by many people.

@sr55 would you reconsider adding this feature?

I'm against abusing file system metadata for this purpose.

Both MP4/MKV support container metadata and it's much better to set the appropriate date fields in the container using a good tagger such as (Subler, Mac) or equivalent windows. I'd be surprised if Google can't sort correctly on this. If it can't i'd argue it's broken.

As far as container metadata goes, HandBrake already passes some of this though but frankly, I don't think any of us has the time to really build out metadata functionality in a way that's actually decent and fits HandBrakes model. Many people won't want any kind of passthru and it's not optional currently.

Tagging works much better from a design perspective as a separate app with it's own workflow (Something I've wanted to build for a while but never had time. I.e porting subler to windows.)

I don't think any of us is talking about a full blown metadata editor @sr55.
It's only a matter of preserving what's already in the source container and passing it through to the destination. As you mentioned, some of the data is already passed through. It would save a lot of time to the end user to pass through data from additional fields IMVVVHO.

I get your point @sr55, but I don't think most users require full metadata pass-through and that is not what we're asking for.

A lot of users come across Handbrake looking for reducing their disk space (just like the guy that created this issue). They don't want to lose video quality but they want to reduce size. In this regard Handbrake is awesome. The problem is when you want to keep the same creation/modification date to use videos in services like Google Photos, which use chronological order.

There are some tools that allow you to change creation/modification date, but only selecting a particular date for all videos, or an offset (ex: -10 days), which doesn't help _at all_ if you convert videos from different years (ex: 01/01/2002, 01/01/2008) in the same day (01/01/2018).
I spent hours investigating and trying different tools and couldn't find any solution for an average user.

So I think the solution could be just adding for example a checkbox (unchecked by default if you want) under Preferences\Output files:

  • [x] Keep original file Creation and Modification dates

I don't think that's too complicated to implement, but for sure will help tons of people!
(perhaps a more complex metadata pass-through could be addressed later)


Seriously, if you do a quick search in Google you'll see people asking for this:

@sr55,
I'm in the same boat as everyone else as @diegoteliz mentioned. I have resorted to just changing the file names to the date they where created, and running them through handbrake, and losing the creation dates. The checkbox @diegoteliz mentioned is all we are looking for.

@diegoteliz thank you because you have understood exactly what I asked: with a small effort change, everybody will benefit.

A web search looking for this option brought me here. I'm actually surprised such an otherwise thoughtful tool has omitted this feature - I actually consider my recoded vintage home videos tainted while they have their "recode date" set in their media creation date tags.

I'm looking at using exiftool somehow to copy over the tags, but for media I have no originals for its all a little sad.

+1 from me then!

converted my old .mov files into .mp4 and surprised there is no option to preserve Encoded/Tagged date... Google Photos and Sony PlayMemories are not able correctly sort converted videos. looking for tool able to fix it.

To improve @seliver's comment, here's how to copy the time information from a single file to another one (mac/linux):

touch -r FROMFILE TOFILE

to set a specific date :

touch -mt YYYYMMDDhhmm TOFILE

(where _YYYYMMDDhhmm_ matches your date / time, of course)

EDIT
This is NOT working as it does copy the FILE creation/last modified date; not the capture date, as said in @cortig's answer. You can list the file metadatas by typing

mdls FILE

From what I remember @gordielachance, _touch_ will copy over the creation date for the file. That's different from the Encoded date from what I can tell. For movies copied over from a camcorder for instance, it would typically be the date at which the movie was extracted from the camera instead of the date at which it was shot (at least with iMovie that's what I see). Copying over the Encoded date after the facts is unfortunately far more tedious.

Indeed, this is why we recommend using an appropriate tool to set the related metadata tag(s) in the encoded file.

Absolutely @bradleysepos, but the whole point if the thread from what I understand was that it would be nice for Handbrake to preserve the original metadata and copy over the creation data automatically without forcing users to hunt down the web for third party tools allowing them to restore the information in the re-encoded file (and as far as I'm concerned, that also applies to the rest of the metadata that is lost in the process, like cover arts, etc).

I know it's doable manually and I know how to do it, but it sure is tedious and there aren't many tools around to automate it when you have to deal with a large number of files.

From touch man:

-r, --reference=FILE
use this file's times instead of current time

Looks like it copies all times.
Anyway, it works for me and videos are correctly sorted in Google photos.

On Thu, 16 Aug 2018, 20:54 Bradley Sepos, notifications@github.com wrote:

Indeed, this is why we recommend using an appropriate tool to set the
related metadata tag(s) in the encoded file.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/HandBrake/HandBrake/issues/51#issuecomment-413665162,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHMkC8Li8uAf7qQWpX2qqGcy2SKYHOZ7ks5uRc3dgaJpZM4G9uQW
.

How about a generic postprocess command/script that you can ask Handbrake to do on completion of each encode? Something that you can pass variables to (in this case, filenames).

Then for this usecase you could set exiftool to operate after each file has been encoded, but in the context of Handbrake it wouldn't have the direct responsibility of any date handling itself.

so I finally found how to use ffmpeg and copied metadata from the old files to new ones...
ffmpeg -i old.mov -i new.mp4 -map 1 -map_metadata 0 -c copy fixed.mp4

Looks like using ffmpeg to copy the date is the best solution as of now. But imho having a checkbox to keep the date while transcoding is the cleanest solution. For me a transcoder only just change the video properties I want and similar to the audio passthrough a "meta data passthrough" makes sense.

Hello. New here and first time I use linux, not really good with the ffmpeg so, I remember that handbrake was in linux too. Usually I use xvid4psp to do the same as many of above, but looking for copy the date info brought me here.. as many.

Really sad to hear answers like this

I'm against abusing file system metadata for this purpose.

Both MP4/MKV support container metadata and it's much better to set the appropriate date fields in the container using a good tagger such as (Subler, Mac) or equivalent windows. I'd be surprised if Google can't sort correctly on this. If it can't i'd argue it's broken.

As far as container metadata goes, HandBrake already passes some of this though but frankly, I don't think any of us has the time to really build out metadata functionality in a way that's actually decent and fits HandBrakes model. Many people won't want any kind of passthru and it's not optional currently.

Tagging works much better from a design perspective as a separate app with it's own workflow (Something I've wanted to build for a while but never had time. I.e porting subler to windows.)

But by other way, It is your work, up to you.

With xvid4psp is really really easy to copy that info, just with a click. So, maybe I should never leave windows.

I know this enhancement is rejected and closed, but I did need this option so badly and urgently that had to implement it, enjoy!

https://github.com/kleuter/HandBrake/tree/1.2.x-copydatetime

PS. I'm a C++ Developer, have zero C# experience so please forgive any possible sh*t code.

I don't understand why the developers have closed this issue.

I don't see how it is "abusing file system metadata".
We just want to _maintain_ the original informations, which seems logical in a lot of situations.

It seems that users are potentially interested in it. Yes, there are workarounds (command lines, etc) - but what when you have hundreds of files ? I don't see the disadvantages if this feature is optional.

Please reconsider.

@gordielachance the mod above works for batch processing as well. What one need is only Visual Studio 2017 Community Edition (free)

I'm under mac, is it working too ?
But that mod needs to be compiled ?

Thanks

Le mer. 22 mai 2019 à 11:03, Kleuter notifications@github.com a écrit :

@gordielachance https://github.com/gordielachance you can use the mod
above
https://github.com/HandBrake/HandBrake/issues/51#issuecomment-490967237,
it work for batch processing as well. What one need is only Visual Studio
2017 Community Edition (free)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/HandBrake/HandBrake/issues/51?email_source=notifications&email_token=AA7DNTOHVYBARMIYDJBEUQLPWUD5RA5CNFSM4BXW4QLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV6MZ5Y#issuecomment-494718199,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA7DNTNTHD4ZFELPPOPJXF3PWUD5RANCNFSM4BXW4QLA
.

If you're on Windows, VidCoder has an option Advanced -> Preserve Created and Modified time when converting files. It uses the same encoding engine as HandBrake so it should otherwise work in a similar manner.

And even years later, I would be still very interested to have this enhancement.

And even years later, I would be still very interested to have this enhancement.

As RandomEngy said, with Vidcoder you are able to do it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

n2bisex4u picture n2bisex4u  Â·  3Comments

miopad picture miopad  Â·  6Comments

iburunat picture iburunat  Â·  3Comments

28598519a picture 28598519a  Â·  4Comments

AlexPasternak picture AlexPasternak  Â·  5Comments