[mythtv-users] nuvexport and ffmpeg
Rod Smith
mythtv at rodsbooks.com
Mon Feb 19 20:45:46 UTC 2007
On Monday 19 February 2007 13:26, Mark Chang wrote:
> I am having trouble with the quality of transcoded shows using
> nuvexport. It seems as though the settings from nuvexport are not
> making it into ffmpeg. For instance, setting everything equal except
> changing video bitrate from default ~900 to 1500 has no effect on size
> of file or quality of playback. I read in the archives that there was
> an issue with command line parameters... is this the case with the
> versions I have below? Is there any way to find out combing through
> nuvexport code?
>
> Using transcode, though, gives me fantastic output...
I've noticed something similar using MythArchive to create DVDs. Set for SP
mode, which supposedly gives 2 hours on a single-layer (4.3GB) DVD, it fits
more like 3.5 hours on the DVD. Using HQ (supposedly 1 hour) fits the same
amount on the DVD, with identical file sizes. Dropping down to LP and EP (4
and 6 hours, respectively) produces capacities closer to the advertized ones.
This is with NTSC source material recorded using a pcHDTV 3000 card in MPEG-4
format. When I try creating DVDs from HD content (stored in MPEG-2 format
natively), the capacities/sizes are much closer to what's advertized. I
suspect that something in the chain of tools isn't handling the MPEG-4 format
optimally or is unable to bring up the bit rate to the requested value from
an MPEG-4 source.
My solution for the moment is to use a script built on mencoder to transcode
to MPEG-2 format and then to build my DVDs from that, using the "do not
transcode" option. This gives me finer control over the target bitrate, but
it doesn't always work right -- I occasionally get short recordings (I
believe anything over 1GB is getting truncated). In other words, my custom
script is still a work in progress. Letting MythArchive re-encode the file
usually works around those problems. The commands I'm using are based on
commands posted a week or two ago by Scott Alfter
(mythtv at salfter.dyndns.org), but I've tweaked them. They are:
#!/bin/sh
# Script to convert MythTV .nuv files to MPEG-2 format
src=$1
dest=$2
vbitrate=$3
nice -n 18 mencoder -vf
kerndeint,softskip,crop=640:360:0:60,scale=720:480,hardd
up -ofps 30000/1001 -aspect 1.7777 -ovc lavc -lavcopts
vcodec=mpeg2video:vrc_bu
f_size=1835:vrc_maxrate=9600:vbitrate=${vbitrate}:keyint=18:vpass=1:turbo:trell:
dc=10 -oac copy -o /dev/null ${src}
nice -n 18 mencoder -vf
kerndeint,softskip,crop=640:360:0:60,scale=720:480,hardd
up -ofps 30000/1001 -aspect 1.7777 -ovc lavc -lavcopts
vcodec=mpeg2video:vrc_bu
f_size=1835:vrc_maxrate=9600:vbitrate=${vbitrate}:keyint=18:vpass=2:turbo:trell:
dc=10 -oac lavc -lavcopts acodec=ac3:abitrate=192 -of mpeg -o ${dest} ${src}
The main commands are just two lines, both beginning with "nice"; they're
broken by my mail client. This version is set to create 16:9 DVDs from 4:3
recordings, since I'm mostly creating DVDs from letterboxed laserdiscs at the
moment. You'd remove the crop=640:360:0:60 option and change the -aspect
option to not do this, and you'd need to change the crop= option's values if
you wanted to create 16:9 videos from a letterboxed source but are recording
at other than the 640x480 resolution I'm using. The main difference from what
Scott posted is that he specified use of the pullup option for
de-interlacing, but I found that didn't work at all for me (results were
HIDEOUS), but kerndeint did work. FWIW, MythTV's MythArchive also produces
DVDs that have bad interlacing effects. This is correctable when playing in
MythDVD, but my standalone DVD player doesn't handle it so well.
Preprocessing with my script eliminates the interlacing artifacts. Needless
to say, this is all rather awkward, but it's worth the effort for creating
DVDs I intend to keep for a while.
--
Rod Smith
http://www.rodsbooks.com
More information about the mythtv-users
mailing list