Sample Header Ad - 728x90

How can I restore file timestamps of video recordings using the embedded metadata?

7 votes
5 answers
14221 views
I'm looking for a command that will read the metadata of a ‘*.mp4’ file and touch the file's timestamp with the creation time of the video. The command should be read-only with respect to the file contents, i.e. hashing the file before and after should yield the same result. Situation: I made the mistake of moving pictures and videos from the internal storage of my phone to an SD card using Android's stock tool to do so (‘Settings’ → ‘Storage’ → ‘Transfer data to SD card’). Unfortunately, this bumped the timestamps of all of the files, and also messed around with directories other than DCIM/ (pictures and videos were also moved from the Download/, image/, Pictures/, and video/ directories). In hindsight it seems silly that I used such a tool (I'd normally use Ghost Commander ), but it appeared as a notification when running low on space and it just looked so easy. I'm now trying to piece back together the timestamps of various pictures and videos. I'm effectively looking for a video equivalent to the following command , which I used to sort out the images in DCIM/100ANDRO/: exiv2 -T mv *.JPG I skimmed through some FFmpeg documentation , but I see no mention of read-only commands or printing timestamps. (Unfortunately for my situation, this approach does not offer a solution for files I didn't create, such as those in Download/, for which I want to appear in the media collection in chronological order of when I obtained them.)
Asked by James Haigh (739 rep)
Feb 24, 2014, 02:44 AM
Last activity: Jan 8, 2025, 08:44 AM