View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 184 posts ] 
Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 13  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Mon Jan 09, 2006 4:58 pm 
Offline
Joined: Mon Dec 26, 2005 4:54 pm
Posts: 7
Okay,
Can someone please tell me what the difference is between DoPassOne and DoPassTwo is?
It looks like they both take the same input file. What gets saved from DoPassOne. It would make sense to me if DoPassTwo took the output from DoPassOne, but it doesn't appear to do so unless it is done implicitly by the -pass switch.

Could someone please explain.

Thanks,
~Eric


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 3:46 pm 
Offline
Joined: Sat Oct 29, 2005 1:22 pm
Posts: 11
Is there any way I can get MythTV to automatically run Myth2iPod when using MythWeb to set recordings?

If I use MythFrontend then 'user job #1' runs perfectly, it's only when I use MythWeb that it doesn't. Incidentally I only use MythWeb to schedule recordings.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 4:31 pm 
Offline
Joined: Wed Feb 02, 2005 4:07 pm
Posts: 141
I don't have it handy, but there are instructions to modify the PHP pages on MythWeb to add checkboxes for running userjobs. I would do a search for MythWeb "user jobs" and you should find the link to the instructions/files

SteveGodfrey wrote:
Is there any way I can get MythTV to automatically run Myth2iPod when using MythWeb to set recordings?

If I use MythFrontend then 'user job #1' runs perfectly, it's only when I use MythWeb that it doesn't. Incidentally I only use MythWeb to schedule recordings.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 10:13 am 
Offline
Joined: Sun Dec 04, 2005 1:44 pm
Posts: 403
Location: Central NJ
I can manually run:
/usr/local/bin/myth2ipod /myth/tv/ XXXXX.nuv
sucessfully as root, but I can't run it as user mythtv, causing my job to fail.

I performed:
chmod +x myth2ipod
as root, so I don't understand where I screwed up the permissions

I either need to figure out which permission are stopping user mythtv from executing this command or figure out how to run a user job as root. Do anyone know how to do that?

_________________
Currently running: R5.5, HD5000 x 2, PVR150, Athlon 64 3000+, Chaintech VNF4, 1GB RAM, 2 x 250GB in LVM, MSI NX6200TC -> AA 9A60 -> HDTV


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 11:18 am 
Offline
Joined: Mon Jun 21, 2004 11:25 am
Posts: 291
Location: Ontario, CA
you need to post the console output. We can't tell you where it is going wrong with out you showing us. If the mythtv user can access the script than that would be a start, but it looks like you took care of that. So my next guess is that one of the locations the script uses, mythtv does not have access to. Post the exact out put and we can see.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 12:12 pm 
Offline
Joined: Sun Dec 04, 2005 1:44 pm
Posts: 403
Location: Central NJ
wififun wrote:
you need to post the console output. We can't tell you where it is going wrong with out you showing us. If the mythtv user can access the script than that would be a start, but it looks like you took care of that. So my next guess is that one of the locations the script uses, mythtv does not have access to. Post the exact out put and we can see.


I've modified the script for PocketPC as noted by the changes listed by bbutler in:
http://mysettopbox.tv/phpBB2/viewtopic.php?t=7816

This shouldn't change anything, as the script runs perfectly as root. (just the encoding parameters, changing myth2ipod to myth2ppc in some spots, and changing the output directory from /myth/ipod to /myth/PocketPC) It is only running it as user mythtv that messes things up.

It looks like:
"Unable for find a suitable output format for 'Show -author MythTV'"
is where it starts to fail, but I don't understand why because /myth/PocketPC is accessible by user mythtv



Here it is:

