1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Making DVD from AVIs/MPEGs using elementary streams

Discussion in 'MPEG-1 and MPEG-2 encoding (AVI to DVD)' started by aldaco12, Jun 7, 2006.

  1. aldaco12

    aldaco12 Active member

    Joined:
    Nov 6, 2002
    Messages:
    2,544
    Likes Received:
    0
    Trophy Points:
    66
    [bold] Making DVD from AVIs/MPEGs using elementary streams [/bold]

    This is a test. That is, I was wondering if the method (which I think to be rather smart) I use can be understood better and performs better, than the other one, well known.

    Well, the process of 'making a DVD using elementary streams' can be divided in three phases:

    1) AVI/MPG encoding into DVD video + DVD audio;
    2) DVD authoring (DVD video + DVD audio ---> VOB set + IFOs + BUPs);
    3) DVD burning (burning the over listed stuff into DVD's \video_ts directory).

    Since many authoring applications work better (e.g. DVD Lab) when you insert them 'elementary streams' [that is, the video + the audio (+ the subtitles + the chapters position], like the free IFOEdit, I decided to explain the method I use. When I tried it, I managed to create a DVD at the first time!
    I won't explain how to create a DVD with multiple audios.

    I will suppose you'll use, as 'authoring' tool, the free application named IFOEdit (DVD Lab is better, but isn't free. Any suggestion is welcome). To author the DVD using elementary streams, simply do DVD Author___Author a new DVD. Load the video (M2V), the audio (MP2 or AC3 sampled 48 kHz).
    IFOEdit has the big drawback that you cannot select an exact beginning point (e.g. 48').
    To skip this problem, you can add a default 'chapter' file.
    This can be done by adding a text file made this way: add a text file (named, for instance, celltimes.txt) with each line which contains a 'chapter' position which you'll want each 5', made so each line is 5*60*frame, that is:
    7500 for PAL (25 fps);
    8991 for NTSC (29.97 fps).

    That is, you'll have a "celltimes.txt" file made this way:
    7500
    15000
    22500
    30000
    37500
    45000
    52500
    60000
    67500
    75000
    82500
    90000
    97500
    105000
    112500
    120000
    127500
    135000
    142500
    150000
    157500
    165000
    172500
    180000

    for 2h PAL and
    8.991
    17.982
    26.973
    35.964
    44.955
    53.946
    62.937
    71.928
    80.919
    89.910
    98.901
    107.892
    116.883
    125.874
    134.865
    143.856
    152.847
    161.838
    170.829
    179.820
    188.811
    197.802
    206.793
    215.784

    for 2h NTSC.

    I chose to insert 2h to write less stuff in this post, but you could make a 3h long 'celltimes.txt' file (e.g. using Excel + doing 'cut and copy' in the .txt file). IFOEdit will reject any chapter placed after the movie end and won't show any error.
    Load in IFOEdit, after loading the video and the audio, celltimes.txt in the 'Scene changes/chapters' box.
    This way, by clicking 'next' you'll jump 5' and you'll be able to search a definite point in your DVD.

    After you've done everything I explained, choose a destination directory an click [OK].

    I remind the readers, any suggestion for a free 'authoring' tools which lets a DVD player directly to jump at any desired movie point is appreciated.

    On the next post you'll find how to create individual DVD streams.
     
    Last edited: Jun 7, 2006
  2. aldaco12

    aldaco12 Active member

    Joined:
    Nov 6, 2002
    Messages:
    2,544
    Likes Received:
    0
    Trophy Points:
    66
    [bold]
    CREATING ELEMENTARY DVD STREAMS
    [/bold]

    Some encoder automatically create elementary streams when it encodes into DVD. For instance, TMPGenc Plus automatically outputs, by default, a M2V video file and a 48 kHz WAV file.
    CCE also can create a video stream alone. In truth, to create the audio stream it'll will require some additional application.
    In any way, if your encoder will create a 4489 MB MPG file, you can de-multiplex it into video (MPV or, since it's a MPEG-2 file, a M2V) and audio.

    If you have a movie slpit in two AVIs (e.g. movie_CD1.avi and movie_CD2.avi) you'll have to join them as explained in the http://www.afterdawn.com/guides/archive/virtualdub_join_avi.cfm
    and, if VirtualDub gives you the an error like [bold]the video streams have different sampling rates (29.97003 vs. 29.97000)[/bold], applying http://forums.afterdawn.com/thread_view.cfm/309635 .

    We'll also suppose you'll be able to create (following the already written guides) an movie compliant to your TV system (PAL/NTSC).

    [bold]'Elementary stream' [/bold]means that a movie is made by a [bold]video[/bold] stream plus an [bold]audio[/bold] stream.
    The operation of separating AUDIO and VIDEO is called [bold]demultiplexing[/bold]. Joining them in a fill movie is called [bold]multiplexing[/bold].

    [bold]If your encoder only creates full movies (MPG), you'll just have to de-multplex its output (MPG = MPV+MPA or M2V+MP2) or something else, depending upon which audio it puts in the DVD MPG[/bold].

    Creating the video stream is NOT the first thing you need to do. First, you need to determine which kind of audio your DVD will have, since the video bitrate (that is, how big the video stream can be), depends on the audio bitrate.

    DVD needs 48 kHz audio, and accept:
    - [bold]uncompressed audio [WAV] [/bold](about 1500 kbps);
    - [bold]MPEG audio [MP2] [/bold](various bitrates; let's say the standard 224 kbps);
    - [bold]Dolby Surround audio [AC3] [/bold], 1+1 channels (various bitrates; let's say the standard 192 kbps) or 5+1 channels (384 kbps or 448 kbps are the most common ones).

    Since the uncompressed WAV format is too big (10.1 MB x length, in minutes) we'll use AC3 or MP2.
    More, unless your AVI already has an 5+1 AC3 audio, you won't be able to have an AVI with 5+1 audio (you'll start from a 1+1 MP3 audio, generally 128 kbps). Let's say 'garbage in = garbage out'.
    We'll use 192 kbps as 'standard bitrate' because we want to be sure to avoid lowering the sound quality, and since we start from a low-size AVI, having a video which has the maximum possible size isn't so important. 192 kbps is called 'optimal' and even if your input movie were a MPG with MP2 224 kbps, MP3 is a better compression that MP2.

    [bold] To create the audio stream for your DVD movie [/bold] let's open it with VirtualDub. Do File___File information.

    - If the movie was an AVI with MP3 audio (standard stereo, but usually compressed MP3 CBR instead of MP3 VBR), VirtualDub will show, under the 'audio stream' box, 'Compression': [bold]Fraunhofer MPEG Layer-3 Codec[/bold], and under audio stream's 'Data rate' its bitrate (more likely 128 kbps, maybe different).
    - If the movie was a MPEG with MP2 audio (standard stereo), VirtualDub will show, under the 'audio stream' box 'Compression:' [bold]Fraunhofer MPEG Layer-2 Codec[/bold], and under audio stream's 'Data rate' its bitrate (more likely 224 kbps, maybe different).
    - If the movie was an AVI with AC3 audio, the 'audio stream' box 'Compression' box will contain 'unknown' but its bitrate (more likely, 384 kbps) will be contained in the audio stream's 'Data rate' box.

    If your movie is an AVI with AC3 sound, open it with VirtualDubMod and do 'Stream____Stream list__Demux', calling it audio.ac3.
    If the movie is a MPEG, or is an AVI with MP3 sound, open it with VirtualDub. Set Audio__Full Processing Mode and do File____Save WAV. In few minutes you'll have a WAV audio stream.
    [bold] Unless your AVI already had AC3 sound [/bold] run FFMPEG GUI.
    Load that WAV as 'audio source'. Choose AC3 as 'audio format'. Bitrate = 192. Sampling rate = 48000 (Hertz). Channels = 2 (you wont be able to increase it).
    Choose the 'audio output' name ad position, then press [bold][Convert][/bold].

    Now let's create the DVD video (M2V). Run DVTool (v0.53 is free); put the movie's length (in minutes) and the audio's bitrate (192 kbps, unless your AVI already had a 384 or 448 kbps audio).
    DVTool's output will be the 'ideal' M2V video's bitrate.

    I hope ou already have an movie's encoder (AVI --> DVD). If not, choose amongthe ones explained in http://www.afterdawn.com/guides/, or choose one anyway.
    Now let's open your encoder, and load your input movie. Select, if optional, a TV format which fits your system. Insert, as 'average bitrate' the DVTool's output.

    If you can, choose multi-pass encoding, which is slower, but produce a better quality than constant bitrate encoding.
    Set your encoder then go to sleep (multi-pass encoding is very slow).

    When you wake up, your have an approx 4 GB M2V file.

    Open your authoring application, load the video, the audio (optional: the chapters) and select a destination directory
    Run the authoring application (if you use IFOEdit, read the 1st part).
    If you made all well, you'll have the DVDs BUPs,IFOs, the movie's VOB set which will be about 4489 MB (1 DVD5).

    Burn that set with Nero (choosing [DVD] in the wizard's top), and 'DVD video' in the DVD wizard) and burn (low speed 'fatigues' less your DVD player).

    What do you think about this method? I accept suggestions.

     
    Last edited: Jun 22, 2006
  3. AlanHK

    AlanHK Member

    Joined:
    May 2, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    11
    I've found GUIforDVDAuthor, http://www.videohelp.com/~gfd/, excellent for this; freeware.

    I like it because it makes it very simple to do a compilation DVD (eg, 10 TV episodes). When you select the video file it gives you options to create chapters, either at fixed intervals (eg, 5 minutes) or a fixed number (eg, 10 chapters), or manually. I usually select 10 chapters and maybe add one to jump to the end of the opening titles.

    I don't want to get too creative with menus, after I'd spent a while changing the default colours and fonts I had a scheme I liked so now I can just select the files and compile it in a few minutes with a simple menu (of course, then it churns away muxing the files and then making the vobs, etc). I don't bother with background images, though you can import those if you want, white text on blue works for me.

    As for extracting the sound from an AVI, I've used BeSweet, the Wizard interface, it can pull the sound directly from an AVI and output MP2 or AC3.
     
    Last edited: Jul 5, 2006
  4. aldaco12

    aldaco12 Active member

    Joined:
    Nov 6, 2002
    Messages:
    2,544
    Likes Received:
    0
    Trophy Points:
    66
    FFMPEG GUI leaves you the complete control to the sampling rate; oversampling (often AVI are 44.1 kHz, DVD are 48 kHz) on BeSweet is so hard that I nver learned it.
    BTW, nice suggestion. I'll look at it.
     

Share This Page