GH5 Com Panasonic Semi-Pro Metadata Xml read into a csv

Started by markr3, January 03, 2020, 12:45:38 AM

Previous topic - Next topic

markr3

Can anyone please help with getting the data imbedded in Com Panasonic Semi-Pro Metadata Xml of .mov files from a GH5 into a csv file.

I can output all of Com Panasonic Semi-Pro Metadata Xml into one cell but I would like to extract only some of it into seperate cells. 1 example would be <BitDepth>. The process is doable for me at least with .MP4 files but not .mov's.

I have tried some of the Advanced formatting features in exiftool Application Documentation but I'm not good at understanding the syntax to get the result I'm after.

Any help would be greatly appreciated.

Phil Harvey

Can you upload a sample video somewhere so I can see what you are talking about?

- 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 ($).

markr3

Thank you for taking the time to look at these files.

One has a variable frame rate and the other has not. I specifically wanted to get the information below into columns in a csv. The second file is a 10bit recording with V-LogL as the Capture Gamma.

<GlobalClipID>060A2B340101010501010D2113000000AFBC0446F0407A346E350E90B8E10058</GlobalClipID>.<Codec BitRate="100">H264_420_LongGOP</Codec>.<BitDepth>8</BitDepth>.<VFRRatio VRFRState="constant">25/60</VFRRatio>.<CaptureGamma>CINELIKE_D</CaptureGamma>.<CaptureGamut>BT.709</CaptureGamut>

Here is the link: (https://drive.google.com/open?id=1JMFRaihp7B6WJRGFdY5SzRGIVYHuE5U0)

Thanks again.

markr3

I specifically get the information with this as clunky as it may seem.

exiftool -f -csv -c %.6f -MajorBrand -*Make -*Model* -LensType -OpticalZoomMode -FocalLength35efl -ScaleFactor35efl -Aperture -MaxApertureValue -ShutterSpeed -ISO -Megapixels -ExposureCompensation -AvgBitrate -RollAngle -PitchAngle -ColorTempKelvin -WhiteBalance -*WB*Level -BlueBalance -RedBalance -ColorRepresentation -GenOpColor -ColorSpace -ColorEffect -Contrast -Saturation -Sharpness -FocusMode -AFAreaMode -Compression -SceneMode -ImageQuality -gpsposition -WorldTimeLocation -TravelDay -Audio* -ImageStabilization -ShootingMode -*Serial* -AccessoryType -OutputLUT -TextStamp -ComPanasonicSemi-ProMetadataXml -VideoCodecBitRate -VideoCodecBitDepth -VariableFrameRateRatio -CaptureGamma -CaptureGamut -CircleOfConfusion -FOV -FocalLength -HyperfocalDistance -LightValue >outcsv.csv

I put this (-VideoCodecBitRate -VideoCodecBitDepth -VariableFrameRateRatio -CaptureGamma -CaptureGamut) at the end to create columns to copy and paste the information after from ComPanasonicSemi-ProMetadataXml

StarGeek

I was able to extract the XML from the  ComPanasonicSemi-ProMetadataXml-jpn-JP tag and pipe it back into exiftool to find the names that exiftool would give the data you want.

ClipMainClipContentGlobalClipID : 060A2B340101010501010D2113000000AFBC0446F0407A347B0B0E90B8E10058
ClipMainClipContentEssenceListVideoCodecBitRate: 400
ClipMainClipContentEssenceListVideoCodec: H264_422_Intra
ClipMainClipContentEssenceListVideoBitDepth: 10
ClipMainUserAreaAcquisitionMetadataCameraUnitMetadataGammaCaptureGamma: V-LogL
ClipMainUserAreaAcquisitionMetadataCameraUnitMetadataGamutCaptureGamut: V-Gamut

ClipMainClipContentGlobalClipID : 060A2B340101010501010D2113000000AFBC0446F0407A346E350E90B8E10058
ClipMainClipContentEssenceListVideoCodecBitRate: 100
ClipMainClipContentEssenceListVideoCodec: H264_420_LongGOP
ClipMainClipContentEssenceListVideoBitDepth: 8
ClipMainClipContentEssenceListVideoVFRRatioVRFRState: constant
ClipMainClipContentEssenceListVideoVFRRatio: 0.416666666666667
ClipMainUserAreaAcquisitionMetadataCameraUnitMetadataGammaCaptureGamma: CINELIKE_D
ClipMainUserAreaAcquisitionMetadataCameraUnitMetadataGamutCaptureGamut: BT.709


To list all that I used
exiftool  -ComPanasonicSemi-ProMetadataXml-jpn-JP -b Y:\!temp\qz | exiftool -g1 -a -s - -*GlobalClipID* -*codec* -*BitDepth* -*VFRRatio* -*CaptureGamma* -*CaptureGamut*
but the XML is all dumped together, which wouldn't be useful for your csv.

I got nothing on how to handle this.  Not without further scripting.
* 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).

