Nuvexport

From MythTV

Jump to: navigation, search

Note: The correct title of this article is nuvexport. It appears incorrectly here due to technical restrictions.


Cleanup: This article or section may require cleanup. Discuss the issue on the talk page


nuvexport can be used as an alternative to MythTV's inbuilt transcoding for recorded TV files. It is a script designed to export mythtv nuv and mpeg-nuv files to other formats, including Xvid, svcd, dvd and others.

If you're looking for the Xvid codec, check here.

Contents

Installing Nuvexport

nuvexport can only be installed on Linux systems. To be of any use, you'll probably want MythTV installed first. You'll also need a copy of the FFMpeg, Transcode or mencoder encoding programs. FFMpeg and Transcode should be available as packages for your Linux distribution and mencoder is available as part of MPlayer.

In addition you will need copies of various codec files. Personally I use a lot of Xvid, and this should also be readily available as a package.

Finally, you need a copy of nuvexport. The latest copy can be found at http://forevermore.net/files/nuvexport/. For a quick install, just download the tar.bz2 source file, unzip, browse to the newly created directory in a command prompt and enter "make install".

General requirements

Image:Package.png To transcode recordings with nuvexport, you'll need the following programs installed:

  • mythtv (later versions recommended)
  • nuvexport (most recent recommended)
  • mplayer
  • perl (with libwww-perl and DateManip libraries)

To encode with FFMpeg you need: ffmpeg and yuvdenoise from mjpegtools

To encode with Mencoder you need: mencoder

To encode with Transcode you need: transcode

To transcode to Xvid you'll need: xvid

To transcode to DVDs, DVCDs and VCDs you'll need: tcmplex. Note that it's unlikely you'll actually have this installed, or be able to install it, given that it's not been touched by developers for two years... If you know how to use the updated mplex and can implement it as a replacement, please update this ticket on the nuvexport svn wiki.

To transcode to MP3s you'll need: id3tag

Fedora 7 dependencies

  • id3lib: Can be installed from Fedora extras: yum install id3lib

nuvexport can be installed as RPM from http://forevermore.net/files/nuvexport like this:

rpm -Uvh http://forevermore.net/files/nuvexport/nuvexport-0.4-0.20070804.svn.noarch.rpm

Fedora Core 4 dependencies

  • id3lib: Can be installed from Fedora extras: yum install id3lib

nuvexport can be installed as RPM from http://forevermore.net/files/nuvexport like this:

rpm -Uvh http://forevermore.net/files/nuvexport/nuvexport-0.4-0.20070804.svn.noarch.rpm

Fedora Core 2 dependencies

  • mjpegtools: provides mpeg2enc and mp2enc
  • perl-Time-Hi Res provides perl's Time::Hi Res module

Debian dependencies

  • mjpegtools: provides mpeg2enc and mp2enc
  • ffmpeg: provides ffmpeg
  • perl: provides perl's Time::Hi Res module
  • libdate-manip-perl: provides Date::Manip

Ubuntu dependencies

Mostly as Debian, but the default ffmpeg package doesn't come with Xvid or mp3 exporting enabled. It may be necessary to build ffmpeg from source.

Get the package libid3-3.8.3-dev for id3tag (needed for mp3 export).

The Ubuntu wiki has instructions for building ffmpeg from source.

Bug fix - please read

Users of nuvexport releases after Nov 17th 2006 can ignore the below, as the problem appears to have been fixed.

nuvexport versions up to and including the nuvexport 17th November 2006 release require the following patch to be applied to the code to avoid an "invalid pcm parameter" error with Transcode encodings (previous FFMpeg problems have been solved in the 17th Nov release).

The patch can be found at https://svn.forevermore.net/nuvexport/ticket/149 and https://svn.forevermore.net/nuvexport/ticket/150. It requires you to replace lines 187, 188 and 190 in nuvinfo.pm with the following lines respectively:

($info{'audio_sample_rate'})     = $data =~ m/^ID_AUDIO_RATE=([1-9]\d*)/m;
($info{'audio_bitrate'})         = $data =~ m/^ID_AUDIO_BITRATE=([1-9]\d*)/m;
($info{'audio_channels'})        = $data =~ m/^ID_AUDIO_NCH=([1-9]\d*)/m;

nuvinfo.pm can be found in either nuvexport-0.4/mythtv/nuvinfo.pm before running make install, or /usr/local/share/nuvexport/mythtv/nuvinfo.pm after installing.

Nuvexport Manual

Most of the information below was written by a novice Linux user / video editor. I've tried to explain various things like transcode programs and video formats but I can't guarantee it's all correct.

I know there's a lot to get through but once you know how you like things, you can pretty much just edit cutpoints into your file (or not), figure out the bitrate you require (or use default) and hit enter through all the other options, wizzing through in a matter of seconds. If only the transcode was as quick. Anyway, the info here I guess can be used as reference if you ever have a problem or don't know what something does. There's no real need to read it all in detail, you can generally just go with what I recommend in the "What To Use" sections, or even go with nuvexport's defaults as they're pretty good. But if you must know, it's all there, and you may find out something that'll save you time and make your recordings that bit better.

Feel free to modify, update, improve and expand the current information, but please try to keep the target audience the same - someone who really does need telling not to add the quote marks around text. This way, most users can ignore what they already know, and the novice user won't get frustrated by half explained commands. Thanks.


Note: All numbered references to encode rates are in Kbps unless otherwise stated. E.g. "XviD: Default is 960." means 960 Kbps.

Glossary

Please add to this. --Pepsi max2k 16:06, 14 October 2006 (UTC)


Codec (noun) - Coder-Decoder, a program used to perform encoding of some information from one format to another, or decode it, usually to present it in a more usable format.

Command Prompt - Officially, the character at a command line interface signifying the acceptance of text commands. Here, I mean the Unix shell, that text inputty thing that goes under various names. In SUSE it's called Konsole. Whatever, just bring one up and type commands. There's no difference to using a shell in a GUI or just using plain shell without any visual windows manager.

Encode (verb)- The term given to converting an analogue signal into a digital computer signal using one of many varying compression codecs. E.g. Recording an analogue TV broadcast or some audio through an analogue sound jack onto your PC.

Interlacing - see Wikipedia for this one. It gets complicated...

Transcode (verb) - Converting a digital computer signal from one form to another. Note that, as any piece of media information stored on a PC will already be stored in one type of digital codec, any converting or re-encoding of this file should correctly be termed as "transcoding". Anything recorded by MythTV will be stored by MythTV as an MPEG2 file, whether originally an analogue broadcast signal or digital DVB signal. Therefore any converting of this file to another file of differing quality or codec is correctly known as "transcoding". Also note that I did not know this until writing half the manual, so you'll regularly see me use the term "encode" where I should have used "transcode".

Transcode (noun) - Not to be confused with "transcode (verb)", Transcode is also the name of a Linux program that, surprise surprise, is use to transcode files.

Quickstart

This is the one for all of you who just want a quick idea on how to encode your stuff. I'll be brief and only give one method - it's what I use 100% of the time. It'll give you a decent quality recording that you should be able to play on most things (mainly your PC and some DivX compatible DVD players), and won't take up too much file size.


1. Install nuvexport (download source code, make install)

2. Edit your recording (put cut points 1.5 seconds away from the exact position you want to cut). Leave this out if you have time to encode the whole file.

3. Calculate bitrate from total running time (post-cuts) using this online time calculator and online bitrate calculator. Input a file size around 2 - 4 Mb less than required, and round down the given bitrate to the nearest 5. Leave this out if you don't care about file size.

4. Run "nuvexport --transcode".

5. Chose to encode to Xvid.

6. Chose the single recording you wish to transcode and the location to export the file to.

7. Chose "Yes" to enable myth cutlist, noise reduction, deinterlacing, crop overscan.

8. Chose 128 as audio bitrate.

9. Chose yes to Variable bitrate video and multipass.

10. Use the bitrate you ended up with after step 3 (or just use around 1000 if you skipped step 3).

11. Use 624 as width and 352 as height for 16:9 wide screen recordings (possibly forced in nuvexportrc file), or 640 as width and 480 as height for 4:3 recordings.

12. Use Avidemux to cut out any final parts and save using the "Copy" option for video and audio.

Prepare Your Recordings

Create Cutlist

