On Sun, 2005-01-30 at 14:08 -0500, Gabe Rubin wrote:
> Speaking of this, maybe we need a setting for "Super Bowl commercial
> detection" that keeps the commercials and throws away the program, for
> those of us who aren't big football fans, but like the nifty Super
> Bowl commercials... ;)

Find attached a diff to the old stand-alone Xvid module of nuvexport[*]
that adds widescreen, and invert-cutlist options.

Also swaps to hqdn3d from yuvdenoise for speed.

Mark

[*] I think it is the 2004-08-22 tarball I am using.

-- 
Mark Cooke <[EMAIL PROTECTED]>
--- export_Trans_XviD.pm.orig   2004-12-10 18:55:28.000000000 +0000
+++ export_Trans_XviD.pm        2005-01-13 17:18:52.000000000 +0000
@@ -17,6 +17,7 @@
                                         'savepath'    => '.',
                                         'outfile'     => 'out.avi',
                                         'use_cutlist' => 1,
+                                        'invert_cutlist' => 0,
                                         'a_bitrate'   => 64,
                                         'v_bitrate'   => 1200,
                                         'h_res'       => 360,
@@ -24,6 +25,7 @@
                                         'sql_file' => undef,
                                         'deinterlace' => 0,
                                         'noise_reduction'     => 1,
+                                        'widescreen'     => 1,
                                         @_             #allows user-specified 
attributes to override the defaults
                                        };
                bless($self, $class);
@@ -59,6 +61,16 @@
                        $self->{use_cutlist} = $gui->query_text('Enable Myth 
cutlist?',
                                                                                
                        'yesno',
                                                                                
                        $self->{use_cutlist} ? 'Yes' : 'No');
+                       $self->{invert_cutlist} = $gui->query_text('Invert 
cutlist (extract ads)?',
+                                                                               
                        'yesno',
+                                                                               
                        $self->{invert_cutlist} ? 'Yes' : 'No');
+                       if ($self->{invert_cutlist}) {
+                           $self->{a_bitrate} = 64;
+                           $self->{v_bitrate} = 250;
+                           $self->{h_res} = 180;
+                           $self->{v_res} = 144;
+                           $self->{noise_reduction} = 0;
+                       }
                }
                else {
                        $gui->notify('No cutlist found.  Hopefully this means 
that you already removed the commercials.');
@@ -86,6 +98,9 @@
                $self->{deinterlace} = $gui->query_text('Enable deinterlacing?',
                                                                                
                                'yesno',
                                                                                
                                $self->{deinterlace} ? 'Yes' : 'No');
+               $self->{widescreen} = $gui->query_text('Enable widescreen 
encoding?',
+                                                                               
                                'yesno',
+                                                                               
                                $self->{widescreen} ? 'Yes' : 'No');
 
        }
 
@@ -101,22 +116,46 @@
                $self->{started} = 1;
 
                $safe_outfile = shell_escape($self->{outfile});
-               my $command = "nice -n 19 transcode --export_par 4 -x mpeg2 -i 
$main::video_dir/$self->{episode}->{filename} -y xvid -Z 
$self->{h_res}x$self->{v_res} -o $safe_outfile -w $self->{v_bitrate} -b 
$self->{a_bitrate}";
+               my $command = "nice -n 19 transcode -x mpeg2 -i 
$main::video_dir/$self->{episode}->{filename} -y xvid -Z 
$self->{h_res}x$self->{v_res} -o $safe_outfile -w $self->{v_bitrate} -b 
$self->{a_bitrate}";
 
                if ($self->{use_cutlist}) {
-                 @cuts = split("\n",$self->{episode}->{cutlist});
+                 # Filter for Nicola to take just the adverts !
+                 if ($self->{invert_cutlist}) {
+                    my @cp = split(/\n| - /,$self->{episode}->{cutlist});
+                    my $first = shift(@cp);
+                    if ( $first ne "0" ) {
+                       unshift(@cp, $first);
+                       unshift(@cp, "0");
+                     }
+                     # Delete the last element
+                    pop(@cp);
+
+                    # Build the span list
+                       while (@cp) {
+                       my $a = shift(@cp);
+                       my $b = shift(@cp);
+                       push @cuts, "$a - $b";
+                       }       
+                  } else {
+                     @cuts = split("\n",$self->{episode}->{cutlist});
+                  }
+
                  my @skiplist;
                  foreach $cut (@cuts) {
                     push @skiplist, (split(" - ", $cut))[0]."-".(split(" - ", 
$cut))[1];
                  }
+
                  $command .= " -J skip=\"".join(" ", @skiplist)."\"";
                }
 
                if ($self->{deinterlace}) {
-                  $command .= " -V -J smartdeinter";
+                  $command .= " -J smartdeinter";
+               }
+               if ($self->{widescreen}) {
+                  $command .= " --export_par 4";
                }
                if ($self->{noise_reduction}) {
-                  $command .= " -V -J yuvdenoise";
+                  $command .= " -J hqdn3d";
                }
 
                push @{$self->{children}}, fork_command($command);
_______________________________________________
mythtv-users mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Reply via email to