Hello,
Some times its important to keep timestamp of a video file after its been edited / compressed / changed format etc.
(Not one file only)
Looked in settings of programs I have, there is not such an option, so processed files get current timestamp.
I have that 'add' to 'properties' submenu to change timestamp, but its lot of work and time.
Any suggestions will be appreciated.
Thanks
Motim
Win 10, 19042.1237 (20H2) x64
+ Reply to Thread
Results 1 to 6 of 6
-
-
There are dedicated programs which allow to set timestamps, the one I use is Attribute Changer (I recently did a complete revision of its french translation by the way).
I also use another method based on Robocopy (a standard Windows command line utility, it should be available on your system already), which you could use as follows.
– First create an empty copy of the directory where the original files are :
Code:robocopy "E:\path\to\video files" "E:\path\to\video files [C]" /E /B /DCOPY:T /TIMFIX /FFT /DST /XJ /R:0 /W:1 /CREATE
– Then do whatever processing you need to do with those files.
– Then rename the output files exactly as the original files (after moving those in another directory if you want to keep them), or exactly as their empty counterparts in the "[C]" directory (you can also rename the empty files with a batch file renamer prior to performing the next step). If the output files have a different extension (for instance .mkv instead of .mp4) you have to temporarily change the extension to match the original one. (Windows should always be set to display all file extensions.)
– Then re-apply the timestamps from the empty copies to the processed files with a second Robocopy command, switching source and destination paths :
Code:robocopy "E:\path\to\video files [C]" "E:\path\to\video files" /E /B /DCOPY:T /TIMFIX /FFT /DST /XJ /R:0 /W:1 /CREATE
The Robocopy method is quicker (especially if there are many files to process) than setting each timestamp for each file in a GUI, and is also more precise, as third party utilities which manipulate timestamps do so through a Microsoft API which apparently only allows a 1sec. precision (for instance timestamps processed with Attribute Changer get rounded to XX,000sec.), whereas Robocopy applies the timestamps with the maximum precision (up to 7 decimal digits which corresponds to a 100 nanoseconds precision).Last edited by abolibibelot; 28th Sep 2021 at 17:44.
-
If you edit, composite, process, you are implicitly modifying the content (sometimes even generating "new" content), so in those cases where it MUST re-encode, that re-encode does and should have a different timestamp.
And there would be no way for an editing app to be able to read your mind either. What would it do if you are editing together 3 different clips, and each one has a different source and different timestamp? Which one would be "correct" for your single output?
Scott -
Not sure which date you want to change but i wrote a program to do that.
https://www.videohelp.com/software/Change-Date-Time-Batch
Changes metadata encoded/tagged in videos as well as windows created/modified dates. It mainly made to copy metadata to windows dates or windows dates to metadata dates in batch mode but also has a manual mode as well. If you have problems or suggestions let me know. -
If you edit, composite, process, you are implicitly modifying the content (sometimes even generating "new" content), so in those cases where it MUST re-encode, that re-encode does and should have a different timestamp.
And there would be no way for an editing app to be able to read your mind either. What would it do if you are editing together 3 different clips, and each one has a different source and different timestamp? Which one would be "correct" for your single output?
For hexadecimal editing, WinHex allows to preserve the timestamps after any possible modification (like completely wiping the file's contents, or adding a chunk from another file at any spot).
In MOST cases it is not desired, but in SOME cases it can be. If someone takes the time to request HOW to do something, perhaps anybody reading should start from the assumption that there is a good reason WHY, however counter-intuitive it may seem. -
Hi, I have been struggling with this same issue for years, and finally have a nice solution, thanks to abolibibelot & Robocop
first let me explain my situation, I have three wildlife / trail cameras in my forest, that create alot of short (25 sec) movies (AVI) and have large filesizes (bad compression). I always converted them to .mkv / H264 to reduce filesize. (20-30% of original filesize).
But i didn't like that i loose original date/time (Date modified in Windows), because that matched the time of recording, so you could quickly see which is night videos for example and which is not at night..
But now i have sorted it all out, this is my how-to:
1) I check all videos with VLC and "open folder" option, so I can quickly go through all videos and delete the empty / boring ones, the most interesting I also rename, for example: DSCF0017.AVI --> DSCF0017_Lynx.AVI etc
2) Then I use handbrake to convert the complete folder (containing up to hundreds of videos in .AVI) to H264 with same output folder (because I create .mkv from .avi this is no issue) / open source / folder / add all to queue / start queue
3) In windows I sort all the files on "file type" so i can quickly move all newly created .mkv files to a sub folder called "mkv"
so now i have a folder called:
D:\Wildcams\20240415\border_forest
(original huge .AVI files with correct / original date/timestamps)
and a subfolder in there with the .mkv output files from handbrake
D:\Wildcams\20240415\border_forest\mkv
4) Then I rename all the original files from .AVI to .mkv (so old and new has same filenames and extensions), I do this in the command prompt because of the amount of files. (hundreds)
Code:ren *.AVI *.mkv
Code:robocopy "D:\Wildcams\20240415\border_forest" "D:\Wildcams\20240415\border_forest\mkv" /B /DCOPY:T /TIMFIX /FFT /DST /XJ /R:0 /W:1 /CREATE
6) Lastly I move the output files from handbrake (in mkv folder) back to original folder and overwrite old files with the new ones, just in windows (cut/paste/replace all) or with the command prompt:
Code:move /Y D:\Wildcams\20240415\border_forest\mkv\* D:\Wildcams\20240415\border_forest\
and because they both are called .mkv this automatically cleans up the folder with only new files, last thing to do is delete the temporary mkv folder (that should be empty now).
and done... hundreds of files converted to H264 mkv but with original date/time stamps.
ps. I write this also for myself, so i can check back my how-to in 4-5 months (next time i empty my wildlife cameras)Last edited by Camel8; 30th Apr 2024 at 02:52.
Similar Threads
-
How to overlay image on video without conversion (keeping video quality) ?
By aaajan in forum EditingReplies: 14Last Post: 28th Jan 2021, 13:38 -
Converting video but keeping original AC-3 audio
By pooksahib in forum Video ConversionReplies: 5Last Post: 10th Dec 2020, 04:47 -
How much difference when edited video is re-encoded vs smart rendered?
By perfection in forum Newbie / General discussionsReplies: 4Last Post: 26th May 2020, 07:36 -
FFMPEG - Replacing a video stream, while keeping all other streams the same
By vandalay22 in forum Video Streaming DownloadingReplies: 4Last Post: 11th Nov 2019, 10:41 -
audio is garbled in video trims edited wih windows 10 photos app
By ot5707 in forum EditingReplies: 0Last Post: 28th Aug 2018, 10:15