dvd::rip

->ABOUT / NEWS

->DOCUMENTATION
-TABLE OF CONTENTS
-INSTALLATION
-USING THE GUI
-CLUSTER MODE
-FAQ

->KEY FEATURES

->DOWNLOAD

->SUPPORT

->TRANSLATIONS

->MAILING LIST
-SEARCH ARCHIVE

->CHANGE LOG

->CREDITS

->TODO

->LINKS

http://www.exit1.org/


[dvd::rip] Preview hanging bug patch, version #2

Subject: [dvd::rip] Preview hanging bug patch, version #2
From: Jörn Reder <joern@xxxxxx>
Date: Mon, 12 Mar 2007 23:15:00 +0100
Hiho,

I improved my patch from today morning and tested it successfully with 
PAL and NTSC material, so I'm very optimistic that this annyoing bug 
could be finally fixed now (resp. workarounded, since it simply replaces
the hanging transcode part by ffmpeg ;).

For now the ffmpeg dependency is marked optional, and if ffmpeg is not 
found on the system dvd::rip falls back to the old transcode based 
preview grabbing. From my tests I think, that the hanging occurs in 
particular with NTSC movies. At least I can't reproduce it with PAL, and
only one NTSC movie I'm having here.

Anyone suffering from this (or not) should apply the patch (against 
vanilla 0.98.3), test it and drop a short note whether it works or not.
I like to make a new release as soon as possible, but would feel better
if the patch is a little bit more tested ;)

Just step into a freshly unpacked dvd::rip source directory, apply the 
patch as follows (assuming you copied the file into your home 
directory), build and execute dvd::rip from that direcory:

  % tar xfz dvdrip-0.98.3.tar.gz
  % cd dvdrip-0.98.3/
  % patch -p0 < ~/dvdrip-0.98.3-snapffmpeg.02.patch.txt 
  % perl Makefile.PL
  % make
  % export PATH=$PWD/bin:$PATH
  % dvdrip

Regards,

Jörn

-- 
 .''`.  Jörn Reder <joern@xxxxxx>
: :' :  http://www.exit1.org/ http://www.zyn.de/
`. `'
  `-    Debian GNU/Linux -- The power of freedom
Index: lib/Video/DVDRip/Depend.pm
===================================================================
RCS file: /home/cvsroot/dvdrip/lib/Video/DVDRip/Depend.pm,v
retrieving revision 1.22.2.2
diff -u -r1.22.2.2 Depend.pm
--- lib/Video/DVDRip/Depend.pm  10 Mar 2007 09:52:25 -0000      1.22.2.2
+++ lib/Video/DVDRip/Depend.pm  12 Mar 2007 22:06:27 -0000
@@ -94,6 +94,18 @@
         min       => "4.0.0",
         suggested => "6.2.3",
     },
