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/


Re: [dvd::rip] Grab preview process hangs

Subject: Re: [dvd::rip] Grab preview process hangs
From: Jörn Reder <joern@xxxxxx>
Date: Mon, 12 Mar 2007 09:22:42 +0100
Josh wrote:

> That worked wonderfully and generated the snapshot001.png file in the
> directory where I executed the command.  If I can provide any more
> information just let me know.

This are good news! Yesterday I worked out the attached patch based on 
this idea. Please apply and test it, ideally with different 
DVD's/title's.

The patch currently misses a dependency check on the ffmpeg command line
program. If the test results are Ok I'll add this and will release 
0.98.4 soon.

Please test the transcoding itself as well. Probably the preview 
grabbing works with this patch, but later transcoding still hangs or 
something like that.

Regards,

Jörn

-- 
Joern Reder
supporting:   http://www.zyn.de/
unbelievable: http://www.exit1.org/
CPAN:         http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED
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 08:20:44 -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,12 @@
 sub get_take_snapshot_command {
     my $self = shift;
 
+    if (     $self->project->rip_mode eq 'rip'
+         and $self->has_vob_nav_file
+         and not $self->tc_force_slow_grabbing ) {
+        return $self->get_take_snapshot_command_ffmpeg;
+    }
+
     my $nr           = $self->nr;
     my $frame        = $self->preview_frame_nr;
     my $tmp_dir      = "/tmp/dvdrip$$.ppm";
@@ -3090,7 +3094,53 @@
         . " 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;
+}
+
+sub get_take_snapshot_command_ffmpeg {
+    my $self = shift;
+
+    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 $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 * 1 / $self->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 -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;
 }
 

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

[ top ]