DVD::Read - libdvdread perl binding
use DVD::Read; my $dvd = DVD::Read->new('/dev/cdrom'); print $dvd->volid; print "\n"; foreach (1 .. $dvd->titles_count) { print "$_ : "; print $dvd->title_chapters_count($_); print " chapters\n"; my $title = $dvd->get_title($_); # ... }
This module provide way to query video DVD using libdvdread.
Dvd (device, directory, iso file...) | \_ VMG (VIDEO_VTS.IFO) ` title_one => title1 (chapters map) ` title_two => title2 (chapters map) ` ... | \_ VTS title1 (VIDEO_1_VTS.IFO) ` audio track 1 ` audio track 2 ` audio track ... ` subtitle track 1 ` subtitle track 2 ` subtitle track ... ` chapters location in VOB | \_ VTS title2 (VIDEO_2_VTS.IFO) \_ VTS title...
The 'first_sector' and 'last_sector' from module can disagree with 'tcprobe' (from transcode) results.
After wasting some times to look the code, it seems 'tcprobe' code wrong.
In a nutshell, Title is made of chapter, chapter point to first cells, each cells have a first and last sector. But a chapter can have severals cells. This is what is used by lsdvd to count cells.
'tcprobe' assume each chapter have only one cells, then fetch cells[chapter] to get sectors number. Which is wrong, according 'lsdvd' code.
Notice both VGM and VTS are often need to get title information. This module will transparently fetch information need to retrieve information you want.
You have two way to fetch title object:
my $dvd = DVD::Read->new('/dev/crom'); my $title = $dvd->get_title(1); # or in another way my $title = DVD::Read::Title->new($dvd, 1);
or by calling directly the DVD::Read::Title module with a location:
my $title = DVD::Read::Title->new('/dev/cdrom', 1);
Notice in the second case, calling another title will force to read again the main information table (if need) because the DVD::Read object will not be transmitted, so another will be created.
This can be important when using real DVD reader device since waking up it can take time.
Return a new DVD::Read object for $device. $device can either a real device, an iso image file, a directory, or anything supported by libdvdread:
* If the path given is a directory, then the files in that directory may be * in any one of these formats: * * path/VIDEO_TS/VTS_01_1.VOB * path/video_ts/vts_01_1.vob * path/VTS_01_1.VOB * path/vts_01_1.vob
Return the volume identifier from ISO9660 format. Works only from a device or iso image.
Return the count of title on the DVD
Return the chapters count for title number $title.
Return the number of angle for title number $title
Return a DVD::Read::Title object for title number $title
Most of C code come from mplayer and transcode (tcprobe).
Thanks authors of these modules to provide it as free software.
As this software are under another license, and this module reuse code from it, the Perl license is maybe not appropriate.
Just mail me if this is a problem.
Theses modules are provided but are low level access:
Olivier Thauvin <nanardon@nanardon.zarb.org>
Copyright (C) 2008 by Olivier Thauvin
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
The libdvdread is under the GPL Licence.
To install DVD::Read, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DVD::Read
CPAN shell
perl -MCPAN -e shell install DVD::Read
For more information on module installation, please visit the detailed CPAN module installation guide.