Convert .mts file to .mp4 retain metadata

2

I would like to convert .mts files to .mp4 and retain the 'creation date' and 'modified date' metadata. I found the following post How to make Handbrake preserve capture time / creation time? that explains how to do it in one step with ffmpeg. The suggested code is

ffmpeg -i in.mp4 -i out.mp4 -map 1 -map_metadata 0 -c copy fixed.mp4

I modified the code to indicate that my input file is .mts (not .mp4).

However, this code is not working for me. The metadata of the output file contains the current date, not the date of the original file. Is this because my input file is .mts instead of .mp4? If so, what can I do to make this code work in my situation?

Danny DeLoach

Posted 2013-04-01T07:15:39.810

Reputation: 81

1Please include the complete ffmpeg console output. – llogan – 2013-04-01T19:38:45.677

I don't know how to copy the console output. It is in a DOS window where I run the command line. However, I looked over the output and noticed that ffmpeg is indeed copying the creation_date tag in the metadata from the input file to the output file. The problem is that when I view the properties of the output file in Windows Explorer, the Date Modified tag shows the time of the conversion. How do I get Date Modified to equal creation_date? – Danny DeLoach – 2013-04-02T06:41:23.127

Then we're talking about different things. The file's modification time is changed by Windows whereas the creation date metadata is written by FFmpeg. Might want to clarify your question. – slhck – 2013-04-02T07:04:51.243

I have done a little more investigation. Yes, I now realize that I was talking about two different things. I guess some date/time info is stored as tags on the video data inside the file. Other date/time info is stored as a property of the whole file itself. I need to think through this more, so that I can ask a clear question later. Sorry for my confused question. – Danny DeLoach – 2013-04-02T16:43:16.443

No answers