Main Menu

Tags with spaces

Started by lavAzza, June 06, 2018, 08:24:42 AM

Previous topic - Next topic

lavAzza

Please help to extract data from mov in specific format.
I get this data with
exiftool -ee "2018-03-22-11-56-09.MOV" > video.txt
ExifTool Version Number         : 10.87
File Name                       : 2018-03-22-11-56-09.MOV
Directory                       : //Path
File Size                       : 340 MB
File Modification Date/Time     : 2018:03:22 11:59:10+05:00
File Access Date/Time           : 2018:05:03 10:26:13+05:00
File Creation Date/Time         : 2018:03:22 11:59:10+05:00
File Permissions                : rw-rw-rw-
File Type                       : MOV
File Type Extension             : mov
MIME Type                       : video/quicktime
Major Brand                     : Apple QuickTime (.MOV/QT)
Minor Version                   : 0.0.0
Compatible Brands               : qt
Movie Header Version            : 0
Create Date                     : 2018:03:22 11:56:09
Modify Date                     : 2018:03:22 11:56:09
Time Scale                      : 30000
Duration                        : 0:03:01
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 4
Track Header Version            : 0
Track Create Date               : 2018:03:22 11:56:09
Track Modify Date               : 2018:03:22 11:56:09
Track ID                        : 1
Track Duration                  : 0:03:01
Track Layer                     : 0
Track Volume                    : 0.00%
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Image Width                     : 1920
Image Height                    : 1080
Clean Aperture Dimensions       : 1920x1080
Production Aperture Dimensions  : 1920x1080
Encoded Pixels Dimensions       : 1920x1080
Media Header Version            : 0
Media Create Date               : 2018:03:22 11:56:09
Media Modify Date               : 2018:03:22 11:56:09
Media Time Scale                : 30000
Media Duration                  : 0:03:01
Handler Class                   : Media Handler
Handler Type                    : Video Track
Handler Description             : Ambarella AVC
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Handler Class                   : Data Handler
Handler Type                    : Alias Data
Handler Description             : Ambarella AVC
Compressor ID                   : avc1
Source Image Width              : 1920
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Compressor Name                 : Ambarella AVC encoder
Bit Depth                       : 24
Pixel Aspect Ratio              : 0:0
Clean Aperture Width            : 1920
Clean Aperture Height           : 1080
Clean Aperture Offset X         : 0
Clean Aperture Offset Y         : 0
Color Representation            : aclc 1 1 1
Gamma                           : 2.2
Buffer Size                     : 0
Max Bitrate                     : 0
Average Bitrate                 : 0
Video Frame Rate                : 29.97
Track Header Version            : 0
Track Create Date               : 2018:03:22 11:56:09
Track Modify Date               : 2018:03:22 11:56:09
Track ID                        : 2
Track Duration                  : 0:03:01
Track Layer                     : 0
Track Volume                    : 100.00%
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2018:03:22 11:56:09
Media Modify Date               : 2018:03:22 11:56:09
Media Time Scale                : 48000
Media Duration                  : 0:03:01
Handler Class                   : Media Handler
Handler Type                    : Audio Track
Handler Description             : Ambarella AAC
Balance                         : 0
Handler Class                   : Data Handler
Handler Type                    : Alias Data
Handler Description             : Ambarella AAC
Audio Format                    : mp4a
Audio Channels                  : 1
Audio Bits Per Sample           : 16
Audio Sample Rate               : 48000
Track Header Version            : 0
Track Create Date               : 2018:03:22 11:56:09
Track Modify Date               : 2018:03:22 11:56:09
Track ID                        : 3
Track Duration                  : 0:03:01
Track Layer                     : 65535
Track Volume                    : 0.00%
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2018:03:22 11:56:09
Media Modify Date               : 2018:03:22 11:56:09
Media Time Scale                : 30000
Media Duration                  : 0:03:01
Handler Class                   : Media Handler
Handler Type                    : Text
Handler Description             : Ambarella EXT
Gen Media Version               : 0
Gen Flags                       : 0 0 0
Gen Graphics Mode               : ditherCopy
Gen Op Color                    : 32768 32768 32768
Gen Balance                     : 0
Handler Class                   : Data Handler
Handler Type                    : Alias Data
Handler Description             : Ambarella EXT
Other Format                    : text
Sample Time                     : 0 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:09-N54.603189-E53.678269-S018_END
Sample Time                     : 1.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:10-N54.603234-E53.678282-S018_END
Sample Time                     : 2.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:11-N54.603282-E53.678294-S018_END
Sample Time                     : 3.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:12-N54.603334-E53.678310-S021_END
Sample Time                     : 4.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:13-N54.603388-E53.678326-S021_END
Sample Time                     : 5.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:14-N54.603442-E53.678343-S021_END
Sample Time                     : 6.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:15-N54.603498-E53.678360-S021_END
Sample Time                     : 7.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:16-N54.603555-E53.678377-S021_END
Sample Time                     : 8.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:17-N54.603606-E53.678395-S018_END
Sample Time                     : 9.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:18-N54.603654-E53.678411-S018_END
Sample Time                     : 10.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:19-N54.603701-E53.678426-S018_END
Sample Time                     : 11.00 s
Sample Duration                 : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:20-N54.603749-E53.678442-S018_END

And I need to get data in format





File NameTextSample Time
2018-03-22-11-56-09.MOV$GS:0,0,0$G:2018-03-22 11:56:20-N54.603749-E53.678442-S018_END11.00
2018-03-22-11-56-09.MOV$GS:0,0,0$G:2018-03-22 11:56:20-N54.603749-E53.678442-S018_END12.00
It work for $Text tag:
exiftool -ee -p "$Text" "2018-03-22-11-56-09.MOV" > video.txt
but not work for $File Name and $Sample Time (due to spaces?)
How to escape spaces in tags?

Phil Harvey

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


lavAzza

Quote from: Phil Harvey on June 06, 2018, 10:08:04 AM
And one more question please.
Why I get
Warning: [Minor] Tag 'Doc99:FileName' not defined - 2018-03-22-11-56-09.MOV
for
exiftool -ee -p "$FileName $Text, $SampleTime" "2018-03-22-11-56-09.MOV" > video.txt
For -s key I get this
exiftool -ee -s "2018-03-22-11-56-09.MOV" > s-video.txt
ExifToolVersion                 : 10.87
FileName                        : 2018-03-22-11-56-09.MOV
Directory                       : //project/storage/SP/videotracks/Tuimazy
FileSize                        : 340 MB
FileModifyDate                  : 2018:03:22 11:59:10+05:00
FileAccessDate                  : 2018:05:03 10:26:13+05:00
FileCreateDate                  : 2018:03:22 11:59:10+05:00
FilePermissions                 : rw-rw-rw-
FileType                        : MOV
FileTypeExtension               : mov
MIMEType                        : video/quicktime
MajorBrand                      : Apple QuickTime (.MOV/QT)
MinorVersion                    : 0.0.0
CompatibleBrands                : qt
MovieHeaderVersion              : 0
CreateDate                      : 2018:03:22 11:56:09
ModifyDate                      : 2018:03:22 11:56:09
TimeScale                       : 30000
Duration                        : 0:03:01
PreferredRate                   : 1
PreferredVolume                 : 100.00%
MatrixStructure                 : 1 0 0 0 1 0 0 0 1
PreviewTime                     : 0 s
PreviewDuration                 : 0 s
PosterTime                      : 0 s
SelectionTime                   : 0 s
SelectionDuration               : 0 s
CurrentTime                     : 0 s
NextTrackID                     : 4
TrackHeaderVersion              : 0
TrackCreateDate                 : 2018:03:22 11:56:09
TrackModifyDate                 : 2018:03:22 11:56:09
TrackID                         : 1
TrackDuration                   : 0:03:01
TrackLayer                      : 0
TrackVolume                     : 0.00%
MatrixStructure                 : 1 0 0 0 1 0 0 0 1
ImageWidth                      : 1920
ImageHeight                     : 1080
CleanApertureDimensions         : 1920x1080
ProductionApertureDimensions    : 1920x1080
EncodedPixelsDimensions         : 1920x1080
MediaHeaderVersion              : 0
MediaCreateDate                 : 2018:03:22 11:56:09
MediaModifyDate                 : 2018:03:22 11:56:09
MediaTimeScale                  : 30000
MediaDuration                   : 0:03:01
HandlerClass                    : Media Handler
HandlerType                     : Video Track
HandlerDescription              : Ambarella AVC
GraphicsMode                    : srcCopy
OpColor                         : 0 0 0
HandlerClass                    : Data Handler
HandlerType                     : Alias Data
HandlerDescription              : Ambarella AVC
CompressorID                    : avc1
SourceImageWidth                : 1920
SourceImageHeight               : 1080
XResolution                     : 72
YResolution                     : 72
CompressorName                  : Ambarella AVC encoder
BitDepth                        : 24
PixelAspectRatio                : 0:0
CleanApertureWidth              : 1920
CleanApertureHeight             : 1080
CleanApertureOffsetX            : 0
CleanApertureOffsetY            : 0
ColorRepresentation             : aclc 1 1 1
Gamma                           : 2.2
BufferSize                      : 0
MaxBitrate                      : 0
AverageBitrate                  : 0
VideoFrameRate                  : 29.97
TrackHeaderVersion              : 0
TrackCreateDate                 : 2018:03:22 11:56:09
TrackModifyDate                 : 2018:03:22 11:56:09
TrackID                         : 2
TrackDuration                   : 0:03:01
TrackLayer                      : 0
TrackVolume                     : 100.00%
MatrixStructure                 : 1 0 0 0 1 0 0 0 1
MediaHeaderVersion              : 0
MediaCreateDate                 : 2018:03:22 11:56:09
MediaModifyDate                 : 2018:03:22 11:56:09
MediaTimeScale                  : 48000
MediaDuration                   : 0:03:01
HandlerClass                    : Media Handler
HandlerType                     : Audio Track
HandlerDescription              : Ambarella AAC
Balance                         : 0
HandlerClass                    : Data Handler
HandlerType                     : Alias Data
HandlerDescription              : Ambarella AAC
AudioFormat                     : mp4a
AudioChannels                   : 1
AudioBitsPerSample              : 16
AudioSampleRate                 : 48000
TrackHeaderVersion              : 0
TrackCreateDate                 : 2018:03:22 11:56:09
TrackModifyDate                 : 2018:03:22 11:56:09
TrackID                         : 3
TrackDuration                   : 0:03:01
TrackLayer                      : 65535
TrackVolume                     : 0.00%
MatrixStructure                 : 1 0 0 0 1 0 0 0 1
MediaHeaderVersion              : 0
MediaCreateDate                 : 2018:03:22 11:56:09
MediaModifyDate                 : 2018:03:22 11:56:09
MediaTimeScale                  : 30000
MediaDuration                   : 0:03:01
HandlerClass                    : Media Handler
HandlerType                     : Text
HandlerDescription              : Ambarella EXT
GenMediaVersion                 : 0
GenFlags                        : 0 0 0
GenGraphicsMode                 : ditherCopy
GenOpColor                      : 32768 32768 32768
GenBalance                      : 0
HandlerClass                    : Data Handler
HandlerType                     : Alias Data
HandlerDescription              : Ambarella EXT
OtherFormat                     : text
SampleTime                      : 0 s
SampleDuration                  : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:09-N54.603189-E53.678269-S018_END
SampleTime                      : 1.00 s
SampleDuration                  : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:10-N54.603234-E53.678282-S018_END
SampleTime                      : 2.00 s
SampleDuration                  : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:11-N54.603282-E53.678294-S018_END
SampleTime                      : 3.00 s
SampleDuration                  : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:12-N54.603334-E53.678310-S021_END
SampleTime                      : 4.00 s
SampleDuration                  : 1.00 s
Text                            :  $GS:0,0,0$G:2018-03-22 11:56:13-N54.603388-E53.678326-S021_END
SampleTime                      : 5.00 s
SampleDuration                  : 1.00 s

Phil Harvey

With the -ee option, The -p output is repeated for each sub-document, and there can be many of these with the -ee option.  However, no sub-documents contain a FileName tag, so you will get a warning. Add -q -q to suppress these warnings.

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