Hello group!
I have been lurking on this site for months, trying to educate myself. Time to join and post.
I have been in the process of moving cell phone videos (all of them are .mp4 from different android phones) to the computer. Here is what I have learned (or think I have learned)…
When the phone records the video it names it based on the date and local time (military) that it began recording the video (which is a GOOD thing I think).
On my Galaxy S1 the format is “video-yyyy-mm-dd-hh-mm-ss.mp4”
On my Galaxy S2 and S4 the format is “yyyymmdd_hhmmss.mp4”
The beautiful thing about this is I know exactly when the video was recorded, it’s right in the name! (Of course this assumes that the time & date are correct on the phone, but they always seem to be)
On the S2 and S4 it also sets the “Encoded date” and “Tagged date” (I believe these are called flags) inside the file, based on the date and UTC time that it stopped recording. As near as I can tell the “Encoded Date” is most similar to the “Date Taken” flag on a .jpg. For my purposes I think I only need the Encoded Date. (The S1 does not seem to have put these fields/flags in at all, we’ll address that a bit later).
The format is “UTC yyyy-mm-dd hh:mm:ss”
Okay, so that is my understanding of how my phones recorded the videos.
Now, let’s throw NTFS into the mix;
https://whereismydata.wordpress.com/2009/02/14/dates-ntfs-created-modified-accessed-written/
So, it would seem that when I copy/move files from the phone, the Windows operating system adds a little more information. (Let us NOT have a debate about how wonderful or crappy Windows is. It is what my laptop came with. It is what I am familiar with). Of the initial 4 fields (attributes) written (from the link above) I believe that “File Created” is the most important. I am using Windows Photo Gallery to store and view my photos and videos. It seems to sort them chronologically using the “File Created” date stored in each file. So the first big problem is that the File Created date can be (and usually is) wrong on my mp4’s
I have read this thread about 20 times;
https://forum.videohelp.com/threads/361679-Please-Help!-Date-and-Time-issues-mp4-Encoded-vs-Created
Using the “ChangeDateTime.bat” file that Budman so graciously gave us, it seems to solve the “File Created attribute” problem IF (and that’s a big if) the encoded date is correct!!! (It says it also corrects for UTC, I live in the Mountain Time Zone so somebody could double check that for me). But, what if I don’t have an “Encoded Date” flag in the file? I need a batch utility which can change/create the Encoded Date flag using the file name as the source (it would need to adjust for UTC because the phone already set the filename to local). I have used and am comfortable with renaming utilities, so I could change the filenames from the S1 to be the same as the S2/S4 (unless it’s just as easy for somebody to make me two batch files, one for each name format). All of my mp4’s are in folders (directories) based on what phone they came from. So the batch file I need does not really need to check sub-directories, ‘cause there aren’t any, it just needs to process all the files in a given folder. I have read about ffmpeg, I think it will do it, but I lack the knowledge to make it work. I could be barking up the wrong tree on that one…
+ Reply to Thread
Results 1 to 13 of 13
-
-
Try first this this ffmpeg command on one mp4 and see if sets the encoded date correctly.
Code:c:\ffmpeg\ffmpeg.exe -i c:\video\input.mp4 -c copy -map 0 -metadata creation_time="2015-06-01 12:00:00" c:\video\output.mp4
-
That should please you.
Code:@echo off :label2 set id= for %%f in ("%~dp1*.mp4") do set file=%%f echo.%file% set file=%file:.mp4=% echo.%file%>>file.txt for /f "tokens=1,2,3,4,5,6,7 delims=-" %%a in (file.txt) do ( set id=%%a set year=%%b set month=%%c set day=%%d set hour=%%e set minute=%%f set second=%%g ) if [%id%]==[] goto label1 del file.txt mp4box.exe -new -add "%file%.mp4" -itags created="UTC %year%-%month%-%day% %hour%:%minute%:%second%" "%file%_1.mp4" xcopy /Q /V %file%_1.mp4 out\%file%.mp4 del %file%.mp4,%file%_1.mp4 if [%id%]==[video] goto label2 :label1 pause
-
Okay,
Finally got around to testing this.
It does add three new tags to the video
"Recorded" "Encoded" and "Tagged"
the Recorded tag is correct
BUT, the Encoded and Tagged tags are showing today's date.
Also, it adds the tags to the first file, then it asks if the second file is a file or directory. Not sure what that means.
Any Thoughts??? -
-
Nearly good, but something is wrong.
MediaInfo settings should be "Options -> Preferences -> Output format" Text "'
Then copy the "Text" directly to the forum.
Opsss ... my mistake. It should work. Press F and changed files are in a directory MP4 "OUT".
Code:@echo off :label2 set file= for %%f in ("%~dp1*.mp4") do set file=%%f echo.%file% set file=%file:.mp4=% echo.%file%>>file.txt for /f "tokens=1,2,3,4,5,6,7 delims=-" %%a in (file.txt) do ( set id=%%a set year=%%b set month=%%c set day=%%d set hour=%%e set minute=%%f set second=%%g ) if [%file%]==[] goto label1 echo %id% del file.txt mp4box.exe -new -add "%file%.mp4" -itags created="UTC %year%-%month%-%day% %hour%:%minute%:%second%" "%file%_1.mp4" xcopy /Q /V %file%_1.mp4 out\%file%.mp4 del %file%.mp4,%file%_1.mp4 if [%id%]==[video] goto label2 :label1 pause
Code:Recorded date : UTC XXXX-XX-XX XX:XX:XX
-
-
Encoded Date/Time
https://forum.videohelp.com/threads/361679-Please-Help!-Date-and-Time-issues-mp4-Encoded-vs-Created
You can use function: mp4box -keep-utc (originaly date encoded) -
Jamaika,
The batch file you created for me works on the files in the format of “video-yyyy-mm-dd-hh-mm-ss.mp4”
Could you please modify it to work on files in the format of “yyyymmdd_hhmmss.mp4”
Thanks
Craig -
Hi Pumbaa,
Code:@echo off :label2 set file= for %%f in ("%~dp1*.mp4") do set file=%%f echo.%file% set file=%file:.mp4=% echo.%file%>>file.txt set file=video_%file% for /f "tokens=1,2,3 delims=_" %%a in (file.txt) do ( set id=%%a set yyyymmdd=%%b set hhmmss=%%c ) set year=%yyyymmdd:~-4,4% set month=%yyyymmdd:~4,2% set day=%yyyymmdd:~6,2% set hour=%hhmmss:~-4,2% set minute=%hhmmss:~2,2% set second=%hhmmss:~4,2% if [%file%]==[] goto label1 echo %id% del file.txt mp4box.exe -new -add "%file%.mp4" -itags created="UTC %year%-%month%-%day% %hour%:%minute%:%second%" "%file%_1.mp4" xcopy /Q /V %file%_1.mp4 out\%file%.mp4 del %file%.mp4,%file%_1.mp4 if [%id%]==[video] goto label2 :label1 pause
Similar Threads
-
Please Help! Date and Time issues mp4 Encoded vs Created
By milkieed in forum Newbie / General discussionsReplies: 38Last Post: 7th Nov 2018, 17:18 -
How to auto create time and date subtitle?
By zaerdy in forum SubtitleReplies: 9Last Post: 20th May 2015, 09:51 -
Encoded/Tagged date & Title fields in MP4 video file (VirtualDub + MP4Box)
By spinik in forum Video ConversionReplies: 11Last Post: 26th Nov 2013, 16:11 -
videos/pictures - how can modify date be before creation date
By jyeh74 in forum Off topicReplies: 2Last Post: 20th Oct 2013, 15:12 -
mp4 and created/encoded date meta data field?
By wessond in forum Video ConversionReplies: 2Last Post: 12th Jul 2010, 21:33