diff -Nru mythexport-1.0.3/debian/changelog mythexport-1.0.6/debian/changelog --- mythexport-1.0.3/debian/changelog 2008-11-26 02:05:14.000000000 -0500 +++ mythexport-1.0.6/debian/changelog 2008-11-26 02:03:17.000000000 -0500 @@ -1,3 +1,19 @@ +mythexport (1.0.6-0ubuntu0.1) intrepid-proposed; urgency=low + + * Fixed ffmpeg codec naming issues. + + -- John Baab Wed, 26 November 2008 12:45:00 -0500 + +mythexport (1.0.5-0ubuntu1) jaunty; urgency=low + + * Fixed ffmpeg bug (LP: #297019). + * Fixed whitespace in file bug (LP: #288184). + * Fixed reverse proxy bug (thanks to smalcolm) (LP: #288186). + * Fixed install bug (LP: #282498). + * Fixed archos aspect bug (LP: #297016) + + -- John Baab Wed, 11 November 2008 07:30:00 -0500 + mythexport (1.0.3-0ubuntu1) intrepid; urgency=low * Fixed videoless recording bug (LP: #271409). diff -Nru mythexport-1.0.3/debian/control mythexport-1.0.6/debian/control --- mythexport-1.0.3/debian/control 2008-11-26 02:05:14.000000000 -0500 +++ mythexport-1.0.6/debian/control 2008-11-25 15:40:24.000000000 -0500 @@ -11,7 +11,8 @@ Package: mythexport Architecture: any -Depends: ${shlibs:Depends}, mythtv-backend, perl, atomicparsley, libmyth-perl, libdbi-perl, libdbd-mysql-perl, debconf, apache2, libconfig-simple-perl, libxml-rss-perl, mysql-client +Pre-Depends: mythtv-backend | mythtv-database +Depends: ${shlibs:Depends}, perl, atomicparsley, libmyth-perl, libdbi-perl, libdbd-mysql-perl, debconf, apache2, libconfig-simple-perl, libxml-rss-perl, mysql-client, libavcodec-unstripped-51, libavdevice-unstripped-52, libavformat-unstripped-52, libavutil-unstripped-49, libpostproc-unstripped-51, libswscale-unstripped-0 Description: Export MythTV recording to portable media players MythExport is a script that can be added to MythTV as a User Job and used to export recordings into a format playable on portable devices such as iPod diff -Nru mythexport-1.0.3/debian/rules mythexport-1.0.6/debian/rules --- mythexport-1.0.3/debian/rules 2008-11-26 02:05:14.000000000 -0500 +++ mythexport-1.0.6/debian/rules 2008-11-26 01:50:11.000000000 -0500 @@ -1,7 +1,7 @@ #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk -BZR_REVISION+=38 +BZR_REVISION+=51 BZR_BRANCH+=http://bazaar.launchpad.net/~mythbuntu/$(DEB_SOURCE_PACKAGE)/trunk TARFILE+=$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz diff -Nru mythexport-1.0.3/debian/templates mythexport-1.0.6/debian/templates --- mythexport-1.0.3/debian/templates 2008-11-26 02:05:14.000000000 -0500 +++ mythexport-1.0.6/debian/templates 2008-11-25 15:40:24.000000000 -0500 @@ -2,9 +2,7 @@ Type: note _Description: Additional install directions Although this script can be run on its own, it is best used when - configured as a user job withing MythTv. You may also need a - version of ffmpeg that is not included in the default Ubuntu - repositories. + configured as a user job withing MythTv. . For more information please visit: . diff -Nru mythexport-1.0.3/usr/bin/mythexport mythexport-1.0.6/usr/bin/mythexport --- mythexport-1.0.3/usr/bin/mythexport 2008-09-19 10:56:29.000000000 -0400 +++ mythexport-1.0.6/usr/bin/mythexport 2008-11-26 01:55:23.000000000 -0500 @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# mythexport v1.0.1 +# mythexport v1.0.6 # By: John Baab # Email: john.baab@gmail.com # Purpose: Script for exporting mythtv recordings into formats used by portable devices. @@ -30,11 +30,15 @@ use DBI; use DBD::mysql; +use Config::Simple; use MythTV; use strict; # Set default values -my $exportdir = '/home/mythtv/'; +my $cfg = new Config::Simple(); +$cfg->read('/etc/mythtv/mythexport.cfg'); +my $exportdir = $cfg->param("dir"); +$exportdir =~ s/\/$//; my $audio_bitrate = '96kb'; my $video_bitrate = '300kb'; my $aspect = '4:3'; @@ -115,6 +119,9 @@ } } +if ($exportcodec eq "xvid"){ + $exportcodec = "libxvid"; +} # # my $myth = new MythTV(); @@ -164,7 +171,7 @@ # FIND OUT THE CHANNEL NAME $query = "SELECT callsign FROM channel WHERE chanid=?"; $query_handle = $connect->prepare($query); -$query_handle->execute($chanid) || die "ERROR: Unable to query settings table"; +$query_handle->execute($chanid) || die "ERROR: Unable to query settings table"; my $channame = $query_handle->fetchrow_array; @@ -215,25 +222,25 @@ elsif ($exportcodec eq "mp3"){ $newfilename .= ".mp3"; $webfilename .= ".mp3"; - $command = "nice -n19 ffmpeg -i $filename -acodec mp3 -ac 2 -ab $audio_bitrate -vn '$newfilename' 2>&1"; + $command = "nice -n19 ffmpeg -i $filename -acodec libmp3lame -ac 2 -ab $audio_bitrate -vn '$newfilename' 2>&1"; } elsif ($exportdevice eq "ipod" || $exportdevice eq "zune"){ $newfilename .= ".mp4"; $webfilename .= ".mp4"; - if ($exportcodec eq "mpeg4" or $exportcodec eq "xvid"){ + if ($exportcodec eq "mpeg4" or $exportcodec eq "libxvid"){ # This VBR line works well, but only in xvid. Causes buffere underflows in Gutsy. - #$command = "nice -n19 ffmpeg -i $filename -acodec aac -ab $audio_bitrate -qmin 3 -qmax 5 -g 300 -bufsize 4096 -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size -aspect $aspect '$newfilename' 2>&1"; + #$command = "nice -n19 ffmpeg -i $filename -acodec libfaac -ab $audio_bitrate -qmin 3 -qmax 5 -g 300 -bufsize 4096 -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size -aspect $aspect '$newfilename' 2>&1"; # This VBR line works well, but only in xvid. Causes buffere underflows in Gutsy. - #$command = "nice -n19 ffmpeg -i $filename -f mp4 -vcodec $exportcodec -maxrate 1000 -b $video_bitrate -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab $audio_bitrate -s $size -aspect $aspect '$newfilename' 2>&1" + #$command = "nice -n19 ffmpeg -i $filename -f mp4 -vcodec $exportcodec -maxrate 1000 -b $video_bitrate -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec libfaac -ab $audio_bitrate -s $size -aspect $aspect '$newfilename' 2>&1" # Works cleanly with both vcodecs, but produces larger files. - $command = "nice -n19 ffmpeg -i $filename -acodec aac -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size '$newfilename' 2>&1"; + $command = "nice -n19 ffmpeg -i \"$filename\" -acodec libfaac -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size '$newfilename' 2>&1"; } elsif ($exportcodec eq "h264"){ # First pass - $command = "nice -n19 ffmpeg -y -i $filename -an -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 1 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -f mp4 -pass 1 /dev/null"; + $command = "nice -n19 ffmpeg -y -i \"$filename\" -an -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 1 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -f mp4 -pass 1 /dev/null"; # Second pass - $command2 = "nice -n19 ffmpeg -y -i $filename -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 6 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -acodec aac -ab $audio_bitrate -ar 48000 -ac 2 -f mp4 -pass 2 '$newfilename' 2>&1"; + $command2 = "nice -n19 ffmpeg -y -i \"$filename\" -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 6 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -acodec libfaac -ab $audio_bitrate -ar 48000 -ac 2 -f mp4 -pass 2 '$newfilename' 2>&1"; } else{ print "\n\nERROR: Unexpected Export Codec."; @@ -243,15 +250,15 @@ elsif ($exportdevice eq "psp"){ $newfilename .= ".mp4"; $webfilename .= ".mp4"; - if ($exportcodec eq "mpeg4" or $exportcodec eq "xvid"){ - $command = "nice -n19 ffmpeg -i $filename -acodec aac -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -ar 24000 -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size -aspect $aspect -r 30000/1001 -f psp '$newfilename' 2>&1"; + if ($exportcodec eq "mpeg4" or $exportcodec eq "libxvid"){ + $command = "nice -n19 ffmpeg -i \"$filename\" -acodec libfaac -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -ar 24000 -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size -aspect $aspect -r 30000/1001 -f psp '$newfilename' 2>&1"; } elsif ($exportcodec eq "h264"){ # PSP h.254 encoding doesn't seem to be working. print "\n\nError: PSP h.264 encoding is not currently supported. Use xvid or mpeg4 instead."; exit; # According to the ffmpeg website, this should have worked. - #$command = "nice -n19 ffmpeg -i $filename -acodec aac -ab $audio_bitrate -vcodec h264 -b $video_bitrate -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s $size -aspect $aspect -r 30000/1001 -title X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 '$newfilename' 2>&1"; + #$command = "nice -n19 ffmpeg -i $filename -acodec libfaac -ab $audio_bitrate -vcodec h264 -b $video_bitrate -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s $size -aspect $aspect -r 30000/1001 -title X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 '$newfilename' 2>&1"; } else{ print "\n\nERROR: Unexpected Export Codec."; @@ -261,11 +268,11 @@ elsif ($exportdevice eq "archos"){ $newfilename .= ".avi"; $webfilename .= ".avi"; - if ($exportcodec eq "mpeg4" or $exportcodec eq "xvid"){ + if ($exportcodec eq "mpeg4" or $exportcodec eq "libxvid"){ # ffmpeg line from courtesy of freymann - # ffmpeg -i infile.mpg -vcodec mpeg4 -s 320x240 -b 906k -acodec mp3 -ab 192kb outfile.avi + # ffmpeg -i infile.mpg -vcodec mpeg4 -s 320x240 -b 906k -acodec libmp3lame -ab 192kb outfile.avi # modified to use all the flags used in other ffmpeg lines. - $command = "nice -n19 ffmpeg -i $filename -acodec mp3 -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size '$newfilename' 2>&1"; + $command = "nice -n19 ffmpeg -i \"$filename\" -acodec libmp3lame -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -aspect $aspect -s $size '$newfilename' 2>&1"; } elsif ($exportcodec eq "h264"){ print "\n\nError: Archos h.264 encoding is not currently supported. Use xvid or mpeg4 instead."; @@ -279,20 +286,20 @@ elsif ($exportdevice eq "xbox360"){ $newfilename .= ".mp4"; $webfilename .= ".mp4"; - if ($exportcodec eq "mpeg4" or $exportcodec eq "xvid"){ + if ($exportcodec eq "mpeg4" or $exportcodec eq "libxvid"){ # This VBR line works well, but only in xvid. Causes buffere underflows in Gutsy. - #$command = "nice -n19 ffmpeg -i $filename -acodec aac -ab $audio_bitrate -qmin 3 -qmax 5 -g 300 -bufsize 4096 -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size -aspect $aspect '$newfilename' 2>&1"; + #$command = "nice -n19 ffmpeg -i $filename -acodec libfaac -ab $audio_bitrate -qmin 3 -qmax 5 -g 300 -bufsize 4096 -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size -aspect $aspect '$newfilename' 2>&1"; # This VBR line works well, but only in xvid. Causes buffere underflows in Gutsy. - #$command = "nice -n19 ffmpeg -i $filename -f mp4 -vcodec $exportcodec -maxrate 1000 -b $video_bitrate -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab $audio_bitrate -s $size -aspect $aspect '$newfilename' 2>&1" + #$command = "nice -n19 ffmpeg -i $filename -f mp4 -vcodec $exportcodec -maxrate 1000 -b $video_bitrate -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec libfaac -ab $audio_bitrate -s $size -aspect $aspect '$newfilename' 2>&1" # Works cleanly with both vcodecs, but produces larger files. - $command = "nice -n19 ffmpeg -i $filename -acodec aac -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size '$newfilename' 2>&1"; + $command = "nice -n19 ffmpeg -i \"$filename\" -acodec libfaac -ab $audio_bitrate -vcodec $exportcodec -b $video_bitrate -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s $size '$newfilename' 2>&1"; } elsif ($exportcodec eq "h264"){ # First pass - $command = "nice -n19 ffmpeg -y -i $filename -an -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 1 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -f mp4 -pass 1 /dev/null"; + $command = "nice -n19 ffmpeg -y -i \"$filename\" -an -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 1 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -f mp4 -pass 1 /dev/null"; # Second pass - $command2 = "nice -n19 ffmpeg -y -i $filename -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 6 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -acodec aac -ab $audio_bitrate -ar 48000 -ac 2 -f mp4 -pass 2 '$newfilename' 2>&1"; + $command2 = "nice -n19 ffmpeg -y -i \"$filename\" -v 1 -threads auto -vcodec h264 -b $video_bitrate -bt 175k -refs 1 -loop 1 -deblockalpha 0 -deblockbeta 0 -parti4x4 1 -partp8x8 1 -me full -subq 6 -me_range 21 -chroma 1 -slice 2 -bf 0 -level 30 -g 300 -keyint_min 30 -sc_threshold 40 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.7 -qmax 51 -qdiff 4 -i_qfactor 0.71428572 -maxrate 768k -bufsize 2M -cmp 1 -s $size -acodec libfaac -ab $audio_bitrate -ar 48000 -ac 2 -f mp4 -pass 2 '$newfilename' 2>&1"; } else{ print "\n\nERROR: Unexpected Export Codec."; @@ -332,9 +339,9 @@ system "rm $newfilename"; system "mv $exportdir/*temp* $newfilename"; } - + (-e $newfilename) || die "ERROR: File is not available, please check your backend logs."; # Save Data $query = "INSERT into mythexport VALUES(NULL,?,?,?,?,NOW(),DATE_ADD(NOW(),INTERVAL ? DAY),?,?)"; $query_handle = $connect->prepare($query); - $query_handle->execute($webfilename,$title_old,$subtitle,$description,$delete_period,$airdate,$podcast_name) || die "ERROR: Unable to update table."; + $query_handle->execute($webfilename,$title_old,$subtitle,$description,$delete_period,$airdate,$podcast_name) || die "ERROR: Unable to update table."; } diff -Nru mythexport-1.0.3/usr/share/mythtv/mythexport/mythexportRSS.cgi mythexport-1.0.6/usr/share/mythtv/mythexport/mythexportRSS.cgi --- mythexport-1.0.3/usr/share/mythtv/mythexport/mythexportRSS.cgi 2008-09-19 10:56:29.000000000 -0400 +++ mythexport-1.0.6/usr/share/mythtv/mythexport/mythexportRSS.cgi 2008-11-25 15:40:24.000000000 -0500 @@ -9,17 +9,16 @@ # create an RSS 2.0 file my $rss = new XML::RSS (version => '2.0'); - -# Set default values -my $exportdir = '/home/mythtv/'; - my $connect = undef; -my $debug = 0; my $myth = new MythTV(); # connect to database $connect = $myth->{'dbh'}; my $ip = $ENV{'HTTP_HOST'}; +# Fixes bug LP:288186 +if ($ENV{'HTTP_X_FORWARDED_HOST'} ne "") { + $ip = $ENV{'HTTP_X_FORWARDED_HOST'}; +} my $podcast_name = param("podcastName"); my $title = "MythCast"; @@ -49,9 +48,6 @@ #webMaster => 'scoop@freshmeat.net' ); -# Get all exports -#$query_handle->execute($podcast_name) || die "Unable to get exported recordings from database."; - while (my @data = $query_handle->fetchrow_array()) { #print "LOOP!"; my $rss_file=$data[0];