Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

ExifTool newbie

by Anonymous Monk
on Jan 07, 2012 at 18:26 UTC ( [id://946782]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I am in the process of learning Perl and so i am trying to make some scripts to get hands on it. Some people are beginning to use a quite exotic encoding that is not compatible with my set top box so i decided to use this to get a better grip on Perl.

What i am looking for is a tag in Matroska container using ExifTool, using other cli tools the tag i am looking for is looking like this :

CodecPrivate, length 51 (h.264 profile: High 10 @L4.1)

The doc on ExifTool redirected me to find :

http://search.cpan.org/~exiftool/Image-ExifTool-8.65/lib/Image/ExifTool/TagNames.pod#Matroska_Tags

0x23a2 CodecPrivate?

#!/usr/bin/perl use strict; use Data::Dump; use Image::ExifTool; #CodecPrivate, length 51 (h.264 profile: High 10 @L4.1) my @files = <*>; foreach my $file (@files) { next unless ($file =~ m/\.mkv$/); print $file . " is being parsed\n"; my $exifTool = new Image::ExifTool; $exifTool->ExtractInfo($file, 'Verbose'); my $info = $exifTool->GetInfo('CodecPrivate?'); print "Tags:"; print pp $info; print "\n"; }

But $info is empty, any directions what i did wrong is heartly welcomed.

Replies are listed 'Best First'.
Re: ExifTool newbie
by toolic (Bishop) on Jan 07, 2012 at 18:38 UTC
    Check if ExtractInfo was successful (Tip #11 from the Basic debugging checklist):
    if ($exifTool->ExtractInfo($file, 'Verbose')) { # do your stuff } else { die "ExtractInfo error"; }
Re: ExifTool newbie
by JavaFan (Canon) on Jan 07, 2012 at 21:16 UTC
    The documentation you're linking at says that if a tagname is followed by a question mark, it's only extracted when giving the unknown option. And I think it also means that it's not part of the actual tag name (so, you should use "CodecPrivate" as argument to GetInfo).

    Note that I have no experience with the format you're working with -- all I did was read the beginning of the manual page you're linking to.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://946782]
Approved by toolic
Front-paged by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found