[FFmpeg-user] How to keep the original creation date?

Kevin Willard kevin14450 at yahoo.com
Thu Jun 22 17:36:18 EEST 2023

I've got 3000 family videos from 2009-2014 that played perfect back then on Windows 7 but have the wrong aspect ratio today (all stretched even though it says it is 1920X1080). The code belowfixes the problem, but changes all the dates to current. It would be nice to have the original time/date stamp for sorting and looking at the family timeline.Google search brings me to Stackoverflow (ffmpeg keep original file date?) They us PowerShell, I don't know how to use it and I don't think it will work because in the example the PS operation is done after the FFmpeg conversion is done. FFmpeg in the copy sets the creation time, last modified, and last access to the time/date the FFmpeg was run.
The code below is in a .bat file located in the directory that contains the 3000 *.MP4 files. When run 
it puts the corrected files in the subdirectory Fixed_Directory.
for %%a in ("*.mp4") do ffmpeg -i "%%a" -aspect 1920:1080 -c copy "Fixed_Directory\%%~na.mp4"

With all the switches I would think there would be one to keep the original dates, any ideas?


More information about the ffmpeg-user mailing list