Match Duration from XML

Questions and answers on how to get the most out of FFAStrans
Post Reply
graham728
Posts: 88
Joined: Sat Oct 13, 2018 10:54 pm

Match Duration from XML

Post 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
Attachments
Screenshot 2025-01-13 114103.png
Screenshot 2025-01-13 114103.png (288.94 KiB) Viewed 918 times
ThomasM
Site Admin
Posts: 232
Joined: Wed Feb 22, 2017 6:36 am

Re: Match Duration from XML

Post 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
emcodem
Posts: 1826
Joined: Wed Sep 19, 2018 8:11 am

Re: Match Duration from XML

Post 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
emcodem, wrapping since 2009 you got the rhyme?
Post Reply