sh-3.00$ /usr/local/bin/myth2ppc /myth/tv/ 1005_20060113233000_20060114000000.nuv
Starting pass 1 of 2...
/usr/local/bin/ffmpeg -i /myth/tv//1005_20060113233000_20060114000000.nuv -comment '1005_20060113233000_20060114000000.nuv' -title 'That '70s Show' -author 'MythTV - myth2ppc' -timestamp 'Sat Jan 14 13:11:50 EST 2006
' -y -cropleft 10 -cropright 10 -croptop 8 -cropbottom 8 -deinterlace -vcodec xvid -s 320x240 -r 29.97 -b 384 -qmin 2 -qmax 5 -bufsize 4096 -acodec mp3 -ab 96 -g 300 -pass 1 -passlogfile /tmp/myth2ppc_log -f mov /myth/PocketPC/'That_'70s_Show-On_With_the_Show-20060113'.pass1
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-xvid --enable-gpl --enable-faac --enable-mp3lame
libavcodec version: 51.0.0
libavformat version: 50.0.0
built on Jan 13 2006 17:26:52, gcc: 3.3.5 (Debian 1:3.3.5-12)
Input #0, mpeg, from '/myth/tv//1005_20060113233000_20060114000000.nuv':
Duration: 00:29:55.9, start: 0.333822, bitrate: 3671 kb/s
Stream #0.0[0x1e0], 29.97 fps(r): Video: mpeg2video, yuv420p, 640x480, 4000 kb/s
Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, 384 kb/s
Unable for find a suitable output format for 'Show -author MythTV'
sh: line 1: -y -cropleft 10 -cropright 10 -croptop 8 -cropbottom 8 -deinterlace -vcodec xvid -s 320x240 -r 29.97 -b 384 -qmin 2 -qmax 5 -bufsize 4096 -acodec mp3 -ab 96 -g 300 -pass 1 -passlogfile /tmp/myth2ppc_log -f mov /myth/PocketPC/That_70s_Show-On_With_the_Show-20060113.pass1: No such file or directory
Pass one failed
Pass 1 competed, starting pass 2 of 2...
/usr/local/bin/ffmpeg -i /myth/tv//1005_20060113233000_20060114000000.nuv -comment '1005_20060113233000_20060114000000.nuv' -title 'That '70s Show' -author 'MythTV - myth2ppc' -timestamp 'Sat Jan 14 13:11:50 EST 2006
' -y -cropleft 10 -cropright 10 -croptop 8 -cropbottom 8 -deinterlace -vcodec xvid -s 320x240 -r 29.97 -b 384 -qmin 2 -qmax 5 -bufsize 4096 -acodec mp3 -ab 96 -g 300 -pass 2 -passlogfile /tmp/myth2ppc_log -f mov /myth/PocketPC/'That_'70s_Show-On_With_the_Show-20060113'.pass2
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-xvid --enable-gpl --enable-faac --enable-mp3lame
libavcodec version: 51.0.0
libavformat version: 50.0.0
built on Jan 13 2006 17:26:52, gcc: 3.3.5 (Debian 1:3.3.5-12)
Input #0, mpeg, from '/myth/tv//1005_20060113233000_20060114000000.nuv':
Duration: 00:29:55.9, start: 0.333822, bitrate: 3671 kb/s
Stream #0.0[0x1e0], 29.97 fps(r): Video: mpeg2video, yuv420p, 640x480, 4000 kb/s
Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, 384 kb/s
Unable for find a suitable output format for 'Show -author MythTV'
sh: line 1: -y -cropleft 10 -cropright 10 -croptop 8 -cropbottom 8 -deinterlace -vcodec xvid -s 320x240 -r 29.97 -b 384 -qmin 2 -qmax 5 -bufsize 4096 -acodec mp3 -ab 96 -g 300 -pass 2 -passlogfile /tmp/myth2ppc_log -f mov /myth/PocketPC/That_70s_Show-On_With_the_Show-20060113.pass2: No such file or directory
Pass two failed
Pass 2 competed, building video XML file
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 166.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 167.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 168.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 169.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 170.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 171.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 172.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 173.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 174.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 175.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 176.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 177.
print() on closed filehandle ITEM at /usr/local/bin/myth2ppc line 178.
"That_'70s_Show-On_With_the_Show-20060113" has been added to the feed.
XML file created for "That_'70s_Show-On_With_the_Show-20060113" : Cleaning up temporary files
mv -f /myth/PocketPC/'That_'70s_Show-On_With_the_Show-20060113'.pass2 /myth/PocketPC/'That_'70s_Show-On_With_the_Show-20060113'.ppc.mov
mv: missing file argument
Try `mv --help' for more information.
Moving pass2 to final .mov failed
rm -f /tmp/myth2ppc_log*
rm -f /myth/PocketPC/'That_'70s_Show-On_With_the_Show-20060113'.pass1
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
Removing pass 1 file failed
That '70s Show is ready for your ppc
sh-3.00$

_________________
Currently running: R5.5, HD5000 x 2, PVR150, Athlon 64 3000+, Chaintech VNF4, 1GB RAM, 2 x 250GB in LVM, MSI NX6200TC -> AA 9A60 -> HDTV


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 3:09 pm 
Offline
Joined: Mon Jun 21, 2004 11:25 am
Posts: 291
Location: Ontario, CA
you have an apostrophe problem. This is the first thing that I see.
try adding:
Code:
   $filename =~ s/'//g;

around line 109, right under the similar line that gets rid of spaces. then let's see what your output is.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 3:16 pm 
Offline
Joined: Mon Jun 21, 2004 11:25 am
Posts: 291
Location: Ontario, CA
I have spent some time with the script this weekend, mainly trying the nuvexport patch that steff posted. My problem right now is that although I have the latest nuvexport, my R5A22 install does not seem to like nuvexport at all. I don't have time to muddle through the upgrade process of fixing the DB, so I will continue to wait before getting this working. I would recommend that anyone who can use the nuvexport method do so, as any further updates to the original script will likely go this route. Though I do have a somewhat working hack of the current that uses the cutlist to hack out commercials.

UPDATE!!! Anyone with a 5G iPOD. BEWARE. The latest iPod Updater from Apple, is not playing these myth2ipod files correctly. I get stuttering, and stopping, then loss of sound unless I stop and restart the show. Though the update did add MUCH MUCH better fast forward and rewind, this playback issue is a big problem. I am working on a new ffmpeg line that solves this. If anyone finds one first, please post it.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 1:28 am 
Offline
Joined: Sun Nov 09, 2003 8:02 pm
Posts: 47
Location: Escondido CA
The apostophe problem is one of the issue, I agree. But check permissions on the directory. My permissions for this directory is:

drwxr-xr-x 2 mythtv mythtv 4096 Jan 14 22:44 PocketPC

Be sure to:

chgrp mythtv /myth/PocketPC
and
chown mythtv /myth/PocketPC

Here is my script Modified from Wififun's script for Myth2ipod:

---Begn Script

#!/usr/bin/perl -w
# VERSION: Beta .8b - myth2ppc
# Get the latest version, and change log at myth2ipod.com
# Author: Chris aka Wififun - email: wififun@myth2ipod.com
# Contributions and testing by Paul Egli

# Includes
use DBI;
use Getopt::Long;
use File::Path;

# User variables
my $portable = "ppc";
my $feedfile = "/myth/PocketPC/feed.php";
# my $feedfile = "http://192.168.0.151/PocketPC/feed.php";
my $feedpath = "/myth/PocketPC/";
my $wwwloc = "/var/www/";
my $feedurl = "http://192.168.0.151/ppcfeed/";

# Ecoder settings, may be modified to support other devices
# PocketPC with Video compatable settings. MPEG4/XVID MP3 audio

my $encodeopt = "-y -cropleft 10 -cropright 10 -croptop 8 -cropbottom 8 -deinterlace -vcodec xvid -s 320x240 -r 29.97 -b 384 -qmin 2 -qmax 5 -buf
size 4096 -acodec mp3 -ab 96 -g 300";

# Some variables
our ($dest, $format, $usage);
our ($db_host, $db_user, $db_name, $db_pass, $video_dir);
our ($hostname, $db_handle, $sql, $statement, $row_ref);
# our ($chanid, $start, $nuvfile, @nuvarray);
my $rebuild = '0';
my $encode = '0';
my $debug = '0';
my $setup = '0';
my( $rightnow ) = `date`;

GetOptions ("rebuild" => \$rebuild,
"encode" => \$encode,
"debug" => \$debug,
"setup" => \$setup);

if ($setup == 1){
system("clear");
print "Setup will do everything needed to run this script.\n";
print "This has only been tested on KnoppMyth R5A22.\n";
print "make sure you have edited the variables for your conguration.\n";
my $cksetup = &promptUser("\nAre you sure you want to procceed?","n");
if ($cksetup =~ "y") {
DoSetup();
exit;
}
print "Setup exited. Nothing done.\n";
exit;
}
elsif ($rebuild == 1){
GenerateRSSFeed();
print "Rebuilding of RSS feed is complete.\n";
exit;
}
else {
Encode4Portable();
print "$title is ready for your $portable\n";

# Check to see if the feed file exists; if not, create it.
if (! -e $feedfile) {
print "No feed file found. I will make one for you.\n";
GenerateRSSFeed();
print "All done.\n";
}
}

sub Encode4Portable{
if ($#ARGV != 1) {
print "Encoding requires options.\nusage: myth2ipod <options> DIRECTORY FILE\n";
exit;
}

# Get the show information
$directory = $ARGV[0];
$file = $ARGV[1];
@file = split(/_/, $file);
$chanid = $file[0];
$start = substr $file[1],0,14;
if($debug == 1){ print "$chanid\n$start\n"};
if (! -e $directory."/".$file){
print "Opps, the file ".$directory.$file." does not exist.\n";
exit;
}

# Connect to the database
PrepSQLRead();
$db_handle = DBI->connect("dbi:mysql:database=$db_name:host=$db_host", $db_user, $db_pass)
or die "Cannot connect to database: $!\n\n";
$sql = "SELECT title, subtitle, description, category, starttime FROM recorded WHERE chanid = $chanid AND DATE_FORMAT(starttime,'%Y%m%d%H
%i%s') = $start";

$statement = $db_handle->prepare($sql)
or die "Couldn't prepare query '$sql': $DBI::errstr\n";

$statement->execute()
or die "Couldn't execute query '$sql': $DBI::errstr\n";
$row_ref = $statement->fetchrow_hashref();
if($debug == 1){ print "$row_ref->{starttime}\n"};
$title = $row_ref->{title};
$ttitle = $title;
$ttitle =~ s/ /_/g;
$subtitle = $row_ref->{subtitle};
$recorddate = $row_ref->{starttime};
$description = $row_ref->{description};
$category = $row_ref->{category};
$filename = $title."-".$subtitle."-".substr $start, 0, 8;
#$filename =~ s/ /_/g;
$filename =~ s/'//g;
printf("Starting pass 1 of 2...\n");
DoPassOne();
printf("Pass 1 competed, starting pass 2 of 2...\n");
DoPassTwo();
printf("Pass 2 competed, building video XML file\n");
CreateItemXML();
printf("XML file created for \"$filename\" : Cleaning up temporary files\n");
$cmd = "mv -f $feedpath'$filename'.pass2 $feedpath'$filename'.$portable.mov";
print $cmd."\n";
if(system($cmd)) { print "Moving pass2 to final .mov failed\n"; }

$cmd = "rm -f /tmp/myth2ppc_log*";
print $cmd."\n";
if(system($cmd)) { print "Removing pass 1 file failed\n"; }

$cmd = "rm -f $feedpath'$filename'.pass1";
print $cmd."\n";
if(system($cmd)) { print "Removing pass 1 file failed\n"; }

return 0;
}

#
# Encode for Portable Pass 1
#
sub DoPassOne {
$cmd = "/usr/local/bin/ffmpeg -i $directory/$file -comment '$file' -title '$title' -author 'MythTV - myth2ppc' -timestamp '$rightnow' $encodeopt
-pass 1 -passlogfile /tmp/myth2ppc_log -f mov $feedpath'$filename'.pass1";
print $cmd."\n";
if(system($cmd)) { print "Pass one failed\n"; }
return 0;
}

#
# Encode for Portable Pass 2
#
sub DoPassTwo {
$cmd = "/usr/local/bin/ffmpeg -i $directory/$file -comment '$file' -title '$title' -author 'MythTV - myth2ppc' -timestamp '$rightnow' $encodeopt
-pass 2 -passlogfile /tmp/myth2ppc_log -f mov $feedpath'$filename'.pass2";
print $cmd."\n";
if(system($cmd)) { print "Pass two failed\n"; }
return 0;
}

#
# Create XML with <ITEM> tag for this video file
#
sub CreateItemXML {
open(ITEM, ">$feedpath$filename.$portable.xml");
print ITEM "<item>\n";
print ITEM "<title>".&encodeForXML($title." - ".$subtitle)."</title>\n";
print ITEM "<itunes:author>MythTV</itunes:author>\n";
print ITEM "<author>MythTV</author>\n";
print ITEM "<itunes:category text=\"TV Shows\"></itunes:category>\n";
print ITEM "<comments>".&encodeForXML($file)."</comments>\n";
print ITEM "<description>".&encodeForXML($description)."</description>\n";
print ITEM "<pubDate>".$recorddate."</pubDate>\n";
print ITEM "<enclosure url=\"".&encodeForXML("$feedurl$filename.$portable.mov")."\" type=\"video/quicktime\" />\n";
print ITEM "<itunes:duration></itunes:duration>\n";
print ITEM "<itunes:keywords>".&encodeForXML($title." - ".$subtitle." - ".$category)."</itunes:keywords>\n";
print ITEM "<category>".&encodeForXML($category)."</category>\n";
print ITEM "</item>\n";
print "\"$filename\" has been added to the feed.\n";
close(ITEM);
return 0;
}

#
# Generate the RSS feed by combining the ITEM XML Files
#
sub GenerateRSSFeed {

open(RSS, ">$feedfile");
print RSS "<?php\n";
print RSS "header(\"Content-Type: text/xml\");\n";
print RSS "echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"; ?>\n";
print RSS "<rss xmlns:itunes=\"http://www.itunes.com/DTDs/Podcast-1.0.dtd\" version=\"2.0\">\n";
print RSS "<channel>\n";
print RSS "<title>MythTV - <? if (\$_GET['title'] == \"\") { \$title = \"*\"; echo \"Recorded Programs\"; }\n";
print RSS "else { \$title = \$_GET['title']; echo str_replace(\"_\",\" \",\$_GET['title']); } ?> </title>\n";
print RSS "<itunes:author>MythTV - myth2ppc</itunes:author>\n";
print RSS "<link>".&encodeForXML($feedurl)."</link>\n";
print RSS "<itunes:subtitle>Transcoded recording for your PocketPC Video.</itunes:subtitle>\n";

print RSS "<itunes:summary>Myth TV Recorded Programs for the PocketPC v.1</itunes:summary>\n";
print RSS "<description>Myth TV Recorded Programs for the PocketPC v.1</description>\n";
print RSS "<itunes:owner>\n";
print RSS "<itunes:name>MythTV</itunes:name>\n";
print RSS "<itunes:email>mythtv\@localhost</itunes:email>\n";
print RSS "</itunes:owner>\n";
print RSS "<itunes:explicit>No</itunes:explicit>\n";
print RSS "<language>en-us</language>\n";
print RSS "<copyright>Copyright 2005.</copyright>\n";
print RSS "<webMaster>mythtv\@localhost</webMaster>\n";
print RSS "<itunes:image href=\"http://myth2ipod.com/mythipod_200.jpg\" />\n";
print RSS "<itunes:category text=\"TV Shows\"></itunes:category>\n";
print RSS "<category>TV Shows</category>\n";
print RSS "<itunes:image href=\"http://myth2ipod.com/mythipod_200.jpg\"/>";
print RSS "<image>";
print RSS "<url>http://myth2ipod.com/mythipod_200.jpg</url>\n";
print RSS "<title>MythTV 2 PocketPC</title>\n";
print RSS "<link>".&encodeForXML($feedurl)."</link>\n";
print RSS "<width>200</width>\n";
print RSS "<height>200</height>\n";
print RSS "</image>\n";
print RSS "<? foreach (glob(\$title\.\"*\.$portable\.xml\") as \$file) {include \$file;} ?>\n";
print RSS "</channel>\n";
print RSS "</rss>\n";
close(RSS);
if($debug == 1){ print "I created a feed file, was I supposed to?\n"};

return 0;
}

# substitute for XML entities
sub encodeForXML {
local $result;
$result = $_[0];
$result =~ s/&/&amp;/g;
$result =~ s/</&lt;/g;
$result;
}



#
# This code taken from one of the mythlink.sh scripts to get MySQL information
#
sub PrepSQLRead{
# Get the hostname of this machine
$hostname = `hostname`;
chomp($hostname);

# Read the mysql.txt file in use by MythTV.
# could be in a couple places, so try the usual suspects
my $found = 0;
my @mysql = ('/usr/local/share/mythtv/mysql.txt',
'/usr/share/mythtv/mysql.txt',
'/etc/mythtv/mysql.txt',
'/usr/local/etc/mythtv/mysql.txt',
"$ENV{HOME}/.mythtv/mysql.txt",
'mysql.txt'
);
foreach my $file (@mysql) {
next unless (-e $file);
$found = 1;
open(CONF, $file) or die "Unable to open $file: $!\n\n";
while (my $line = <CONF>) {
# Cleanup
next if ($line =~ /^\s*#/);
$line =~ s/^str //;
chomp($line);
# Split off the var=val pairs
my ($var, $val) = split(/\=/, $line, 2);
next unless ($var && $var =~ /\w/);
if ($var eq 'DBHostName') {
$db_host = $val;
}
elsif ($var eq 'DBUserName') {
$db_user = $val;
}
elsif ($var eq 'DBName') {
$db_name = $val;
}
elsif ($var eq 'DBPassword') {
$db_pass = $val;
}
# Hostname override
elsif ($var eq 'LocalHostName') {
$hostname = $val;
}
}
close CONF;
}
die "Unable to locate mysql.txt: $!\n\n" unless ($found && $db_host);
return 0;
}

sub promptUser {
local($promptString,$defaultValue) = @_;
if ($defaultValue) {
print $promptString, "[", $defaultValue, "]: ";
} else {
print $promptString, ": ";
}

$| = 1; # force a flush after our print
$_ = <STDIN>; # get the input from STDIN (presumably the keyboard)
chomp;
if ("$defaultValue") {
return $_ ? $_ : $defaultValue; # return $_ if it has a value
} else {
return $_;
}
}

sub DoSetup {
print "\nNot ready yet. How do you send the cd command from perl?\n";
return 0;
}

---End Script

I hope posting my modified script helps. It was late when I wrote it and maybe I left something out in my instructions.

Also here is my Symbolic Link in my /var/www/ directory:
lrwxrwxrwx 1 root root 15 Dec 29 17:32 ppcfeed -> /myth/PocketPC/

I hope this helps. If I can copy any other configuration or scripts from my KnoppMyth box, let me know. I'd like to see you get this running.

Again, my thanks to Wififun.

--Brian


Top
 Profile  
 
 Post subject: First and Second Pass
PostPosted: Sun Jan 15, 2006 1:35 am 
Offline
Joined: Sun Nov 09, 2003 8:02 pm
Posts: 47
Location: Escondido CA
I have a question for Wififun:

I'm not a experienced programmer, but in reviewing your script, How does the Second Pass help in the quality of the video / audio and in the file size reduction?

It appears to me the Second Pass is still looking at the original source file, and not the First Pass file.

Any insight would be greatly appreciated!

--Brian


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 3:52 pm 
Offline
Joined: Mon Jun 21, 2004 11:25 am
Posts: 291
Location: Ontario, CA
Brian,
You may want to check out the ffmpeg docs, or xvid's really. Or to see for yourself, comment out line 113 "DoPassTwo();" This will only do a single pass. Now look at the file size of the pass one file. It could be as much as twice the size as the file from the second pass. Don't think of it as a second pass of the video file, like a copy of a copy. Rather, the first pass generates a log file "-passlogfile /tmp/myth2ipod_log." On the second pass, the encoder uses this log file generated on the first pass to determine the best encoding to use for a given point in the stream. This leads to better quality at a smaller bitrate. You can eliminate this second pass, and quality may be about the same, but at a higher bitrate. I don't pretend to know everything about encoders, but a little research about how 2-pass encoding may help you get a better understanding. This was a very basic explanation.
Hope this clears it up a bit. A quick google on multi-pass encoding turned up this.

Quote:
Using multipass technique when encoding video into another format means basically that the video encoder analyzes the video many (multi :-) times from the beginning to the end before the actual encoding process. While scanning the file, encoder writes information about the original video to its own logfile and uses that log to determine the best possible way to fit the video within the bitrate limits user has set for the encoding process -- this is why multi-pass encoding is only used in VBR encoding (the CBR encoding doesn't offer any flexibility for the encoder to determine the bitrate for each frame). Best way to understand why this is used is to think of a movie -- when there are shots that are totally, absolutely black, like scene changes, normal 1-pass CBR encoding uses the exact same amount of data to that part as it uses for complex action scene. But by using VBR and multi-pass, encoder "knows" that this piece is Ok with lower bitrate and that bitrate can be then used for more complex scenes, thus creating better quality for those scenes that require more bitrate.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 7:50 pm 
Offline
Joined: Sun Nov 09, 2003 8:02 pm
Posts: 47
Location: Escondido CA
Wififun,

Thanks! That does help me a lot. I'll experiment with a PassThree sinerio to determine if it is worth the time and effort and also to determine the resulting size of the file.

Thanks again.

--Brian


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 9:55 am 
Offline
Joined: Sat Jun 04, 2005 3:26 pm
Posts: 16
wififun wrote:
UPDATE!!! Anyone with a 5G iPOD. BEWARE. The latest iPod Updater from Apple, is not playing these myth2ipod files correctly. I get stuttering, and stopping, then loss of sound unless I stop and restart the show. Though the update did add MUCH MUCH better fast forward and rewind, this playback issue is a big problem. I am working on a new ffmpeg line that solves this. If anyone finds one first, please post it.


I have the same problem with the 1.1 firmware for my 60 gig. I bet it affects all ipod video versions.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 2:10 pm 
Offline
Joined: Mon Jun 21, 2004 11:25 am
Posts: 291
Location: Ontario, CA
Well, it looks like it is only the 60gig 5G ipods looking through other forums. However, I think I have found the changes needed in the ffmpeg line to make up for it. I will post them as soon as I verify this is working correctly.

UPDATE: well it looks like I still have not found a working encoding line for the firmware update on the 60gig ipods. Anyway, at this point I am going to revert to v. 1.0 and deal with this later. Maybe 1.2 will fix what 1.1 broke.


Last edited by wififun on Mon Jan 16, 2006 4:53 pm, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 2:41 pm 
Offline
Joined: Sun Dec 04, 2005 1:44 pm
Posts: 403
Location: Central NJ
bbutler wrote:

Be sure to:

chgrp mythtv /myth/PocketPC
and
chown mythtv /myth/PocketPC


That was my problem! It works now. Thanks!!

_________________
Currently running: R5.5, HD5000 x 2, PVR150, Athlon 64 3000+, Chaintech VNF4, 1GB RAM, 2 x 250GB in LVM, MSI NX6200TC -> AA 9A60 -> HDTV


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 184 posts ] 
Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 13  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu