Tag Archive: cpan


I have multiple audiobook files (m4b) that ffprobe is able to retrieve the chapters from just fine… except the chapter information is printed to stderr and never in the formatted (STDOUT) output. The Perl module FFprobe doesn’t handle the chapters so I submitted feature request #73803

Feature request is to format the chapter output.

jason@jason-Inspiron-1545 ~/bin $ ffprobe "/home/jason/Audiobooks/Ben Bova/Mars/Mars 1.m4b" 1>/dev/null
….
  libavutil    51.  7. 0 / 51.  7. 0
  libavcodec   53.  5. 0 / 53.  5. 0
  libavformat  53.  2. 0 / 53.  2. 0
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  4. 0 /  2.  4. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  52.  0. 0 / 52.  0. 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xddfac0] max_analyze_duration reached
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘/home/jason/Audiobooks/Ben Bova/Mars/Mars 1.m4b’:
  Metadata:
    major_brand     : M4B
    minor_version   : 0
    compatible_brands: M4B mp42isom
    creation_time   : 2009-09-08 16:19:29
    album           : Mars
    artist          : Ben Bova
    genre           : Audiobook
  Duration: 03:51:23.41, start: 0.000000, bitrate: 81 kb/s
    Chapter #0.0: start 0.000000, end 2779.567914
    Metadata:
      title           : Mars – 01 of 24
    Chapter #0.1: start 2779.567914, end 5555.049161
    Metadata:
      title           : Mars – 02 of 24
    Chapter #0.2: start 5555.049161, end 8334.617075
    Metadata:
      title           : Mars – 03 of 24
    Chapter #0.3: start 8334.617075, end 11110.098322
    Metadata:
      title           : Mars – 04 of 24
    Chapter #0.4: start 11110.098322, end 13883.419864
    Metadata:
      title           : Mars – 05 of 24
    Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 80 kb/s
    Metadata:
      creation_time   : 2009-09-08 16:19:29
    Stream #0.1(eng): Subtitle: text / 0×74786574
    Metadata:
      creation_time   : 2009-09-08 17:31:00
Unsupported codec with id 94213 for input stream 1
jason@jason-Inspiron-1545 ~/bin $

patch to add m4b chapter support:

82c82
< my ($tree, $branch, $tag, $stream);

>     my ($tree, $branch, $tag, $stream, $chapter);
100c100,108
< }

>   } elsif ($line =~ m/Chapter \#(\d+\.*\d+): start (\d+\.*\d+)\, end (\d+\.*\d+)/i) {
>       my ($start, $end) = ($2, $3);
>       $chapter = $1;
>       $chapter =~ s/\.//g;
>       $chapter =~ s/^0+(\d)/$1/;
>
>       $$tree{chapters}{$chapter} = { start => $start, end => $end };
>     } elsif ($line =~ /title\s+: (.+)$/) {
>       $$tree{chapters}{$chapter}{title} = $1;
101a110
>   }

I just uploaded the Perl module Flickr::Simple2 version 0.03 to CPAN (PAUSE) so it might be a few minutes/hours before it shows up in the CPAN mirrors.

Revision history for Perl extension Flickr::Simple2.

0.03  Wed May 13 11:18:00 2009
- significant changes to the API to make more methods of the Flickr API available.
- using Iterator::Simple so we can retrieve one photo at a time and internalize the handling of Flickr Photo *pages*
0.02  Initial CPAN release
0.01  Thu Feb 12 11:33:35 2009
- original version; created by h2xs 1.23 with options
-XA -n Flickr::Simple2

Flickr

Flickr

Flickr::Simple2 is an XML::Simple based Perl API to communicate with Flickr.  It is in the early phases of development… comments are welcome :)

You will need to supply your own Flickr API key.

I released version 0.02 to Perl’s CPAN repository this morning after several delays related to the birth of my son a week ago.  As always, comments and constructive critism are welcome.

I love perl, I really do. The problem is that I need to also work with XML as well. CPAN has numerous modules that work with XML to one degree or another.

Producing XML is simple and easy. Reading or manipulating it involves loading the XML through a parser. The parsers will create a myriad of hashes, arrays and the like but navigating them even with tools like XPath make you want to perform oral surgery on yourself using rusty tiddly winks.

So my question is this: Are there any XML parsers for Perl that are easy to use without having to deal with arbitrary hashes of hashes of hashes and …. (don’t forget the arrays)?

brian d foy and crew release another amazing Perl Review magazine issue.  If you haven’t subscribed yet, please please do so, it is a treasure trove of information!  You can even claim the subscription on your 2009 taxes as a business expense.  How cool is that?!?

Issue 5.1, Winter 2008

Surviving Your First Week of Perl (sample)

Issue 5.1, Winter 2008

Issue 5.1, Winter 2008

Programming with CPAN.pm (sample)

CPAN Patching with Git (sample)

Refactoring Factorial (sample)

Downloading From TiVo (sample)

plus Commentary and Module Reviews by Nadim Khemir, Perl News, and more…