Creating XMP startTimecode & altTimecode for a file with no XMP Metadata

Started by Recon222, April 09, 2024, 10:21:54 AM

Previous topic - Next topic

Recon222

I am super new and was trying to work this problem with ChatGPT Code Pilot but it was not working.

I have CCTV files with no XMP data at all. I want to add XMP start timecode to the files so that it is seen by Adobe Premiere as Media Start Time for multic cam sycing.

I know I can create start timecode in Media Encoder but my end goal is to be able to parse the file name that contains the start time of the file with Python and have it take the parsed start time and have Exiftool write it as start timecode. I have the Python parsing code worked out but I can't get Exiftool to write the XMP.

Any help would be greatly appreciated.


Phil Harvey

StartTimeCode is a structure, so you'll have to figure out what values you want to use for the elements of the structure.  I suggest finding an example file that already contains this information and running this command:

exiftool -starttimecode -struct FILE.xmp

Then you can write StartTimeCode with the same structure as returned from the above command:

exiftool "-starttimecode=VALUE" FILE.xmp

Get it working from the command line before you try to run the command from Python.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Recon222

Thank you so much! I was reading your replys on other posts before I posted and was hoping that you would reply to mine. Sorry for the late reply, work is insane right now. I am going to try your suggestion tonight and get back to you. Thank you again.

Recon222

That worked perfectly to add the XMP start timecode to the MP4 file but Premiere would not see the start timecode as Media start time. I did a bunch of testing and realized that when I transcoded the file with Adobe Media Encoder and then added the Start Timecode via EXif it would work. I opened both files in Amped FIVE and when I viewed the Exif data I could see a ton more XMP data in the Media Endcoder transcode. I copied all of that data into a txt file, brought it into Chat GPT Code Pilot and asked it to create the exif code to add all of the missing XMP data to my oringinal file including the start and alt timecode based on the structure you helpd me uncover. Sure enough is wrote the whole code, it added the data on the first try and Premiere saw it as Media Start Time. I spent last night hacking at the code to se what I could remove to have it still be seen by premiere. I got it down to:

exiftool "-XMP-xmpDM:StartTimeSampleSize=1" "-XMP-xmpDM:StartTimeScale=27" "-XMP-xmpDM:VideoFrameRate=27.000000" "-alttimecode={TimeFormat=25 fps,TimeValue=01:54:55:00}" "-starttimecode={TimeFormat=25 fps,TimeValue=01:54:55:00}" "My Video.mp4"


The timescale and frame rate won't chage the frame rate from the 27.03fps that the video files are and show up in Premiere as so the Media Start time is a bit off but once I interprit the footage to 27fps in Premiere the time becomes correct. I tried changing them to 50fps to see if they were just place holders and the frame rate was being pulled from somwhere else but when I changed them the time went way off.