Page 1 of 1

Match Duration from XML

Posted: Mon Jan 13, 2025 11:43 am
by graham728
Hi - I'd like to know if the below is possible?

Match Duration from XML to file and send email notification if they don't match.

I already have workflows that analyse XMLS with their counterpart MXF files. I'd like to know if there's a way I can set it up so that if the duration listed in the XML doesn't match the duration in the file name, a warning notification is sent?

For example, file name is GDP-XXXX001-010.mxf (ten seconds) The last three digits being the duration. If the XML On Air Duration is 00:00:20 then a warning notification is sent.

60 Seconds (One Minutes)
GDP-XXXX001-060.mxf (60 seconds) is noted as 00:01:00 in XMLS

Re: Match Duration from XML

Posted: Tue Jan 14, 2025 7:57 am
by ThomasM
Hi Graham,

maybe you can calculate everything in seconds with function $tctosec() to have a common base? Then extract the right side of the filename with a RegEx from on the - (so only 010 or 060 remains)? Then compare both with the conditional-Node?

just an idea...

regards,
thomas

Re: Match Duration from XML

Posted: Tue Jan 14, 2025 6:48 pm
by emcodem
Yeah if you really want to compare the right part of the filename to the xml duration, you got to use some toTc functions as ThomasM proposes, either the tc to seconds or the frames to tc ($tctosec or $inttotc).
If you want to compare the actual analyzed duration %s_duration_tc% then it is more easy if you know how to extract the tc part from XML, e.g. using regex

Code: Select all

$regext('%s_xml%',"Start_Of_Message>(.+?)<")
fear you need to be more specific on what part you actually face problems with... Also i guess the time in the filename is a more accurate duration than the one we analyze with exiftool and co., we have a similar system for advertisements... the strategy completely failed once we changed the playout system :D