


bat, ffmpeg, Date modified, timestamp, copy timestamp I have also tried to assign the "DateTime object" to a powershell variable, unfortunately didn't get it work. In the powershell program, the ".LastWriteTime" file object properties is copied directly from source to the output.

The batch file will first convert the file using ffmpeg, and the same filename "shell variable"(excuse me for the un-professional term" is sent to the powershell command. Powershell.exe -Command "(Get-Item "output\%%~na.mp4").LastWriteTime=(Get-Item %%~na.MOV).LastWriteTime The final product is a batch script looks like this: The trick is to use something called the Power Shell. But I usually manage my files by the "Date Modified" that record the original time the video is shot.Īfter some deep dive into the windows terminal system, and some hours are spent, I finally found the solution to copy the windows "Date Modified" timestamp to the ffmpeg output file. However, the problem is that, all the file generated by the ffmpeg would have the windows timestamp of "Date Created", "Date Modified", and "Date Accessed" will be set to current time. The process under windows went pretty well. "batch_convert.bat" that contains the script above.The above script is placed in the folder, containing The %%~na means "Expands %%a to a file name only", which is defined in the For loop tutorial of m$ command line. The encoder for video is assigned to be 264 -c:v libx264 with audio codec -b:a aac and audio bitrate -b:a 128k of 128K. mov file, the batch variable %%a (double percentage sign %% for batch, % for command line) is fed into ffmpeg. Since the ffmpeg is a command line tool without gui, the batch script conversion uses the .bat file that can be found easily via google, e.g. (The Any Video Coverter just don't work, some weird snapshot problem ketp hunting me) I was trying to compress my recordings from the 2015 NCKU Wind Band Camp to save space. I choose the ffmpeg to do the job because it seems quite efficient and the format is pretty standard.
