Timestamp is not preserved when saving files in copy mode.

Started by zhopudey, July 10, 2017, 05:00:17 AM

Previous topic - Next topic

zhopudey

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.  :)

eumagga0x2a

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.

zhopudey

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.

eumagga0x2a

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.

Jan Gruuthuse

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

zhopudey

Thanks. I'll look into ffmpeg, and see if I can figure out a script.