Rational Number (fraction) for Time values?

Started by SRPilot, October 13, 2021, 07:09:56 PM

Previous topic - Next topic

SRPilot

I'm creating a FinalCutPro XML file to import a number of clips into Davinci Resolve.  The timecodes use a fraction instead of a decimal number.  Is there any option to have ExifTool return the rational number fraction rather than a decimal value?

Below is an example of the fcpxml that was exported by Davinci Resolve
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fcpxml>
<fcpxml version="1.9">
    <resources>
        <format frameDuration="1/24s" width="1920" height="1080" name="FFVideoFormat1080p24" id="r0"/>
      <asset start="2356563/13s" duration="79871/13s" hasAudio="1" audioSources="1" name="RPReplay_Final1632496242.mp4" format="r1" id="r2" hasVideo="1" audioChannels="2">
            <media-rep src="file://localhost/N:/2021%2009%2025%20Glacier/iPhone/RPReplay_Final1632496242.mp4" kind="original-media"/>
      </asset>
   </resources>
    <library>
        <event name="Timeline 1 (Resolve)">
            <project name="Timeline 1 (Resolve)">
                <sequence tcStart="0/1s" tcFormat="NDF" duration="73727/12s" format="r0">
                    <spine>
                        <asset-clip offset="0/1s" start="2356563/13s" tcFormat="NDF" duration="73727/12s" enabled="1" name="RPReplay_Final1632496242.mp4" format="r1" ref="r2">
                            <adjust-transform anchor="0 0" scale="1 1" position="0 0"/>
                            <asset-clip offset="4719587/26s" start="37301/1s" tcFormat="NDF" duration="27/2s" enabled="1" name="IMG_2574.MOV" lane="1" format="r3" ref="r4">
                                <adjust-transform anchor="0 0" scale="1 1" position="0 0"/>
                            </asset-clip>
                      </asset-clip>
                    </spine>
                </sequence>
            </project>
        </event>
    </library>
</fcpxml>

Phil Harvey

Are you talking about extracting this information from MP4 files?  What is the significance of the denominator, and where would ExifTool get this information?

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

Hayo Baan

Have you already tried extracting the "raw" value e.g. by adding # to the name of the particular tag?
Hayo Baan – Photography
Web: www.hayobaan.nl

StarGeek

Most of the time exiftool still seems to give decimal even with the -n (--printConv) option.  GPS coordinates, for example.  You can get the actual fractions using -v3 but it still returns decimals with -n
| | 1)  GPSLatitudeRef = N
  | |     - Tag 0x0001 (2 bytes, string[2]):
  | |         007c: 4e 00                                           [N.]
  | | 2)  GPSLatitude = 40 41 21.12 (40/1 41/1 528/25)
  | |     - Tag 0x0002 (24 bytes, rational64u[3]):
  | |         00a8: 00 00 00 28 00 00 00 01 00 00 00 29 00 00 00 01 [...(.......)....]
  | |         00b8: 00 00 02 10 00 00 00 19                         [........]
  | | 3)  GPSLongitudeRef = W
  | |     - Tag 0x0003 (2 bytes, string[2]):
  | |         0094: 57 00                                           [W.]
  | | 4)  GPSLongitude = 74 2 40.2 (74/1 2/1 201/5)
  | |     - Tag 0x0004 (24 bytes, rational64u[3]):
  | |         00c0: 00 00 00 4a 00 00 00 01 00 00 00 02 00 00 00 01 [...J............]
  | |         00d0: 00 00 00 c9 00 00 00 05                         [........]
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).