Before using nuvexport, you'll probably want to prepare the recording you're about to transcode by first cutting out any of the recording that you don't want to encode, in turn creating what's called a "cutlist". This will save you the trouble of wasted time transcoding un-needed video. You can cut out parts manually or use MythTV's automatic commercial flagging for this. See the Myth Cutlist Option section of this guide for more info on how to do this.

Personally I'd advise using the manual option, as the commercial flagging doesn't always get everything right (and may cut out some of your movie if not manually edited beforehand) and even if it performed it's job perfectly, you may still be left with non-commercial parts that you still don't want to encode.

You should note that it is probably appropriate to leave around one second before / after each required part before setting the cut point. I prefer to use the edit tools to search to the exact frame I want to cut, then move one and a half seconds before / after this point before setting the actual cut point (depending on whether the section I want to keep follows / precedes the cut point respectively). I do this because I've found that in the past, the further into the movie the cut point was, the less chance there was of it being on the exact frame I chose, and I ended up losing parts of the movie and had to transcode it again. There's also another reason for leaving some extra space which I'll explain in the next section.

Also, make note of the time positions of the cutpoints! Again, explanation coming in a sec.

Once the final transcoded file is complete, you can finely edit out any excess parts with a tool like avidemux. I promise you it's extremely quick and easy.


Calculate Optimal Bitrate

If you have a specific size you wish your end recording to be the you'll want to calculate the bitrate required to create a file that size. I prefer just under 700 Mb for a full movie (one CD) or 350 Mb for a 45 minute show, and 175 Mb for a 30 minute show (half and a quarter of a CD respectively)). That's for Xvid encoded files though, and ensures they don't take up too much space on my PC and I can share them over the internet if needed. Obviously if you prefer using DVDs, have more space available, want to retain more quality or whatever, you may want to use a higher bitrate that gives a larger file size.

Either way, the first thing you need to do is work out the full length of the recording to be transcoded. Remember I told you to take note of the cut point positions? Well, if you add up all the even points and take from this the total of all the odd points, you should get the full file size. Confused? Well, if you're not a genius mathematician, you can use a tool like this online time calculator to help, then...

Imagine you have a 4 minute file, with one cut point at 1 minute in and the other at 3 minutes in. Firstly, add the second cut point (3 minutes) to the total. You got 3 minutes. Now take away the first cut point (1 minute). You have your 2 minutes total running time. Now, say you got four cut points, at 1 min, 2 min, 3 mins and 4 mins, with the stuff between 0-1 and 2-3 cut out. As before, add the second cut point (2 mins) to your total. Minus first cut point. You now have 1 minute running time in total. Start again with next pair. Add 4 minutes to your total. Take away the preceding 3 minutes. You now have your total running time of 2 minutes. If you have more cut points, just continue as before until you get your final running time.

Now, use an online bitrate calculator (I use the online DivX & Xvid calculator for calculating Xvid bitrates) to find the required bitrate for your movie based on the time and the final size you want for the file.

CBR

If you're not going to use the Variable Bitrate option (and use CBR instead) then you can pretty much type in the full running time of the show and it'll give you a bitrate that should create a file of the size you requested.

VBR

VBR files tend to take up a little more space than CBR (I know, they shouldn't, but they do). Because of this, it helps leave a margin of error with the eventual bitrate. If you calculate the bitrate based on the *exact* running total of the file, the likelihood is that the file will actually be slightly larger than is needed.

You'll also remember I told you to leave around a 1.5 second gap with any cutpoint before / after the required video you wanted to include in your transcoded file. This is one of the ways I use to help calculate a slightly lower bitrate for VBR files, giving an eventual file size equivalent to a CBR encoding of the same file.

This isn't enough to calculate the bitrate effectively though, you'll have to follow the next two steps for that.

Firstly, I enter a required file size of a number of megabytes below the required file size I really want. I follow my own tried and tested scheme for this: For 700 Mb files, enter 696. For 350 Mb files, enter 348, and for 50 Mb files, enter 49. As you can see, I take 4 megs away from 700, half away from files half that size, and 1 away from smaller files. You can generally work out for yourself that stuff twice as big as 700 Mb would need twice as much taken away from it - 8. It's just a guide, but it works for me.

Secondly I round down the bitrate that the online calculator gives me to the nearest 5. E.g. if it tells me to use a bitrate of 906, 907, 908 or 909, I would instead use 905. If it tells me to use 905, well, I either play it safe and use 900 or take a gamble and go with 905.

This way - using 1.5 second gaps for cutpoints, entering a slightly smaller than required file size, and rounding down the bitrate - I manage to get virtually all my VBR transcoded files a few hundred kilobytes below the required target, perfect for fitting onto my CD without having to overburn it.

For example, the last film I encoded contained six cut points. Each cut point was positions 1.5 seconds away from the required point I wanted, bringing the running total to 1 hour, 28 minutes and 31 seconds. Using the bitrate calculator with an audio bitrate of 128 and required size of 696 (I really wanted 700), it gives me a result of 971 for the Xvid bitrate. I then rounded this down to 970, which I used and this, after cutting out any excess parts with avidemux (because of the 1.5s offset with cutpoints) eventually gave me a file of 699.75 megabytes. Perfect. And easy, once you know how.

General Usage

How To Use Flags

Flags can be used to change various options to do with the running of nuvexport without having to change them while the program is running. You can also change a few things that can't be changed just using the program itself.

To use a flag, just type it after the main name of the program when you run it from the command prompt. You can use 0, 1, or many flags together. In the following example I've added the --transcode and --xvid flag to get nuvexport to run with the Transcode program to encode videos, and the Xvid codec for the video format.

Other useful flags are:

  • --ffmpeg : This makes nuvexport use FFMpeg to encode videos.
  • --transcode : This makes nuvexport use Transcode to encode videos.
  • --debug : This makes nuvexport run in debug mode, see the Debug section below.

Many more flags are listed in the nuvexport manual pages.

When using a flag for an encoding option that is presented during the running of nuvexport, it will change the default value of this option but this can still be overridden during the program by typing Yes or No as normal. For example, the default option for noise reduction is enabled, represented by the following text when running nuvexport:

Enable noise reduction (slower, but better results)? [Yes]

Using the flag --nodenoise when running nuvexport will cause this text to change to

 Enable noise reduction (slower, but better results)? [No]

but you can still override the (new) default option as usual by typing Yes.

How To Enter Commands

Using nuvexport is a simple case of choosing an option (usually a number or Yes/No choice), typing that choice when prompted, and hitting enter.

Numbers & Letters

Whenever nuvexport gives you a list of options, such as the first "Choose a function:" prompt, or the recorded program "Choose a show:" prompt, you should type in the the number of the option you want (or the letter if you wish to choose a lettered option) and then hit enter. For an example, here is a printout of my running of nuvexport after I have chosen a function:

You have recorded the following shows:

 1. Due South (4 episodes) 
 2. Ghostbusters II (1 episode) 
 3. NFL Super Bowl XL Live (1 episode)
 
 q. Quit

 Choose a show:

At this point, if I wanted to choose Due South, I would type in a single "1" without the quotes and hit enter. To quit, I would enter a "q" without the quotes and hit enter.

If you are given the option of choosing multiple episodes of the same program, you can choose more than one at a time by separating separating the episode numbers with spaces, for example typing in "1 4 11" (without the quotes) and hitting enter to choose episodes 1, 4 and 11. More on this is detailed in the Choosing A Show section.

Note that, when entering letters, it does not matter whether the letter is uppercase or lower case.

Yes & No

When given an option such as the following:

Enable Myth cutlist? [Yes]

This means that you have two options, either positive or negative to enable or disable the function respectively. In this case, typing "Yes" without the quotes will enable the function, and typing "No" will disable it.

You can see from the above that the prompt ends in [Yes]. This shows the default option for the command and hitting enter without entering anything will keep this option, in this case keeping the Myth cutlist enabled.

You should note that the commands "Yes", "yes", "True" and "true" are all treated as the same and will all enable a function when entered (without the quotes). The same is true for "No", "no", "False" and "false", though obviously with the opposite effect as "Yes".

The Rest

All other commands you are prompted for follow pretty much the same routine - you just enter your choice as a single string and hit enter once you've finished to move on to the next prompt. There's no need to worry about capitalisation (though you may when entering a location to export files to), and generally you can't enter more than one thing at once before carrying on.

All you need to do is follow the prompts, enter your desired choice, and continue doing so until the "Now encoding:" stage is reached, and nuvexport will continue updating the number of processed frames until it finishes the encode, at which point it will automatically exit the program, leaving you with a regular command prompt.


Note: It seems that entering anything other than "Yes", "No" or the other six substitutable commands will result in nuvexport continuing as normal. For example, entering "Blahblahblah" at the "Enable Myth cutlist? [Yes]" prompt will result in the program continuing onto the next prompt as normal. In this case, I'm unsure how nuvexport handles the command, but I assume that it will just use the default one stated in the prompt, in this case "Yes".

Quitting Nuvexport

So, you messed up a command and you want to start over. No problem, you can either enter "q" or "Q" without the quotes if you have been given the option "q. Quit" as one of the commands, or by simply hitting the "Ctrl" and "C" keys on your keyboard at the same time. You will then be returned to a normal command prompt.

Starting Nuvexport

Nuvexport is run via the command line. Open your regular command prompt and then all you need to do is type

nuvexport

If you want to change any of the basic running options then you can add flags after the main program name when you start it, but I'll discuss these later.

Regardless of what flags you use (if any), nuvexport will then begin and start reading MythTV's database to get information on your programs. This is shown by the text "Loading MythTV recording info." with a percentage mark underneath. Once this reaches 100% you will be shown a new screen that informs you which encoder MythTV is using (see below) by the following line:

Using transcode for exporting.

In this case, it's using Transcode to, well, transcode files. If you use FFMpeg or MEncoder, the printout should change appropriately.

Directly below this printout you will be given a list of encoding options and asked to choose one.


Transcode Or FFMpeg

Just starting nuvexport with the command:

nuvexport

will start nuvexport in its default mode, using FFMpeg to encode files.

One of the biggest decisions to make when running nuvexport is whether you really want to use FFMpeg, or if you want to use Transcode, or MEncoder instead as the base transcoder program. Basically nuvexport doesn't transcode anything itself, just provides easy access to other programs and their options which themselves perform the actual transcoding.

Firstly, in order to use either FFMpeg or Transcode, they both need to be installed beforehand. You'll most likely be able to do this through your OS's package manager, or download them from the internet.


Note: If you're installing from an RPM package then the options you'll be given on which format to transcode to during the running of nuvexport may differ depending on how the package has been put together. If you find that some things such as DivX/VCD/SVCD encoding options have the “(disabled)” text next to them then you'll not be able to use them due to the currently installed version of either FFMpeg or Transcode (whichever you're using) not supporting them. The only option you have is to either find another copy of the program's package, or try to compile the program from source code and install it yourself.


Note: Some of the options will be disabled regardless as I'm sure I read somewhere that the PSP and iPod encoding had not been fully implemented yet.


Note: Apparently virtually everything (Transcode included) uses FFMpeg for various things at some point. So whatever you do you need a working copy of FFMpeg installed.


FFMpeg

FFMpeg is the default program used for transcoding files with nuvexport. This means that if you just type “nuvexport” at the command line then it will be using FFMpeg. You can also use the “--ffmpeg” flag at the same time (e.g. type “nuvexport –ffmpeg” to explicitly define the use of the program. Either way, it does the same thing.

Depending on the options your installed version of FFMpeg has enabled (see note above), you'll be able to transcode to the following formats:

  • Xvid
  • SVCD
  • VCD
  • DVCD
  • DVD
  • DivX
  • ASF
  • MP3
  • PSP
  • iPod
  • MPEG2->MPEG2 cut only
  • .nuv and .sql

Advantages of using FFMpeg?

  • Firstly it'll give you more options for an encoding format than Transcode will, namely that you can export to DivX.
  • It's also known to be quicker than Transcode when encoding files, I'm guessing around 1/4 of the time.

Disadvantages?

  • Transcode produces slightly higher quality results while encoding files, especially with Xvid. I can't say how much difference there is, but it's probably best if you check for yourself. Some users report that using ffmpeg produces “smear” in the video while Transcode does not.


Transcode

As with FFMpeg, Transcode is also used for transcoding files with nuvexport. As it is not the default encoder for use with nuvexport you'll have to use the “--transcode” flag when you run nuvexport (e.g. type “nuvexport –transcode”) to explicitly define the use of the program.

Like FFMpeg, Transcode will give you the option of using various different types of formats to encode a file to. As you'll see, Transcode's options are all available in FFMpeg, though FFMpeg has a few more.

  • Xvid
  • SVCD
  • VCD
  • DVCD
  • DVD
  • MPEG2->MPEG2 cut only
  • .nuv and .sql

Advantages of using Transcode:

  • Transcode produces better quality results when using Xvid, though may produce very slightly larger files as a result.

Disadvantages:

  • Transcode takes longer to encode files than FFMpeg, roughly speaking it takes 4 to 5 times longer to encode a video than the actual length of the video (i.e. a 1 hour video will take 4 to 5 hours). Using single pass without noise reduction should speed things up a lot with very minor loss of quality.
  • Transcode will give you less options of encoding formats than FFMpeg will. The most noticeable absentee is probably DivX, though Xvid is a very similar alternative.


MEncoder

You can also use a program called MEncoder to encode files with nuvexport. This program is installed with the MPlayer package, so if you don't have MPlayer installed you won't have MEncoder. I can't really comment on it's quality or ability as I've never used it.


What To Use

This one's simple. Transcode if you want quality, FFMpeg if you want speed or DivX. Unless of course something's disabled in either version and you have to use the other.

Debug Mode

As well as using Transcode of FFMpeg, you can also make nuvexport run in debug mode by using the "--debug" flag. This causes nuvexport to go through it's normal running procedure until it gets to actually transcoding the video, at which point it doesn't actually transcode anything but instead prints out all the commands that it would normally use to encode a video.

As I mentioned earlier, nuvexport doesn't encode anything itself, it just provides easy access to other programs and their options which perform the actual encoding. The commands for running these programs are what will eventually be printed out in the debug mode.

The debug output is useful if the program is causing errors or doing something you don't think it should, and you want to check to see what is causing these problems. Running the output commands individually and changing any you think you need to could help you to solve or problem solve the errors.

At least, that's how it's meant to work, but if you know/understand how to run Transcode or the like from the command line then you're too bright for this place, and gawd knows how you run the things on their own...

For an example, I'm going to use the following article originally from the nuvexport project page at https://svn.forevermore.net/nuvexport/wiki/debug.


nuvexport's --debug mode is basically a quick way to get it to print out the commands it would normally run, instead of running them. It's then up to you to run the commands and look for errors.

Please be aware that mythtranscode's fifodir code does not work on stale fifo's, so if there is a mkdir call for a fifodir, you also need to make sure that there isn't one already created with that name.

For example, take the following sample --debug output:

system call:
 mkdir -m 0755 /tmp/fifodir_28703/

 forking:
 /bin/nice -n19 mythtranscode --showprogress -p autodetect \
 -c 1110 -s 2005-02-23-15-59-00 -f "/tmp/fifodir_28703/" --honorcutlist 2>&1

 forking:
 /bin/nice -n19 ffmpeg -f rawvideo -s 640x480 -r 29.97 \
   -i /tmp/fifodir_28703/vidout -f yuv4mpegpipe - 2> /dev/null \
 | /bin/nice -n19 yuvdenoise -r 16 -b 12,10,-12,-10 2> /dev/null \
 | /bin/nice -n19 ffmpeg -hq -threads 2 -y -f s16le -ar 44100 -ac 2 \
   -i /tmp/fifodir_28703/audout -f yuv4mpegpipe -s 640x480 -aspect 1.333 \
   -r 29.97 -i - -aspect 1.333 -r 29.97 -deinterlace -croptop 10 -cropbottom 10 \
   -cropleft 12 -cropright 12 -padleft 2 -padright 2 -s 620x464  -vcodec xvid \
   -b 960 -qmin 6 -qmax 31 -minrate 32 -maxrate 1920 -bt 32 -bufsize 65535 \
   -lumi_mask 0.05 -dark_mask 0.02 -scplx_mask 0.5 -4mv -part -acodec mp3 \
   -ab 128 -f avi "./Good Eats - Tomatoes.avi" 2>&1

because there is a mkdir in there, you'll need to first run something like:

rm -rf /tmp/fifodir_28703/
mkdir -m 0755 /tmp/fifodir_28703/

Then, you'd run:

/bin/nice -n19 mythtranscode --showprogress -p autodetect \
 -c 1110 -s 2005-02-23-15-59-00 -f "/tmp/fifodir_28703/" --honorcutlist 2>&1

Notice how the --debug output said "forking" -- this means that nuvexport intends to run things simultaneously, so you'll need to open another console window to run the next command:

/bin/nice -n19 ffmpeg -f rawvideo -s 640x480 -r 29.97 \
  -i /tmp/fifodir_28703/vidout -f yuv4mpegpipe - 2> /dev/null \
| /bin/nice -n19 yuvdenoise -r 16 -b 12,10,-12,-10 2> /dev/null \
| /bin/nice -n19 ffmpeg -hq -threads 2 -y -f s16le -ar 44100 -ac 2 \
  -i /tmp/fifodir_28703/audout -f yuv4mpegpipe -s 640x480 -aspect 1.333 \
  -r 29.97 -i - -aspect 1.333 -r 29.97 -deinterlace -croptop 10 -cropbottom 10 \
  -cropleft 12 -cropright 12 -padleft 2 -padright 2 -s 620x464  -vcodec xvid \
  -b 960 -qmin 6 -qmax 31 -minrate 32 -maxrate 1920 -bt 32 -bufsize 65535 \
  -lumi_mask 0.05 -dark_mask 0.02 -scplx_mask 0.5 -4mv -part -acodec mp3 \
  -ab 128 -f avi "./Good Eats - Tomatoes.avi" 2>&1

You need to do this because this command (ffmpeg) is actually interacting with the data that mythtranscode outputs.

From here, you basically have to watch the output from both programs to see if you notice errors. Something will usually happen fairly soon (usually ffmpeg complaining about a missing codec, bad file format, etc.). If you don't understand the error, then post the info to the mythtv mailing list, or come ask someone for help in the irc channel.


Note: for multipass files: You'll see debug printout virtually identical to above, but twice - for the first and final passes. Just run the code as above, e.g. rmdir, mkdir, 1st fork code for First Pass in one window, 2nd fork code for First Pass in another. Wait til they both finish, then do it all again (inc. rmdir, mkdir) but use the forked code from the Final Pass instead.

Which Format To Use?

After starting nuvexport, the first main printout you should see is the following:

Using ffmpeg for exporting.
 What would you like to do?

   1. Export to XviD
   2. Export to SVCD
   3. Export to VCD
   4. Export to DVCD (VCD with 48kHz audio for making DVDs)
   5. Export to DVD
   6. Export to DivX
   7. Export to ASF
   8. Export to MP3
   9. Export to PSP (disabled)
  10. Export to iPod (disabled)
  11. MPEG2->MPEG2 cut only
  12. Export to .nuv and .sql
   
  q. Quit

 Choose a function:

As mentioned in the previous section, the first line refers to the encoder program you are using with nuvexport.

The remaining options - which will vary based on the encoder you are using (FFMpeg, Transcode or Mencoder) and the versions of these you have installed (some will have options shown as disabled, note PSP and iPod are currently always disabled) - ask you to choose a format that you wish to encode your video to. The remaining option is to quit the running of nuvexport.

Just type in the number or letter of your choice and you will be taken to the next screen. Note that you can only choose one option at a time.

On the whole, each format is quite different and used for a specific purpose, e.g. transferring to DVD, CD, for use on a PC or creating an audio file. That said, I'll now go through the various formats available for both Transcode and ffmpeg, both of which make no difference on the format used (though as mentioned later, Transcode or Ffmpeg may produce better results with one than the other).

I'll discuss the advantages and disadvantages of each, as well as giving you a list of the further options you'll need to choose from before your recording finally starts to be re-encoded. The following sections of this manual go into greater detail on what these further options mean, what they do, how to use them, and whether you should actually use them or not.

Special note: you really only want to use DVD/CD formats if you're going to burn the resulting file to a DVD or CD, otherwise the compatibility and size of the file renders it pretty pointless.


Xvid

Using the Xvid option will result in giving you an Xvid AVI file.

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Where to export file(s) to.
  3. Enable Myth cutlist?
  4. Enable noise reduction?
  5. Enable deinterlacing?
  6. Crop overscan?
  7. Audio bitrate.
  8. Variable bitrate (VBR)?
         * If yes to VBR, enable multipass?
               o If no to multipass, VBR Quality. 
  9. Video bitrate.
 10. Width.
 11. Height.

SVCD

http://www.videohelp.com/svcd

This option will convert your .nuv video an SVCD compliant MPEG file, allowing you to burn the file to an SVCD formatted CD disc. Basically an SVCD is just a better quality version of a VCD, allowing up to 60 minutes of video on a CD, and are widely compatible for use with PC's or standalone DVD and CD video players. See VCD section below for more info.

Advantages:

  • Great quality
  • Wide compatibility.
  • Can be burnt to CD.
  • Great for storing on a PC.

Disadvantages:

  • Do you really want to bother making one?
  • Less compatibility than VCD.
  • Only 60 minutes of video (less than VCD).

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Where to export file(s) to.
  3. Enable Myth cutlist?
  4. Enable noise reduction?
  5. Enable deinterlacing?
  6. Crop overscan?
  7. Audio bitrate.
  8. VBR Quality. 


VCD

http://www.videohelp.com/vcd

This option will convert your .nuv video a VCD compliant MPEG file, allowing you to burn the file to a VCD formatted CD disc. A VCD can be seen as the video version of an audio CD. With audio CDs, instead of holding files in a directory format like on your PC, they hold a specialised version of the data for playback on all manner of CD players and this data can only be turned back into files by ripping the data off the disc and converting it into a commonly used format (you can kind of think of it as a “single entity” instead of multiple files). VCDs do much the same thing with videos so that they can be played on a wide variety of players. VCDs will allow you to add different subtitle tracks, audio tracks, video files and menus to a single CD, but you'll need to use a burning program capable of creating a VCD to do so. A VCD will hold up to 80 minutes of video on a single CD.

Advantages:

  • Widely compatible.
  • Can be burnt to CD.
  • Holds more video than an SVCD.

Disadvantages:

  • Worse quality than SVCD.
  • Only holds 80 minutes of video.

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Where to export file(s) to.
  3. Enable Myth cutlist?
  4. Enable noise reduction?
  5. Enable deinterlacing?
  6. Crop overscan? 


DVCD

The nuvexport mentions this as “a VCD with 48kHz audio for making DVDs”, though the only difference from a VCD that I can find is that it allows adding more video to a single CD, up to 99 minutes.

Advantages:

  • Widely compatible.
  • Can be burnt to CD.
  • Holds more video than an VCD or SVCD.

Disadvantages:

  • Worse quality than SVCD.
  • Only holds 90 minutes of video.

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Where to export file(s) to.
  3. Enable Myth cutlist?
  4. Enable noise reduction?
  5. Enable deinterlacing?
  6. Crop overscan? 


DVD

http://www.videohelp.com/dvd

The current format king for video disks. Hopefully you know what these are. A video DVD disc can hold up to two hours of great quality video or around 4 and a half gigabytes of data.

Using this option in nuvexport will give you a DVD-Video file that you can use to create a DVD video disc, capable of playing on any PC or standalone DVD player. Obviously, you can choose to use a DVD-R, DVD-RW, or any of these +, +- , -+== *% whatever types of DVD discs there are, I've still not got my head round it.

Advantages:

  • Great quality.
  • Will play in any DVD player.

Disadvantages:

  • Will only burn to a DVD.
  • Large file size, bad for keeping on a PC.

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Where to export file(s) to.
  3. Enable Myth cutlist?
  4. Enable noise reduction?
  5. Enable deinterlacing?
  6. Crop overscan?
  7. Audio bitrate.
  8. Max. VRB bitrate.
  9. VBR quality.

DivX

Using this option will result in a DivX encoded AVI file.

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Where to export file(s) to.
  3. Enable Myth cutlist?
  4. Enable noise reduction?
  5. Enable deinterlacing?
  6. Crop overscan?
  7. Audio bitrate.
  8. Variable bitrate (VBR)?
         * If yes to VBR, enable multipass?
               o If no to multipass, VBR Quality. 
  9. Video bitrate.
 10. Width.
 11. Height.

ASF

The ASF format is technically not a specific codec for encoding files, more a guide as to how to present the included information to a PC. Anyways, basically in nuvexport it uses the MS-MPEG4 codec. You can find out a little more about it at http://episteme.arstechnica.com/6/ubb.x?q=Y&a=tpc&s=50009562&f=67909965&m=4660966841 (broken link) or wikipedia:Advanced Systems Format

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Where to export file(s) to.
  3. Enable Myth cutlist?
  4. Enable noise reduction?
  5. Enable deinterlacing?
  6. Crop overscan?
  7. Audio bitrate.
  8. Variable bitrate (VBR)?
         * If yes to VBR, enable multipass?
               o If no to multipass, VBR Quality. 
  9. Video bitrate.
 10. Width.
 11. Height.

MP3

MP3s are the most widely used format for storing audio files due to their small size and good quality. Choosing this option will convert the sound (not the video) from your MythTV recording into an MP3. Great if you just want to listen to the audio (like from a music video), pointless if you want some video.

Advantages:

  • A simple way to a good quality audio file.
  • More control over audio format/quality than you get if creating a video.

Disadvantages:

  • No video.
  • You can always rip the sound from a video file at a later date.

PSP

http://www.yourpsp.com

Currently I don't think this feature has been implemented in nuvexport, but if it were then you could expect it to give you a video file in a format capable of transferring to your Playstation Portable handheld games device, that is, MPEG-4.

Advantages:

  • If you want to transfer to a PSP, it's just what you need.

Disadvantages:

  • Pointless for anything else due to the PSP's low quality video file format and generally not widely supported.

Options You'll Get When Running

1. Choose a show(s) (+ episode if applicable).
2. Where would you like to export the files to?
3. Enable Myth cutlist?
4. Enable noise reduction (slower, but better results)?
5. Enable deinterlacing?
6. Crop broadcast overscan border (0-5%) ?
7. Frame rate (high=29.97, low=14.985)?
8. Resolution (320x240, 368x208, 400x192)?
9. Video bitrate (high=768, low=384)?
10. Create thumbnail for video?

MP4 or iPod

Called mp4 in more recent versions, originally only intended for iPod http://www.apple.com/ipod/ as like the PSP option, this was to create a file to transfer to a video capable iPod portable music player.

You actually get a choice of compatible codecs with this option, either MPEG4 or H.264. Check this page for more info: http://arstechnica.com/guides/tweaks/ipod-video.ars

Advantages:

  • Great if you want it on an iPod (or Nokia N95, etc...)

Disadvantages:

  • Makes may assumptions (such as bit rate) that might not suit your needs.

Options You'll Get When Running

1. Choose a show(s) (+ episode if applicable).
2. Where to export file(s) to.
3. Enable Myth cutlist?
4. Enable noise reduction (slower, but better results)?
5. Enable deinterlacing? 
6. Crop broadcast overscan border (0-5%) ?  
7. Audio bitrate.
8. Video codec (mpeg4 or h264)?
9. Variable bitrate video?
    * If yes to VBR, enable multipass?
    * If no to multipass, VBR Quality. 
10. Video bitrate?
11. Width?
12. Height?

MPEG2 to MPEG2 cut.

This option has been removed since lossless MPEG2 cutting was added to MythTV itself.

Export to .nuv and .sql

This option will create a new .nuv and accompanying .sql file with info on the recording that you can import into a separate MythTV install on another system.

You'll be given the option to remove the recording from your current system if you wish, so make sure to answer No (the default) if you don't want to lose it.

Advantages:

  • Great if it's what you want to do.
  • Also good for added peace of mind when upgrading current systems.

Disadvantages:

  • Well... it's pointless if you don't need to do it.

Options you'll get when running:

  1. Choose a show(s) (+ episode if applicable).
  2. Delete from current system when finished?
  3. Where to export file(s) to.
  4. Create a new directory in which to store the files?


What To Use

Simply - Xvid if you know you can play it back on your equipment, DVD if you either can't use Xvid or want the best quality possible. Unless of course you have reason to use another.

Choosing A Program to Transcode

After choosing a format to transcode to, you'll be asked to chose one or more recordings that you want to transcode to this format.

This takes place in two stages, first choosing a show name (the name is taken from the name used by MythTV's EPG), and then choosing any episodes (if any) of the same show.

Basically, you'll start off with a screen like this:

You have recorded the following shows:
   
   1. BBC News (2 episodes)
   2. Due South (2 episodes)
   3. Ice Hockey (1 episode)
   4. Monkey (1 episode)
   
   q. Quit

 Choose a show:

In this example, I can see that I have four different titled shows, two of which have two episodes each recorded, the other two only have the single episode.

Note that when nuvexport says "episode", this does not mean that the show is part of a series like most soap operas or cartoons, it is just a general term to describe all recordings. When recording more than one show with the same name (as seen on MythTV's EPG) then they will both be classed as an episode of the same show, such as the "BBC News" option above.

You can choose a show title or quit the nuvexport program by typing in your choice and hitting enter.

Note: As of mythtv 0.19, all live TV (i.e. not something that you have specifically scheduled to record) that you watch through MythTV is recorded as a file into your default recording's directory, and MythTV keeps info on these recordings in it's database. These recordings will auto expire after a short period of time, and you can change this time in MythTV's settings.

Until these recordings have expired, they will still appear in the list of programs to encode when you run nuvexport, so don't be too confused when you see a huge list of recorded shows that you never thought you had.


Choosing A Show With More Than 1 Episode Listed

Choosing a show with more than one episode will take you to a new screen like the following:

You have recorded the following episodes of Due South:

   1. (1/16, 7:00 PM) 544x576 MPEG2 (4:3)
      The pilot episode of a quirky drama series focusing on quintessential
      Canadian Mountie Benton Fraser, who will stop at nothing to solve a crime.
      Investigating his father's murder, Fraser follows the trail to downtown
      Chicago. Life in the big city is very different from the frozen north, as
      Benton and his trusty wolf Diefenbaker soon discover.
   2. (1/17, 6:58 PM) 544x576 MPEG2 (16:9)
      Police drama series about a Canadian Mountie in Chicago. Fraser, with his
      wolf in tow, is hot on the scent of his father's murderer. But as he
      prepares to face the hired gun, the real killer steps out of the shadows.

 * Separate multiple episodes with spaces, ranges with '-', or * for all shows.

   r. Return to shows menu
   q. Quit
 
 Choose a function, or desired episode(s):

The screen gives you details of each episode of a single show that you have recorded, starting with the episode number (not shown here), the title of the episode (in this case there is again none for either episode), the date recorded (Month/Day), the time the recording started, the resolution the original recording is in (in this case it is incorrect, they are actually 720*576, as shown by MPlayer), the current format the recording is in (MPEG2 if you have a DVB TV card, or whatever you have chosen to encode files to in MythTV with an analogue card), the aspect ratio of the original recording (again, the second episode is actually incorrect, as shown by MPlayer. I will discuss what to do in this situation later), and also a description of the episode as taken from MythTV's EPG.

You can choose one or more episodes by typing in the number of an episode, followed by any addition episode numbers each separated by a space, a "-", or a "*". For example, if I just wanted to transcode episode 2 (recorded on 1/17), I would type the following and hit enter:

2

If I wanted to transcode both shows, I would type:

1 2

I am also given the option to return to the main shows list to choose a different show, or to quit nuvexport.

After choosing an episode to transcode, I will be taken to a screen like this (for the 1/17 recording, originally 2 in the episode list):

You have chosen to export 1 episode:

   1. Due South:
      (1/17, 6:58 PM) 544x576 MPEG2 (4:3)
      Police drama series about a Canadian Mountie in Chicago. Fraser, with his
      wolf in tow, is hot on the scent of his father's murderer. But as he
      prepares to face the hired gun, the real killer steps out of the shadows.

 * Separate multiple episodes with spaces, or ranges with '-'

   c. Continue
   n. Choose another show
   q. Quit

 Choose a function, or episode(s) to remove:

This screen gives me the details of the show(s) I have chosen to transcode, and gives me the option to either remove one of these shows (chosen in the same way as above), to continue to the transcoding options, to choose another show to encode as well as this one, or to quit nuvexport.

Choosing the number of a show to remove (in this case 1) will return you to the original screen asking you to choose a show, much like when we started this section.

If you type "n" and hit enter, you will be taken back to the original show choice screen, though this time the episode list for the chosen show will have changed to represent the fact that you already have one of the episodes chosen for transcoding, and also show an option to go straight to the encoding options screen with the previously chosen episode, much like choosing the "c" option in the previous screen. With the above example, the resulting screen will look like:

You have recorded the following shows:

   1. BBC News (2 episodes)
   2. Due South (1 episode)
   3. Ice Hockey (1 episode)
   4. Monkey (1 episode)
   d. Done selecting shows

   q. Quit

 Choose a show:

If I now choose the Due South option again, I will be shown the same screen as the episode selection screen previously, only with the previously chosen recording missing from the episode list.


Choosing A Show With 1 Episode Listed

If you choose a show with only a single episode listed (say, a uniquely named film you have recorded, or an episode of a series of which you have only recorded this single episode), you will be taken to a screen exactly the same as the one above where you have chosen an episode to transcode (starting "You have chosen to export X episode:").

As an example, say I choose the show Monkey and haven't chosen any shows or episodes to transcode previously. I will be shown a screen like:

You have chosen to export 1 episode:

   1. Monkey:
      The Great Journey Begins (2/17, 6:00 PM) 544x576 MPEG2 (4:3)
      Cult serial from Japan following the origins of Buddhism. Tripitaka and
      Monkey arrive at a village which comes under regular attack from a greedy
      monster named Pigsy.

 * Separate multiple episodes with spaces, or ranges with '-'

   c. Continue
   n. Choose another show
   q. Quit

 Choose a function, or episode(s) to remove:

If you have previously chosen another recording to encode then this will also be shown in the list. All options are the same as the equivalent screen when choosing an episode above.

From here, I can either choose another show to add to the list, or continue to transcode this show.


What To Choose

A relatively simple one this, though you may want to heed the following before just choosing every show you want to transcode:

All shows will use the same transcoding options chosen, so if you want there to be any differences between the quality or transcoding options chosen for a show, you'll have to do it in a separate run of nuvexport (you can just open another command shell and run nuvexport in there if you really want to do it at the same time, though this will slow things down for both recordings).

Transcoding takes a long time, especially if using Transcode (around 20 hours for a 2 hour show on an Athlon 2500+ processor). Unless you're planning on waiting days for all encodes to complete, you may want to do them individually. I find two 45-minute shows using Transcode with multipass and noise reduction turned on will happily complete overnight.

Add note on differing ratios between files --Pepsi max2k 12:41, 8 October 2006 (UTC)

Where To Export Files To

Usage

The first option you'll be presented with after choosing your recordings to transcode, is where you want the resultant transcoded file to be saved to. The default option will look like this:

Where would you like to export the files to? [.]

This means that the file will be saved to the directory that you were in (shown on the command prompt) when you started nuvexport. If you wish to keep the default option, just hit enter. If you wish to change the directory, enter in the full path of the directory you wish to save the file to, like

/home/user/movies/

and hit enter. The trailing / makes no difference, so you can just as easily type /home/user/movies instead.


What To Use

If you dual boot, especially between Linux and Windows, then you may want to save the files to a shared FAT32 formatted partition for easy access to the file from windows.

If you have a single location you usually save files to then you can change nuvexport's default export location in the nuvexportrc file (see final section of this guide). This will then be shown instead of the [.] default location when you run nuvexport, and if needed you can change the location in just the same way as you do with the default option.

Myth Cutlist Option

Usage

The cutlist option can be changed by typing Yes or No when given the option to enable the cutlist (the default is yes). You can also just hit enter to accept the default configuration.

  • Choosing Yes for this option will enable the cutlist if present.
  • Choosing No will disable the cutlist whether present or not.


Cutlist Explanation

This option is used along with MythTV's inbuilt editing tools which can add cutpoints to a recording, marking parts of the file to be ignored during playback / transcoding. Alternatively MythTV's commercial flagging can be used to automatically cut out parts of a recording (hopefully just the commercial parts, though I've found it's not the best at this, and prefer to manually edit myself). See the Removing Commercials wiki page for more info on MythTV's editing abilities. For both, you'll want to take note of where the edit points are in the file (i.e. the length of each part between the edits) - I'll explain why at the very end of this section.

Either way, the end result is a MythTV recording with parts of the recording effectively "cut out". The information of which bits are cut out is called the cutlist.

Choosing Yes to the cutlist option in nuvexport tells the program to only transcode the parts of the recording that have not been edited out with the cutlist. This can save a lot of time when transcoding.

Please note that in the past, nuvexport's recognition of edit point times hasn't been totally exact, so you may want to stick your edit points around a second before / after the required part starts / ends to avoid losing any information. You can then cut out the remaining parts perfectly with a separate video editing program such as avidemux (available for both Linux and Windows).

Choosing No to this option will ignore the cutlist and transcode the whole of the recording, regardless of whether any manual editing or commercial flagging has taken place.

The default option for the cutlist can be changed in the nuvexportrc file, along with an option to run commercial flagging and generate a cutlist beforehand (which isn't normally present when running nuvexport).


What To Use

Use it, always. Think about it - from when you start a recording, there may be 4 minutes til the show starts, 8 minutes of show, 4 minutes of commercials, 8 minutes of show, and another 5 minutes recorded after the show. That's nearly half and half show / non show recording, so cutting it out can save you all that time.

Just keep in mind that the timings may not be exact, and you should do any fine editing of the file in a separate editing program (it only takes an extra minute, as long as you remembered to record where all the commercials were ;o) )


Noise Reduction Option

Usage

The noise reduction option can be changed by typing Yes or No when given the option to enable noise reduction (the default is yes). You can also just hit enter to accept the default configuration.

  • Choosing Yes for this option will perform noise reduction on the file while transcoding (accomplished by enabling the yuvdenoise filter in Transcode and FFMpeg).
  • Choosing No will not run any noise reduction.

It can also be enabled using the flags --denoise (or --nodenoise to disable it).


Denoise Information

Noise reduction (also known as "denoising") is used to remove "noise" - slight fuzziness of the picture - from the video recording, improving the picture quality. The improvement you will notice will likely depend on your source recording. If there is some noise, it should improve the quality. If your original recording has very little noise, likewise the improvement you will witness by using noise reduction will also be small.

The noise reduction with nuvexport (when using either the Transcode of FFMpeg encoders) is accomplished by enabling the Yuvdenoise filter.

For more information on the yuvdenoise filter, please visit the following page on the Transcode website: http://www.transcoding.org/cgi-bin/transcode?Filter_Plugins/Filter_Yuvdenoise

where among other things it notes that "The filter mainly reduces color- and luminance-noise and flickering due to phase errors. It however does *not* do a good job on color-noise introduced by the common BT8x8 chip-set". Yeah. Got that?

There are various modes that Yuvdenoise can run in. By default it runs in mode 2 with nuvexport, this being the "Fast mode" which uses "only Pass II (bitnoise-reduction) for low to very low noise material". In other words, if you do have a real noisy signal (probably only likely if you're using an analogue broadcast source, not digital tv) then you may wanna use the slower, more thorough mode. See the nuvexportrc notes below for this.

Officially, using this filter will increase the time to encode the file by a factor of three (i.e. it takes 3 times longer). In reality, I can tell you that's pretty near the truth. Expect the thing to slow down your transcoding by at least twice the time it would take without.

The following are example images of a single video frame, encoded with exactly the same options other than noise reduction and multipass in order to show the difference between enabling and disabling noise reduction while using or not using multipass encoding. As you'll see, they are arranged in decreasing order of quality.

Please open each image in separate, full sized windows to a) view the full size version and b) so you can switch between windows and the images should be perfectly aligned to view differences between each.


Noise Reduction enabled with Multipass
Enlarge
Noise Reduction enabled with Multipass

You'll probably note the slight lines in the sky caused by the multipass. Ermm.. I'm at a loss to explain that... Multi should be better.. but anyways... This is officially the best quality you can get as far as noise reduction goes. You'll notice that the colour in the next image is slightly different (mainly in the right sand dune). That's actually the correct colour, this one is discoloured (slightly darker), but frankly i think this one looks better.


Noise Reduction disabled with Multipass
Enlarge
Noise Reduction disabled with Multipass

Note the slight blurriness of the rock structure compared to the previous image, the blurriness of the horses rear, slight blurring of the ground, the very minor loss of sharpness to the edge of the text, and the patchiness of the sky to the left. As before, the differing colour from above is slightly different. This image actually contains the closest colour match to the original recording (i.e. *the same*).


Noise Reduction enabled without Multipass
Enlarge
Noise Reduction enabled without Multipass

Ok, the sky isn't so liney without multipass, but checkout the rock structure - much more blurry than even multi + no noise reduction. The ground has also lost a lot of detail compared to using multipass.


Noise Reduction disabled without Multipass
Enlarge
Noise Reduction disabled without Multipass

Pretty much the same differences between no multi denoise & nodenoise as with multi denoise & no denoise. The sky gets more patchy, ground looses detail, all lines are more blur ed, different colouring... The worst Noise Reduction situation (obviously - it's disabled). Compared to the first image, the differences in the main rock structure would prompt me to buy glasses if I didn't know an encoding filter could solve the same problem.


Nuvexportrc Notes

As with many other things, the default option for noise reduction can be changed in the nuvexportrc file (see penultimate section on this page). This is accomplished by including either the line

noise_reduction = yes

to enable noise reduction by default, or

noise_reduction = no

to disable it by default.

As mentioned earlier, you may want to disable the "fast mode" of yuvdenoise if you have a particular noisy recording. This can be accomplished in the nuvexportrc file by commenting out the line

fast_denoise = yes

Well, it should, but unfortunately the latest version of yuvdenoise (apparently the one I have, as it still runs in mode 2 without the above) does not support the slower denoise options and therefore ignore your nuvexportrc wishes. But what can you do, eh?

Also in nuvexportrc, you can allow the yuvdenoise filter to actually carry out it's own deinterlacing if you are using the FFMpeg encoder. You should note that FFMpeg's own deinterlacing filter works much better so I'll let you search for the option yourself if you really want it.


What To Use

If speed isn't important, enable it. It does no harm and will does some good for the picture.

If speed is important, well, it won't cause too much harm to disable it either, and will speed up your transcoding no end.

Just take a look at the differences between the multi-denoise image and multi-denoise image. If you don't like the very minor darkening caused by noise reduction, and don't mind the minor loss of sharpness and added patchiness, then disable it. Otherwise, if you want to keep the best detail with slight (and arguably improving) darkening, then enable.

Personally, I always enable it. Speed is of no importance to me. Death is but a door. Time is but a window. I'll be back. Hang on...

Deinterlacing Option

Usage

To enable deinterlacing of the file via a flag, use "--deinterlace". Otherwise, type Yes or No when given the option to deinterlace (the default is yes).

  • Choosing Yes for this option will perform deinterlacing on the newly created video file so that it is permanently deinterlaced. I've no idea what type of deinterlacing filter is actually used.
  • Choosing no will leave the video file alone, retaining its interlaced picture.

Background

More info on what interlacing and deinterlacing is can be found at http://www.100fps.com

Here's a quick overview: While we think of video as being a sequence of frames, it is most often a sequence of fields. Fields come in pairs that are displayed one after the other, with one containing the odd lines of the signal and the other containing the even lines. Due to the persistence (fadeout delay) of the phosphors of a CRT set, the fact that only half of the picture is redrawn is not visible on most sets. By interlacing the content, it is possible to maintain an acceptable framerate and resolution with a much lower bandwidth requirement than a progressive signal would require. Note that two fields do not equal one frame, and they can't simply be merged! Any given field has just as much in common with the field before it as it does with the one after!


TV broadcasts have historically been interlaced, and most TV's show interlaced video. Newer Extended Definition or High Definition TV sets can display "progressive scan" content which is not interlaced. PC monitors are almost always set to progressive display modes, but CRT monitors can operate in interlaced modes as well. If your display is set to a progressive mode, your video player will have to figure out how to handle this mismatch.

Choosing whether to deinterlace your video or not can be slightly complicated.

  • Most media players can deinterlace video files themselves. I know Xine /Kaffeine on Linux have an option for it.
  • Standard TVs are designed for playback of interlaced video.
  • Portable media players will not deinterlace stuff, and may show horribly distorted video if it is interlaced.
  • Interlaced video should actually be better quality (they show slightly more detail that deinterlacing removes).
  • Some compression codecs are more efficient with interlaced content, and some are more efficient with deinterlaced content.

Possibly the most important factor in deciding is this:

  • If you choose to deinterlace the file, it will be permanently stored deinterlaced with the deinterlacing algorithm used at the time you encoded it. If a better a way of doing it is invented in the future, you'll be out of luck and won't have any use for it. In this case, it could be seen as better to keep the original file how it is so that you can take advantage of any deinterlacing options in media players on your PC that may well improve in future.

What To Use

Right, the big question, and you really wanna take a few factors into account:

1. Playing on a PC monitor suits deinterlaced video, though you can do this on the fly with some media players. In this case, the results are little different than choosing the deinterlacing option.

2. Playing on a TV via graphics card. With an ATI card, I think it'll deinterlace stuff anyway, may be different with Nvidia but in my case, there's no difference if I choose to deinterlace the video.

3. Playing on a TV via other media. Although you may expect a TV to display interlaced video correctly, in my case interlaced video looks horrible (basically, you can still see the interlacing). So you may wanna deint.

4. Playing on a portable media player. Deinterlace it.

5. If you want the best quality possible, leave it interlaced. In my experience, it'll look horrible on whatever you try to view it on, and you'll have to transcode the video to a deinterlaced file to make it look good on a lot of things. This in turn will actually lose quality due to transcoding it again. Ok, there may be better deinterlacing methods available now / in the future, but you'll probably be grateful if you play it on anything other than a TV, and in some cases even on a TV.

Ermm... final word? Encode something without deinterlacing, play it on everything possible, and see what happens. If the lines annoy you, use deinterlacing.

Personally, I'll never leave a file interlaced again.

Crop Broadcast Overscan Option

The "crop broadcast overscan" is available due to many television broadcasts having a slight black border - padding - around them. This is added by the broadcasters as the screen of many TVs actually extends beyond the physical TV frame, and therefore the padding is added to allow the broadcast to better fit the viewable area of the TV screen.

The end result of using this option on a recording with the padding is that a small amount of the video is cut from around the borders, also resulting in a cleaner edge to the picture. The examples below show this, and you should note that the large(ish) black area to the left of the image is due to the resolution width I used being longer than the actual video image (see notes on resolution width/height) – it hopefully won't appear in your videos but is used here as it shows off the “bleeding” effect in the un-cropped image better. In the first image it seems the area that is eventually cropped in the second image (about 10 pixels between the black border and image) is actually a repetition of the main image, so cropping shouldn't actually loose any of the actual picture, though whether you'd notice if it did or not is another thing.

Note: Using the crop broadcast overscan option on a video that doesn't have the black padding around the edges to begin with may end up with you having black edges around your new encoded video. You should probably check the original .nuv video file by playing it in MPlayer or another media player to see if it has any padding to the left/right.

The following images are the top right corner of one of my Xvid encoded videos. The slight difference in quality between the two shouldn't have anything to do with the cropping, just my PC being a little strange..

Image:nocropsmall.jpg

Uncropped Image

Note the slight “bleeding” of the picture into the black border.

Image:cropsmall.jpg

Cropped Image

Note the disappearance of the small (2 – 3 pixel) black border and the removal of about 10 pixels at the edges of the pictures. Also note the cleanness of the edge to the picture/black border.


What To Use

The default for nuvexport is Yes, and I'd suggest keeping it this way. The overscan is implemented purely because of the makeup of TV screens, and if you play it on anything other than regular CRT TV screens then you'll likely be glad to get rid of the border.

That said, if you are only ever planning on playing the file on a regular CRT TV, then you may well wish to keep the overscan. Without it, the video will extend to the very edges of the CRT screen, making some of the video image none viewable and making the whole image seem slightly zoomed in. You could also get rid of the border if you ever needed to, though this would likely involve re-encoding the file and loosing a little quality over the original.

Personally, I've always used the crop overscan option, and have never had any problem other than the slight zoomed in feel on regular CRT TVs. I can cope with this. In 5 years I'll have a spiffy new HD LCD Plasma Zoomydoo Whatsitmajig and I'll be able to zoom in and out of the image at will in the odd case that it doesn't fit perfectly to start with. At least I hope so...


Take pics of cropped / uncropped playing on my crt TV + monitor. --Pepsi max2k 17:02, 15 October 2006 (UTC)

Audio Bitrate Option

Add explanation in terms of use for encoding purely to MP3 and no video. I can't because my mp3 option wont work without "id3tag". I have libid3tag and dunno what else to install... Also add info on DVB-T default audio bitrate --Pepsi max2k 12:46, 9 October 2006 (UTC)

About Audio Bitrates

Audio data makes up the second largest part of the file information in a video file, the first being the actual video. This means that using different audio bitrates can significantly decrease or increase the eventual size of the transcoded file.

Different formats of videos use different formats of audio to go with them. In nuvexport's case, the most appropriate audio format is chosen for the video format you wish to transcode to. Although there may be some difference between the audio formats, there's not much you can do as far as changing them goes - if you want better audio then either increase the bitrate or you'll need to use a different video format to encode to with a better audio format.

Generally, the higher the number the better. Audio contains two main numbers detailing their quality.

First, the frequency, measured in hertz, is usually around 44100 Hz or 48000 Hz. 44100Hz is fine for just about everything, and is what most online music is sold in. The difference between that and 48000Hz will likely be inaudible to most of us, though audiophiles will beg to differ. Either way, you don't have a choice to change the frequency in nuvexport.

Secondly, the bitrate - the amount of bits used to store audio data every second - makes a huge difference in audio quality. A few years ago when I used Napster (the real version, not the crappy legal one) virtually everything was stored at 128 kbps. As internet speeds have become faster, so the bitrate of various files has become greater. Nowadays, most decent online music stores will sell you music at 192 kbps. This should be pretty telling of the bitrate that is deemed acceptable quality, at least for music.

Of course - music is one thing, and the majority of the time you're encoding voice, which requires a lot less bandwidth (lower bitrate) to create a good reproduction of the original. Nuvexport's default for many cases is 128 kbps. As mentioned, people used to trade music files at this bitrate, so it can't be to bad. For most TV recordings it'll be pretty good, and totally acceptable for the majority of us.

Again, if you do have a good audio setup at home, you may want to put a little more effort into your audio thinking. On a good system, the difference between 96 kbps and 192 kbps will probably be pretty audible, even if the former would be perfectly acceptable to a lot of us. The difference between the various bitrates has been widely detailed on numerous websites - just do a google search for "audio bitrate comparison" and I'm sure you'll get all the info you need.

Of course, with greater audio bitrates comes greater eventual file sizes for your transcoded recordings. If you read the "Prepare Your Recordings" section at the start of this manual, you'll have noticed I mentioned using a video bitrate calculator in order to find the right video bitrate for a given file size that you want to end up with. The bitrate calculator link I recommended contains a row to enter the audio bitrate that you are using and will take this into account when calculating video bitrates. Obviously, if you want a file of a certain size then increasing the audio bitrate will mean you'll have to decrease the video bitrate to maintain this size.

On the other hand, if you don't care about file sizes, then you can choose whatever audio bitrate you like, as long as it's compatible, just don't expect to hear to much difference with anything much higher than the defaults, unless you're an audiophile with a high end audio system.


As a guide, UK DVB-T (Freeview) broadcasts usually use an audio bitrate of 192 kbps. This can be as high as 384 kbps, and I've heard of the main BBC channels using 256 kbps, but my recordings never show anything other than 192 kbps. Because of this it is pointless in using anything higher than 192 kbps as a bitrate for your recordings as the quality won't get any better if you chose a higher bitrate than the original.

Usage

Audio bitrate is represented in nuvexport in terms of kilobits per second, and can be altered by entering a new number such as "128" or just hit enter to accept the default. The audio bitrate can be altered when encoding to the following formats. Formats not listed only work with one specific bitrate, and therefore this cannot be changed.

Xvid and DivX

Xvid and DivX files generally use MP3 encoded audio at 44100 Hz and between 8 and 320 kbps.

The default option in nuvexport is 128 kbps MP3, and this can be changed between 8 and 320.

SVCD

SVCD videos contain MP1 audio at 44100 Hz between 32 and 384 kbps.

The default option in nuvexport is 192 kbps, and this can be changed between 32 and 384.

DVD

DVD videos contain MP2 audio at 48000 Hz between 32 and 1526 kbps.

The default option in nuvexport is 384 kbps, and this can be changed between 32 and 1526.

ASF

ASF files can technically contain any type of audio and video codec at any rate.

In nuvexport, the MP3 codec is used and therefore, like DivX, can be changed between 8 and 320.

Ipod

The Ipod video is encoded with AAC audio at 48000 Hz between 8 and 320 kbps.

In nuvexport the default option is 64 kbps, and this can be changed between 8 and 320.


What To Use

Unless you're in a position to state that you can tell the difference between 128k and 192k audio on your system when watching videos, and are affected by this difference, then I can safely say that you can stick with the default options for audio on most of the above formats. You really won't lose much, if any, information from the audio by choosing anything around 128 kbps, and this is also the de-facto standard for audio on many video files available over the internet.

That said, for the ASF and Ipod options, you may want to increase the 64 k bitrate to 128 k as the difference will be noticeable. That said, these formats are meant for short-running shows crammed into tiny drives on portable music players and therefor would both suit a smaller file size and listened to through headphones that aren't meant to provide the best audio to the listener.

Personally, I've always used 128 kbps. For years I kept my songs in that, and I still couldn't tell the difference between them and the 192 k versions I now use. For TV, I can't be bothered with anything else.

Variable Bitrate Video Option

Rewrite to stress CBR *def.* lower file size --Pepsi max2k 19:18, 12 October 2006 (UTC)


The variable bitrate video option refers to the way in which the video images are encoded. Commonly, videos are encoded with Constant Bitrate (CBR) meaning that each frame in the video has the same number of bits (same amount of information) making up the image in the frame. Variable Bitrate (VBR) means that each frame will use a bitrate appropriate to the amount of information that is in that frame.

For example, if you were to have one frame of just a black background and very little detail (if any), and one of a very complicated scene of say, a street with many people in it showing a large amount of detail, it would make sense to use more space (bits) to save information to make up the street scene, and the black background frame could be represented by very few bits (say, just a few bits to represent the colour black, and a few more to tell the player to repeat this colour throughout the whole frame).

Using constant bitrate, each scene would use the same amount of bits (determined by the Video Bitrate option in nuvexport) to make up each scene. Using variable bitrate, the bits would be allocated where they are most needed (averaging out to the Video Bitrate option in nuvexport - e.g. if you used a 1000 kbps bitrate, around 900 could be given to the street scene frame and only 100 to the black frame).

This means that for a file of a given size, VBR should produce better results, as it will only use what is needed to encode simple frames, and use the excess to add more detail to those that need more). In other words, you can use a slightly higher overall bitrate for VBR and it should give you a file of around the same size as CBR with a lower bitrate.

Officially, VBR should produce a video of smaller size compared to a CBR file with the same bitrate. Unfortunately that doesn't appear to be the case in nuvexport, and almost all VBR files will be slightly larger than their CBR counterparts.

Of course, if you are encoding a recording where every frame is as detailed as each other (say, a short home movie taken with an unsteady hand of your living room) then using VBR may well give the same results as CBR (with VBR determining that each frame needs as much bits to encode it as each other frame). But for most TV recordings where at the very least you have simple titles at the beginning and end of each show, it would probably be wise to use VBR anyway.

Also of note is the fact that, being less common than CBR, VBR is also supported on less playback devices. If in doubt you should check the documentation for your equipment but most modern DVD and portable media players should hand VBR video OK.

For more information on VBR, please see the following websites:

http://en.wikipedia.org/wiki/Variable_bit_rate

http://forum.videohelp.com/viewtopic.php?p=1490080

http://forum.videohelp.com/viewtopic.php?t=294283


Visual Examples

As with the noise reduction example images, you may well wish to open each image in separate, full sized windows to a) view the full size version and b) switch between windows and the images should be perfectly aligned to view differences between each.

Firstly - a few notes.

1) The images have been compressed into the popular JPEG photo format for viewing on the internet. This loses a very small amount of quality over the original transcoded video frame, so in a few the differences are very very slightly less pronounced.

2) The actual quality does seem to vary between CBR and VBR seeming to have the greater quality in separate images. Generally, where CBR images seem to show greater quality, these are simple frames with little information in and the VBR command obviously believe it acceptable to save the bits from these frames to use elsewhere.

3) The eventual file size of my test videos using CBR for one, VBR for the other (and exactly the same settings for everything else) actually produced an 8.8 Mb file for CBR, and 8.9 Mb file for VBR. I double checked this to be sure, and the second files were exactly the same down to the last bit. Also a 1045 kbps film was 693 Mb with CBR, 698 Mb with VBR. Obviously, this is contrary to what should be expected, but seems to be a constant feature at least when using nuvexport.

4) Overall the differences were extremely small, but seem to go in VBR's favour. Just.

VBR Image 1
Enlarge
VBR Image 1
CBR Image 1
Enlarge
CBR Image 1


Above shows a minor loss of quality in the CBR image compared to the VBR one - to be expected as this is a relatively detailed scene. The ground is overall more blurred in the CBR image, most notably in the far off sand dunes at the back left of the image.