Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: zhopudey on July 10, 2017, 05:00:17 AM

Title: Timestamp is not preserved when saving files in copy mode.
Post by: zhopudey on July 10, 2017, 05:00:17 AM
Hi there. I'm looking for a solution that'll let me quickly trim and edit all my home videos shot on mobile phones. Avidemux seems perfect, as its copy mode does not waste any time in re-encoding the video. However, I found that it does not save the original timestamp. This is a problem as now I cannot organize these videos along with my photos.
Is there any solution to this problem. Any help would be really appreciated.  :)
Title: Re: Timestamp is not preserved when saving files in copy mode.
Post by: eumagga0x2a on July 10, 2017, 08:10:23 PM
You could use ffmpeg to set creation_time entry to the value you wish:

ffmpeg -i your_edited_video.mp4 -c copy -timestamp "2017-07-10 19:30:21" your_edited_video_with_timestamp.mp4

It depends on the muxer whether it works or not. It is up to the mobile phone whether it honours this metadata entry instead of doing something completely different to track creation time. The modification time of the video file is again a completely different story.
Title: Re: Timestamp is not preserved when saving files in copy mode.
Post by: zhopudey on July 11, 2017, 01:41:48 AM
Thanks.  :) But is there a way to automate this process? I have 4 years worth of videos to edit, and doing this one by one would take a long time. My mobile phones do have a weird way of saving the time. It is in the format (hh:mm:ss + 5.30). That's for Indian standard time.
Title: Re: Timestamp is not preserved when saving files in copy mode.
Post by: eumagga0x2a on July 11, 2017, 07:40:16 AM
ffprobe lists creation_time among other metadata entries. If you keep file names, it might allow to script the transfer of the creation_time from the source video to the edited version.
Title: Re: Timestamp is not preserved when saving files in copy mode.
Post by: Jan Gruuthuse on July 11, 2017, 08:44:20 AM
perhaps with batch file and some modification along the line of:
copying metadata from original to new video (1 video)
=========================================

ffmpeg -i ~/Videos/Handbrake1024x576.m4v -i ~/Videos/avidemux1024x567mp4.mp4 -map 1 -map_metadata 0 -c copy ~/Videos/corrected_output.mp4

more specific info probably @ http://ffmpeg.org/documentation.html
Title: Re: Timestamp is not preserved when saving files in copy mode.
Post by: zhopudey on July 11, 2017, 12:05:52 PM
Thanks. I'll look into ffmpeg, and see if I can figure out a script.