markr3


markr3

I get this result:

exiftool -ComPanasonicSemi-ProMetadataXml-jpn-JP -b Y:\!temp\qz | exiftool -g1 -a -s - -*GlobalClipID* -*codec* -*BitDepth* -*VFRRatio* -*CaptureGamma* -*CaptureGamut* /Volumes/LUMIX/DCIM/110_GH5M/PGH50016.MOV
Error: File not found - Y:!tempqz
======== -
Error: File is empty - -
======== /Volumes/LUMIX/DCIM/110_GH5M/PGH50016.MOV
---- Track1 ----
BitDepth                        : 24
    2 image files read

Is there something I'm not doing correctly?

StarGeek

The "Y:\!temp\qz" part is the directory path to where I downloaded your files.  Replace that with your path /Volumes/LUMIX/DCIM/110_GH5M/PGH50016.MOV and remove it from the end.

I used wild cards when I looked for the data you wanted, but you could now be more specific (though longer) with
exiftool -ComPanasonicSemi-ProMetadataXml-jpn-JP -b /Volumes/LUMIX/DCIM/110_GH5M/PGH50016.MOV  | exiftool -g1 -a -s - -ClipMainClipContentGlobalClipID -ClipMainClipContentEssenceListVideoCodecBitRate -ClipMainClipContentEssenceListVideoCodec -ClipMainClipContentEssenceListVideoBitDepth -ClipMainUserAreaAcquisitionMetadataCameraUnitMetadataGammaCaptureGamma -ClipMainUserAreaAcquisitionMetadataCameraUnitMetadataGamutCaptureGamut

To break it down, the first part (before the pipe |) extracts the ComPanasonicSemi-ProMetadataXml-jpn-JP using the -b (binary) option.  It then pipes that output to another exiftool command, which reads it because it is using the dash - as input and outputs the desired tags.
* 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).

markr3


StarGeek

The main problem with the procedures in my posts is that they don't make it easy to output to a csv file.  If you use that command on more than one file at a time, the XML all get's run together with no easy way to separate it.  Like I said, I don't see any easy way to handle this.
* 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).

markr3

Thanks, If I only can do a file at a time it still saves me a lot of time cutting and pasting. I have to shoot some MP4 files from time to time that require a different method, but much easier. I work on a mac and are now using Automator to streamline my process a little more. With the metadata baked into Final Cut Pro X's custom metadata view sets it makes it very simple to search, find and group clips according to the criteria I can work with. I can get on with edit much sooner now.

You have helped me a lot get over the hurdle I couldn't manage for quite some time, so thanks again.

Phil Harvey

Just FYI, ExifTool 11.82 and later will allow you to extract these XML tags individually using the attached config file.

For example:

% exiftool -config pana_xml.config "-xml:*video*" tmp
======== tmp/PGH50016.MOV
Clip Main Clip Content Essence List Video Codec Bit Rate: 400
Clip Main Clip Content Essence List Video Codec: H264_422_Intra
Clip Main Clip Content Essence List Video Active Line: 2496
Clip Main Clip Content Essence List Video Active Pixel: 3328
Clip Main Clip Content Essence List Video Bit Depth: 10
Clip Main Clip Content Essence List Video Frame Rate: 25p
Clip Main Clip Content Essence List Video Timecode Type: NonDrop
Clip Main Clip Content Essence List Video Start Timecode: 10:39:05:09
======== tmp/PGH50017.MOV
Clip Main Clip Content Essence List Video Codec Bit Rate: 100
Clip Main Clip Content Essence List Video Codec: H264_420_LongGOP
Clip Main Clip Content Essence List Video Active Line: 2160
Clip Main Clip Content Essence List Video Active Pixel: 3840
Clip Main Clip Content Essence List Video Bit Depth: 8
Clip Main Clip Content Essence List Video Frame Rate: 25p
Clip Main Clip Content Essence List Video VFR Ratio VRFR State: constant
Clip Main Clip Content Essence List Video VFR Ratio: 0.416666666666667
Clip Main Clip Content Essence List Video Timecode Type: NonDrop
Clip Main Clip Content Essence List Video Start Timecode: 10:39:07:07
    1 directories scanned
    2 image files read


- 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 ($).

markr3


no.ki

Hello!
I'm also trying to extract XML tags, but I cannot get it working. Even if I use exactly the same command (though under Win10 64, Exiftool 12.2.6.0) with the same MOV-file, I'm getting an empty result:

C:\Program Files\ffmpeg>exiftool.exe -config pana_xml.config "-xml:*video*" "C:\Users\Test\Downloads\PGH50016.MOV"

C:\Program Files\ffmpeg>


Why is that? I'm puzzled..

Thanks,
Nils

Phil Harvey

Hi Nils,

There was a change in recent ExifTool versions that unfortunately changed the tag ID's for Keys tags.  I should fix this to make it backward compatible.  But for now, this config file should work.

- 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 ($).