+    ffmpeg => {
+        order       => ++$ORDER,
+        command     => "ffmpeg",
+        comment     => __ "FFmpeg video converter command line program",
+        optional    => 1,
+        get_version => sub {
+            qx[ffmpeg --version 2>&1] =~ /version ([^\s]+)/i;
+            return $1;
+        },
+        convert       => 'default',
+        min           => "0",
+    },
     xvid4conf => {
         order       => ++$ORDER,
         command     => "xvid4conf",
Index: lib/Video/DVDRip/JobPlanner.pm
===================================================================
RCS file: /home/cvsroot/dvdrip/lib/Video/DVDRip/JobPlanner.pm,v
retrieving revision 1.14
diff -u -r1.14 JobPlanner.pm
--- lib/Video/DVDRip/JobPlanner.pm      18 Aug 2006 21:43:09 -0000      1.14
+++ lib/Video/DVDRip/JobPlanner.pm      12 Mar 2007 22:06:27 -0000
@@ -453,14 +453,10 @@
     my $info = __ "Grab preview";
     $info .= $self->get_title_info($title);
 
-    my $progress_max;
-    my $progress_ips;
     my $slow_mode;
     if ( $title->project->rip_mode ne 'rip' ||
          !$title->has_vob_nav_file ||
           $title->tc_force_slow_grabbing ) {
-        $progress_ips = __"fps";
-        $progress_max = $title->preview_frame_nr;
         $slow_mode    = 1;
     }
 
@@ -470,9 +466,7 @@
         name            => $name,
         title           => $info,
         command         => undef,       # pre callback, rip in chapter mode, 
frames not known yet
-        no_progress     => (!$progress_max),
-        progress_max    => $progress_max,
-        progress_ips    => $progress_ips,
+        no_progress     => 1,
         progress_parser => sub {
             my ($job, $buffer) = @_;
             if ( $slow_mode ) {
Index: lib/Video/DVDRip/Title.pm
===================================================================
RCS file: /home/cvsroot/dvdrip/lib/Video/DVDRip/Title.pm,v
retrieving revision 1.180.2.1
diff -u -r1.180.2.1 Title.pm
--- lib/Video/DVDRip/Title.pm   10 Mar 2007 09:56:01 -0000      1.180.2.1
+++ lib/Video/DVDRip/Title.pm   12 Mar 2007 22:06:27 -0000
@@ -394,8 +394,6 @@
 sub audio_track {
     my $self = shift;
     if ( $self->audio_channel == -1 ) {
-        return;
-
         # no audio track selected. create a dummy object.
         # (probably this title has no audio at all)
         return Video::DVDRip::Audio->new( title => $self );
@@ -3049,6 +3047,56 @@
 sub get_take_snapshot_command {
     my $self = shift;
 
+    return $self->get_take_snapshot_command_transcode
+        if $self->version("ffmpeg") eq '';
+
+    my $nr           = $self->nr;
+    my $frame        = $self->preview_frame_nr;
+    my $tmp_dir      = "/tmp/dvdrip$$.snap";
+    my $filename     = $self->preview_filename( type => 'orig' );
+    my $raw_filename = $self->raw_snapshot_filename;
+    my $frame_rate   = $self->frame_rate;
+
+    my $source_options = $self->data_source_options;
+    my $grab_options   = $self->get_frame_grab_options( frame => $frame );
+
+    $grab_options->{S} ||= "0";
+    $grab_options->{L} ||= "0";
+
+    my ($start_frame) = $grab_options->{c} =~ /(\d+)/;
+    my $start = sprintf("%.3f", $start_frame / $frame_rate);
+
+    my $command = "mkdir -m 0775 $tmp_dir; "
+        . "cd $tmp_dir; "
+        . "execflow "
+        . "tccat -i $source_options->{i} "
+        . "-t $source_options->{x} "
+        . "-S $grab_options->{L} -d 0 | "
+        . "tcdemux -s 0x80 -x mpeg2 -S $grab_options->{S} "
+        . "-M 0 -d 0 -P /dev/null | "
+        . "tcextract -t vob -a 0 -x mpeg2 -d 0 | "
+        . "ffmpeg -r $frame_rate -i - -an -r 1 -ss '$start' -vframes 1 
snapshot%03d.png ";
+
+    $command .= " && "
+        . "execflow convert"
+        . " -size "
+        . $self->width . "x"
+        . $self->height
+        . " $tmp_dir/snapshot*.png $filename && "
+        . "execflow convert"
+        . " -size "
+        . $self->width . "x"
+        . $self->height
+        . " $tmp_dir/snapshot*.png gray:$raw_filename &&"
+        . " rm -r $tmp_dir && "
+        . "echo EXECFLOW_OK";
+
+    return $command;
+}
+
+sub get_take_snapshot_command_transcode {
+    my $self = shift;
+
     my $nr           = $self->nr;
     my $frame        = $self->preview_frame_nr;
     my $tmp_dir      = "/tmp/dvdrip$$.ppm";
@@ -3090,7 +3138,7 @@
         . " rm -r $tmp_dir && "
         . "echo EXECFLOW_OK";
 
-    $command =~ s/-x\s+([^,]+),null,null/-x mpeg2,null/;
+    $command =~ s/-x\s+([^,]+),null,null/-x $1,null/;
 
     return $command;
 }
<Prev in Thread] Current Thread [Next in Thread>
  • [dvd::rip] Preview hanging bug patch, version #2, Jörn Reder <=
 

Archive powered by MHonArc. Search powered by ht://dig.

[ top ]