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

jerky DVD playback after converting .avi file with CCE

Discussion in 'DVD±R for advanced users' started by dandean, May 6, 2003.

  1. dandean

    dandean Guest

    The playback issue: I get jerky play back when playing dvds I converted from avi to mpeg2 using CCE SP.

    I used virtualdub to extract audio as uncompressed wav file then encod to an ac3 file using ac3machine via Besweet exe.

    With the video stream I am using an avysynth script:

    avisource("moviename.avi")
    BicubicResize(720,326)
    AddBorders(0,104,0,125)
    ResampleAudio(44100)

    with CCE to adjust vertical and horizontal parameters to suit PAL. I believe my avi in dvd form was originally NSTC, and I need PAL.

    I do not know the parameters of the orginal DVD as this .avi file is a download. So I cant check the parameters like progressive frames, zig zag etc - all the 'video settings' on CCE SP.

    I then author with ifoedit. The resulting dvd looks and sounds perfect but is slightly jerky. Its so frustrating because it almosts there, plays perfectly on my UK PS2 its just the jerk!!

    When I check the subsequent m2v file with Bitrate Viewer - I get 25 fps which is correct for pal so i dont understand why it is jerking.

    I use all the settings a la 'doom9.org - avi DVD-R conversion guide using CCE.'

    I hope theres someone out there who can help.

    Please


     
    Last edited by a moderator: May 7, 2003
  2. antifan

    antifan Member

    Joined:
    May 7, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    11
    Converting from NTSC to PAL involves more than changing the resolution. There are also the issues of color space & framerate (the latter is probably what is causing your problem).

    Your AVI file probably plays back at 29.97fps, whereas PAL is 25fps. As far as I know, there are not many options for converting between the two that will leave you with a quality picture, other than expensive hardware solutions.

    If you post the text of your Avisynth script, that will help.
     
  3. antifan

    antifan Member

    Joined:
    May 7, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    11
    I don't understand the logic of your script. You're ending up with a vertical resolution of 555, why is that? From where did you pull those AddBorders arguments? What was the original frame size of the avi file that you downloaded?

    If you wound up with PAL, then I would think that you probably started with PAL. To the best of my knowledge, CCE always gives as output a file with the same framerate as the one that was input to it, and I don't see anything in your script that would adjust the framerate, so I'm figuring that your source is PAL.

    As for having the original DVD, you shouldn't really need that information; you only need the information for the DiVX file, and maybe the movie's original aspect ratio, which you can probably find on iMDb or at Amazon or something.

    I don't know, though. It may be that you can adjust frame rate in CCE; but if that were the case, I would suggest that you first IVTC it, and then figure out how many frames you'll need to add in order to do the FILM->PAL conversion, which is probably somewhere around 1 in 25, or maybe 3 in 74 or something.

    But first you'll need to get the frame size right. Also, you'll need to make sure that you have 48kHz audio (incidentally, there's no need for the ResampleAudio line when using Avisynth with recent versions of CCE).
     
  4. dandean

    dandean Guest

    Thanks again for the reply, first off here's part of the guide that should explain vert and horizonatal parameters:

    'CCE is a little underfeatured for this kind of processing so you're required to have some knowledge of aspect ratios. Once you are familiar with that you should have no problem following the little math required in this step. Anyway, first we have to find out a little more about our source AVI. Start GSpot again and load the AVI.

    As you should know by having read the aspect ratio article movies mostly have 3 aspect ratios: 1:1.33, 1:1.85 and 1:2.35 (GSpot inverses the two numbers in its display). As you can see on the left this particular movie has an aspect ratio of 1:2.35 (the 2.353 is much closer to 2.35 than 1.85 and 1.33).


    First of all, since our AVIs have a DAR of 1:1 it makes not much sense encoding at 16:9 so we're going 4:3 instead. First let's deal with the NTSC case. DVD resolution for NTSC demands 720x480. With a 4:3 DAR the actual picture you'll be seeing is 480 x 4 / 3 = 640 so we have to ensure that at the resolution of 640x480 our picture doesn't look stretched. As 640 / 2.35 = 272 an 1:2.35 movie has to fill up 272 vertical lines to look correct. So, you resize such a movie to 720x272 and add 480 - 272 / 2 = 104 lines of black on each side. For an 1:1.85 picture you'd resize to 720x352 and add 480 - 352 / 2 = 64 black lines on each side and last but not least the 1:1.33 case where you resize to 720x480 and don't add any black lines.

    Now for PAL it's a tad bit more complicated as for a 4:3 PAL displays the actual resolution during playback is 768x576 (576 x 4 / 3 = 768). So, we have to make sure that the movie looks okay at that resolution. To spare you the calculations for an 1:2.35 movie this means that the vertical part of the picture has to take up 326 pixels, for an 1:1.85 movie the vertical part has to be 416 pixels, and for a 1:1.33 movie the vertical part has to take up the whole 576 horizontal lines. In practical terms this means that you resize an 1:2.35 movie to 720x326 and add (576 - 326 / 2 = 125 black lines on top and bottom of the picture), for an 1:1.85 movie you resize to 720x416 and add 80 pixels on each side, and for an 1:1.33 movie you resize to 720x576 and add 0 pixels.

    If these calculations are a bit confusing try to draw a picture of the TV screen and how the movie will look on it and you'll get the point.

    Now let's get to more simpler stuff. Here's the basic AviSynth script you'll be using:

    LoadPlugin("c:\windows\system32\vobsub.dll")
    avisource("moviename.avi")
    BicubicResize(720,272)
    AddBorders(0,104,0,104)
    vobsub("subname")
    ResampleAudio(44100)

    The 5th line loads the vobsub subtitles called subname.sub and subname.idx. If you have textual sub replace the first line with:

    LoadPlugin("c:\program files\GordianKnot\VirtualDub\plugins\Textsub.vdf")

    and the 5th one with:

    TextSub("badcompany.srt")

    Obviously, if you have no subtitles you can leave out the first two lines. And if you want selectable subs you can use SubRip to convert VobSub subs to Maestro or Scenarist format. In case you have textual subs you can use MaestroSBT to convert them to Maestro or Scenarist format. Make sure you read the readme file and you shouldn't have any problems.

    The 2nd line loads the movie (moviename.avi). The 3rd line resizes the movie. Replace the 2nd number with the appropriate number taken from the calculations above. The same applies for the 4th line which adds black borders on top and bottom of the picture. The example shown here is for an 1:2.35 movie and the output will be an NTSC DVD. The last line is to trick CCE to accept the AviSynth script even on AMD CPUs.

    You can write this AviSynth script using any text editor, preferably Notepad and make sure you save it as movie.avs and without any .txt extension.

    Now that we have the ugly part behind us start up CCE and encode as usual.'

    Ok, I hope the clarifies that path I took and why. Where am I going wrong?

    For the settings In CCE I used the same as quoted in the guide for PAL output. That's the doom9.org, guides, avi-dvd-r conversion, encode in CCE, 'encode as usual' click on this and it should bring you to the settings I used. (My hunch is that I have the wrong settings on the video-tab there's alot of options to check or uncheck and these look to be very specific. Again the exact setup I used is on the screenshot in the doom9 guide.)

    The above exert from doom9 shows the avisynth script and answers your question as to the values I used in bicubic resize.

    I viewed the parameters of the avi file with Gspot and they are as follows:

    VIDEO FORMAT
    codec: xvid
    aspect: 640x272 (2:353: 1) this value is inversed in Gspot.
    Bitrate: 1010 kb/s
    Framerate: 23.976 FPS (CCE must convert this to 25 FPS as thats the reading I get on the subsequent m2v file.)

    AUDIO FORMAT
    MPeg-1 layer 3
    Bitrate: 144 kb/s (72/ch x 2 ch) VBR Lame 3.92
    Fs: 48000Hz

    Ok, Hope that's provided you with enough info. Phew!

    Do you think the method I'm using is ineffecient or open to error. Or am I nmessing up somwehere?

    If so, could you suggest an alternative or a fix. Also is it really necessary for me to encode the audio twice, from avi-WAV-ac3?
    Do you think the audio ripping facility in CCE should suit me needs?

    Antifan, thanks once again for all your help, and taking the time to read these rather long posts. It's greatly appreciated.

    dduk
     
  5. antifan

    antifan Member

    Joined:
    May 7, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    11
    Framerate: 23.976 FPS (CCE must convert this to 25 FPS as thats the reading I get on the subsequent m2v file.)

    My first thought is that you're going from FILM to PAL, but you're not adjusting the framerate of the audio. It seems that if the audio is running too slowly, that then the mux will make the vid jumpy as it tries to sync the video to it.

    Try using this: http://www.geocities.com/xesdeeni2001/WSOLA.zip before you resample your audio to 48kHz, from command line, like this:

    d:\encode\wsloa d:\encode\audio\source\NTSC.wav d:\encode\audio\output\PAL.wav 0.95904

    //edit: the above should all be on one line, if it doesn't appear that way to you in your browser.

    The first is the path to the folder where you've got WSLOA.exe, the second is your source wav, ripped from avi, and the third is the output wav, followed by the conversion factor. Of course, substitute your own values as far as drive letter and path.

    I usually do resampling to or from 48kHz in Sound Forge.

    I really don't know much about PAL, to tell you the truth, nor about converting between it and NTSC & vice versa. But you might give that a try.

    also, you might take a look at this page:
    http://www.avisynth.org/index.php?page=FPS

    none of your last post explains this line in your first post (or else there's just something i'm not getting here):

    AddBorders(0,104,0,125)

     
    Last edited: May 8, 2003
  6. dandean

    dandean Guest

    Thanks for your reply, I am lookind in to all the things you suggested, here's the part from the guide that explains my border values.

    'In practical terms this means that you resize an 1:2.35 movie to 720x326 and add (576 - 326 / 2 = 125 black lines on top and bottom of the picture), for an 1:1.85 movie you resize to 720x416 and add 80 pixels on each side, and for an 1:1.33 movie you resize to 720x576 and add 0 pixels.
     

Share This Page