Hello,
I am trying to get the $sampletime tag from an .mp4 with GPS data embedded to save in a format of seconds (ie. 86:12 for 1 minute, 26.12 seconds).
Currently it saves as seconds until it gets to 30s when it moves to hh:mm:ss. My .fmt file for the xml I am saving has this section as:
<sampletime>$sampletime</sampletime>
In case it matters, I need it in this format so I can easily sync it with a videoplayer in Unity. It would also be great if anyone knew how to remove the
" s" that suffixes the sampletime data in the .fmt since I have to do this in code when parsing.
Any help would be much appreciated
Try adding a hashtag to the end of the tag name. See the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) for details. It will show just the seconds as 86.12
Thanks, I added the # and it works but the first few numbers are shortened with e (see below). do you know how to remove that and have the raw decimal? or even how to round these numbers to 2dp (for example) in situ during extraction (with an xml tag format or something)?
<sampletime> 3e-006 </sampletime>
would like it to be 0.0...3 etc.
Thanks again :)
Rounding 3e-006 to 2 decimal places is 0.00 ;)
3e-006 = 0.000003
Try using
${Sampletime#;$_=sprintf('%.10f',$_)}
Replace 10 with the number of decimal places.
Thank you so much! worked perfectly
Have a great day :)