VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. [EDIT:

    This guide represents one persons methods for achieving the desired outcome. This does not imply that all the methods used are the best or in some cases even correct.

    /moderator bugster

    ]



    This is a guide on how to encode DVD Video. The format I based this guide on is 1750kb 352x480 video, 224kb AC3 audio. This is simply what I use, you can use whatever you want. This calculator may be helpful in choosing the right bitrate for you.

    This guide will not cover how to capture or author, but it will point you in the right direction. This guide will mainly cover encoding from a capture, or reencoding something you have downloaded.

    To the capturers: If you are capturing a clean digital cable/satellite source you can skip this whole guide. Simply capture to MPEG2 in the bitrate you want your DVD to be.

    If you are going to filter (capturing a bad source e.g. Old VHS) or want to do 2 encodes (xvid and MPEG2), then you should capture to something lossless. I recommend HUFFYUV, but if you don't have enough hard drive space use 7mb/s 720x480 or 704x480 MPEG2. After capturing, you will encode using this guide.

    Programs required

    Download and Install all of these programs


    Virtualdub

    Avisynth

    Gspot or video toolbox

    Cinema Craft Encoder (commonly refered to as CCE) - WARNING, demo version overlays a logo on your video.

    Audiograbber (for normalizing)

    Besweet + TheAC3Machine GUI

    Other programs

    These programs are for audio filtering, not required

    Adobe Audition

    Sony Soundforge


    STEP 1 - Know your source (skip this step if you captured your source)

    The Basics

    The first step to any encoding process is to know your source. If you captured the video yourself, you can skip this step.

    If you're reencoding someone else's work you need to analyze the clip settings first. Open up gspot or videotoolbox. Browse to the file. Note down the resolution, FPS, audio codec, and audio sampling rate.

    Interlaced or Progressive

    Xvid's/Divx's are commonly progressive, although they can be encoded interlaced. With MPEG2 it is the other way around. You can check your video, if it looks normal on your PC it is probably progressive. If there are comb teeth when in motion it is probably interlaced. From my own personal experience it doesn't really effect the video as to whether you encode it as progressive or interlaced. So don't fret over it.

    Interlaced:


    Progressive:


    Thanks to www.doom9.org for these images. Source

    STEP 2 - Build a script

    CCE does not have an internal resizer so we must do our resizing in either virtualdub or avisynth. You should have avisynth installed.

    Open up notepad to start writing your script.

    Here is a script for a digital cable capture:
    Code:
    avisource("I:\new\insync\Pumping Iron.avi") 
    BilinearResize(352,480)
    This script is very short because the source was already HQ.

    To bring in an mpg file into avisynth DirectShowSource("") should be used in place of AviSource("") .

    You should use BilinearResize() for downsizing resolution and BicubicResize() for upsizing.

    If the framerate you noted down earlier is different from your target framerate (29.97 NTSC, 25 PAL) use ConvertFPS(target framerate).

    Once you finish building your script, save it off as a .avs. You can open it up through windows media player to check it before feeding it into the encoder.



    STEP 3 - Video Encoding


    Now that we have finished preparing our source, we need to encode.

    Job Control

    1. Open up CCE.
    2. Right click inside the window->add
    3. Browse to your .avs script
    4. Right click the job, edit



    Encode Setting
    You should now be at a screen titled Encode Setting. If you have received errors, try relaunching CCE. If that doesn't work, the script is probably bad in some aspect.

    Change the mode to MPEG2 [ES, Multipass VBR]
    Uncheck Audio file (Unless you want to use MP2 audio)

    Bitrate - Avg should be set to the bitrate you want your encode to be. The higher the bitrate, the less video you can store on the dvd. There is a calculator here.

    I use 1750 for avg, 0 for min, 9570 for max. If you are encoding 720x480 or 704x480 video you should use a higher bitrate.

    Passes - If the file does not require any filtering I use 9. If it does require filtering I use 3. The more passes, the better the quality will be. Every pass you add requires more time for the process to complete.

    Click the ... next to Video Files. Browse to the location where you want to save your encode.



    Video

    Click on Video. This may seem weird, you need to uncheck DVD video complian. This automatically forces your image to 720x480 by adding black borders (go figure). 352x480, 352x240, and 704x480 are indeed 100% dvd compliant resolutions.
    Click OK


    Quality

    Click quality. Uncheck the Low and Effect filters. These filters are crap, if you need filtering implement it in your avisynth script, or use virtualdub.

    If your video is progressive, change block scanning to zigzag and check progressive frame flag. If your video is interlaced leave the defaults (Alternate, uncheck progressive). Click OK



    Start Process
    Click ok in the encode setting window, if you want to encode a session of several videos. You can add as many videos in as you want for multiple encoding jobs. The easiest way to do it is to right click your first video and copy. Right click the new video, change the source, the name (for reference), and the output file. Click OK again and repeat until you have all of your videos for the session in the main window. Click Encode to start the process.

    If you just want to encode one video, click encode now.

    MAKE SURE TO SAVE YOUR SETTINGS FOR NEXT TIME (.ecl files)! Then you won't have to go through the entire process again. Maybe change a few things here and there, but its better than starting from scratch.

    When your encode is finished you will have a .mpv file
    This filetype can be played in most media players, and is accepted by most authoring programs.


    STEP 4 - Audio Encoding

    In order for a DVD to be fully compliant it has to contain at least one PCM or one AC3 track. This guide uses stereo AC3 for the previous purpose and it yields better quality at the same bitrates as MP2.

    Extraction

    First we need to extract a raw pcm from our source.
    Open up virtualdub, then open your source file. If the source is mpeg you will need vdubMPEG2 or an avisynth script.

    Click on audio->full processing.

    If the frequency you noted down before was anything other than 48000hz or 48khz, you need to convert it. Select Audio->Conversion. Click the radio button by 48000Hz.

    Go to file save WAV.

    Normalization
    Normalization is a volume regulation process. The purpose is so that there will be minimal change in volume from episode to episode. The peaks of the wave are analyzed then regulated up to a specified level. Unlike other volume changing processes, no quality will be lost. Many programs can normalize, this guide will use audiograbber.

    First you should make a backup of your audio file, since this process is irreversible.

    Open up audiograbber. Settings->Normalize Settings. Set the level to which you want to normalize. I recommend 30%.

    File->Normalize. Select your file. The process should be completed in a matter of seconds.

    AC3 Encoding

    Open up the AC3Machine GUI. Load in your normalized wav. Select a save destination.
    Follow these settings:


    You should now have a dvd compliant ac3 audio file, and dvd mpv video file. Many authoring programs will not accept ac3. I recommend using DVDLab.

    Filtering (Optional/For the advanced)

    So far I have showed you how to make a basic encode. With clean captures (digital cable or satellite), you are done and do not need to filter. But with divx reencodes and dirty captures you might want to go farther for the best encode possible.

    For making a dvd for your own personal self, I think you shouldn't even bother with this stuff. When you are making a dvd for an audience in the hundreds or thousands though, you should definitely consider this extra information.

    Analyze

    How do you know if your source needs filtering?
    Play the video.

    Is the picture clear and crisp? Is it noisy? Are the colors dark and washed out? Is the video blocky?

    What is the audio like? Are there clicks and pops, background noise, or screeching?

    Video Filtering

    Here are some of my own recommendations, apply them in step 2:

    Macroblocks/Jaggies/Blocky Video - When played on a tv, blocky video will yield unsmooth movement, looking almost as if framerate is dropping in areas of motion. This can be fixed with Virtualdub's blur and blur more filters.

    Analog Noise (old vhs) - There are several noise filters out there. I use the MSU denoiser. Temporal should be adjusted from 30 to 100 until optimal quality is achieved. Going above 100 can cause the video to detect motion scenes as noise, leaving blurs in motion scenes. The spatial parameter has little to no effect on video quality

    Brightness/Contrast - Built in virtualdub filters

    Cropping Compensation

    Another common thing that I have not seen covered in any guides is cropping compensation. If you are a capturer, you have probably noticed lines on the borders of your capture. This is much more evident in vhs caps, but can also be seen in cable and satellite caps. Now don't get immediately startled about these lines, they are there for a reason.

    NOTE: If you are encoding your own captures you can continue ahead without worrying about all this, just do NOT crop off the lines. They are important.

    Every TV crops off a certain part of the source signal. The reason for this is that these are not "valid" parts of the image. In these parts of the signal closed captioning and all sorts of other stuff is stored. TVs crop off these parts of the signal because they are assumed to be garbage.

    Now what does this have to do with encoding? Well, tvs crop off the same amount of image no matter what. So what is going to happen if valid parts of the image exist on the edges? They are going to get cropped off, leaving you with something missing.

    Wait...Didn't I say that all that is stored on the edges is invalid info? Consider this: Say your friend does a capture, and he encodes it to xvid. While encoding it he sees distracting lines on the sides of the picture. He decides to crop them off, this is acceptible for PC playback. The encode now only contains valid image parts. He sends you the file, and you decide to reencode it to DVD.

    Now you play the DVD on your TV. The TV says, "hey, the outer portion of the image is always bad. I am gonna throw it in the trash." Now a part of the image that was originally intended to be shown by the broadcasters, will not be viewable.

    Most xvids/divx's out there are cropped. To fix this we will add black borders on the sides of the image. This tricks our TV to display valid parts of the video.

    Now this is not always necessary. In fact, when reencoding MPEG2 video it is rarely necessary. You should do an encode without borders first if you can, and play it back on your TV. If it looks cropped you will need to play around with borders.

    Here are frames from two different encodes of Talking Heads - Wild Wild Life. The first frame is from a PAL DIVX, while the second is from an old series PAL DVD.

    Frame 1 (resized for comparison):

    Frame 2:


    Disregard image quality differences. Do you see the borders on frame 2? By comparison, do you see that frame 1's borders were cropped off? Frame 2's borders will be cropped off when played, leaving us with valid image. Frame 1's valid image will be cropped right to the right edge of the beavis and butthead logo. Frame 1 needs to be compensated for by adding borders.

    Implement in STEP 2


    Here is an example script for a PAL DIVX. This clip was PAL and overly cropped. I wanted to turn it into a NTSC MPEG2 with the correct amount of picture showing when played back.
    Here is what I did:
    Code:
    avisource("C:\BnB_S02E07 - Friday Night (With Videos) Divx.avi")
    BicubicResize(336,464)                 
    AddBorders(8,8,8,8) 
    ConvertToYUY2()
    ConvertFPS(29.97)
    This encode needs cropping compensation. We don't resize directly to 352x480, we resize to 336x464 then add 8,8,8,8 borders. This produces a 352x480 file with borders. ConvertFPS(29.97) finishes the PAL->NTSC conversion.

    8,8,8,8 borders are not the solution to every cropping problem, you will need to adjust to get it perfect.

    Implementation:
    Resize(target horizontal resolution - (left + right), target vertical resolution - (top + bottom))
    AddBorders(left,top,right,bottom)

    *Resize is implicit (should be BilinearResize, Bicubic, etc)
    *Left is the amount of black border you are adding to the left, top is to the top,...

    Audio Filtering

    If your audio sounds noisy, you should try filtering. Apply filters after the extraction in STEP 4. A guide for Sony SoundForge is here.
    A guide for Adobe Audition is here.
    Audio is very hard to filter, so you may not want to bother with it.
    Quote Quote  
  2. Originally Posted by capturebat
    You should now have a dvd compliant ac3 audio file.
    Not if you use AC3Machine you won't...

    AC3Machine is based on BeSweet, which is based on ffmpeg. The output is *NOT* 100% DVD compliant, but does work on most players. I know that some of the Pioneer DV ?4? series won't play disks produced with ffmpeg based AC3 audio.

    An interesting point. I have noticed that some authoring programs refuse to accept BeSweets output, but DO accept output from the original ffmpeg.
    Quote Quote  
  3. A few points:-

    Originally Posted by capturebat
    From my own personal experience it doesn't really effect the video as to whether you encode it as progressive or interlaced. So don't fret over it.
    Bad advice. If the source is interlaced, leave it interlaced. If the source is progressive, encode as progressive. When encoding interlaced, make sure you know the field order of the source and keep it when you encode.
    De-interlacing should be avoided if at all possible.

    Originally Posted by capturebat
    If the framerate you noted down earlier is different from your target framerate (29.97 NTSC, 25 PAL) use ConvertFPS(target framerate).
    And what if the source framerate is 23.976fps (as many Divx/Xvids are) Again, this is generally bad advice. If you need to change the framerate in order to convert between PAL and NTSC sources, consult one of the many guides and forum threads on the subject, it is not as simple as you make out. If the framerate of the source is just a little out (e.g 24.998fps for PAL), your advice is fine. But much more than that requires another approach.

    Originally Posted by capturebat
    Passes - If the file does not require any filtering I use 9. If it does require filtering I use 3. The more passes, the better the quality will be. Every pass you add requires more time for the process to complete.
    The law of diminishing returns!
    Each pass will show a smaller improvement in quality then the previous one. By the time you have done pass 3, the improvement of further passes is minimal. Very rare to need more than 3, 5 occasionally, 9 never, it is overkill and waste of time.
    And why only 3 when filtering? If a video requires filtering I would expect it to also need more work when encoding to get the quality up!



    Originally Posted by capturebat
    Macroblocks/Jaggies/Blocky Video - When played on a tv, blocky video will yield unsmooth movement, looking almost as if framerate is dropping in areas of motion. This can be fixed with Virtualdub's blur and blur more filters.
    They are better fixed by using a higher bitrate!


    Originally Posted by capturebat
    Do you see the borders on frame 2? By comparison, do you see that frame 1's borders were cropped off? Frame 2's borders will be cropped off when played, leaving us with valid image. Frame 1's valid image will be cropped right to the right edge of the beavis and butthead logo. Frame 1 needs to be compensated for by adding borders.
    If your source file is already cropped, by all means add borders when you encode. If the source file is not cropped and shows noise typical of VHS on the bottom edge, it is often better to crop and add borders of the same size than to rely on your TV cropping the image on playback. Why? That noise will use up precious encoder bitrate, meaning less bitrate for the visible picture and so reducing its quality. No amount of passes can compensate for that.
    There are 10 kinds of people in this world. Those that understand binary...
    Quote Quote  
  4. Originally Posted by bugster
    A few points:-

    Originally Posted by capturebat
    From my own personal experience it doesn't really effect the video as to whether you encode it as progressive or interlaced. So don't fret over it.
    Bad advice. If the source is interlaced, leave it interlaced. If the source is progressive, encode as progressive. When encoding interlaced, make sure you know the field order of the source and keep it when you encode.
    De-interlacing should be avoided if at all possible.
    Well of course you should. I am saying if you cannot distinguish if the source file is interlaced or progressive.

    Originally Posted by bugster

    Originally Posted by capturebat
    Do you see the borders on frame 2? By comparison, do you see that frame 1's borders were cropped off? Frame 2's borders will be cropped off when played, leaving us with valid image. Frame 1's valid image will be cropped right to the right edge of the beavis and butthead logo. Frame 1 needs to be compensated for by adding borders.
    If your source file is already cropped, by all means add borders when you encode. If the source file is not cropped and shows noise typical of VHS on the bottom edge, it is often better to crop and add borders of the same size than to rely on your TV cropping the image on playback. Why? That noise will use up precious encoder bitrate, meaning less bitrate for the visible picture and so reducing its quality. No amount of passes can compensate for that.
    Yes, I forgot to mention that.

    Originally Posted by bugster
    Originally Posted by capturebat
    Macroblocks/Jaggies/Blocky Video - When played on a tv, blocky video will yield unsmooth movement, looking almost as if framerate is dropping in areas of motion. This can be fixed with Virtualdub's blur and blur more filters.
    They are better fixed by using a higher bitrate!
    Not if the source has macroblocks.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!