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.)
Download/
, I've asked a related question on Android Enthusiasts: How do I retrieve timestamps from my Firefox download history?