Log in

View Full Version : Smaller length .mpv file


myriaxis
5th June 2004, 03:55
Hello all,

I'm using CCE to encode an MPEG-2 file from an AVI file. The resulting file is 5 seconds shorter than the AVI file. This leads to an audio sync problem when muxing with DVD-Lab. The AVI file has an fps of 23.976 (from Gspot). I suppose the resulting MPV has the same fps since I didn't play with it. What could explain the shrinking of the movie?

I followed the Doom9 conversion guide using CCE.

Thanks

RB
7th June 2004, 07:33
Looks like you forgot to run pulldown against the encoded MPEG2 file to get it to 29.97 fps for NTSC. Or is your target PAL?

myriaxis
7th June 2004, 16:14
Thanks for the reply.

I pulldown the encoded MPEG2 to get 29.97 NTSC.

Here is what I did:

- Used VirtualDub to extract MP3 from AVI to WAV (selected Audio full process).
- Used AC3Machine to create AC3 from extracted WAV (bitrate 192, delay -101, surround).
- Used CCE SP 2.5 to encode AVI at CBR 4250 (I use CBR to encode AVIs separately since AVIs will be separate titles on final DVD).
- Used pulldown to encode MPEG2 to NTSC 29.97.
- Import files into DVD-Lab.

The result is:
MPV file shows 1h30m43s
AC3 file shows 1h30m48s

There is an audio/video sync problem where the audio is heard before the video. I used CoolEdit Pro to look at the audio file and using a SMPTE 29.97 fps display time format, I found that the audio file is missing about 1 sec and it corresponds approximately to the video lag. I could tweak the WAV to add just enough silence at the beginning. This would probably do the trick, but it does not explain why the audio and video do not match.

I tried the same procedure with another AVI and the results in DVD-Lab were:
MPV file shows 0h45m24s
AC3 file shows 0h45m27s

I checked the audio file with CoolEdit Pro and, with the SMPTE 29.97 fps display time format, the audio file is the same length as the video. Hence, when muxed in DVD-Lab, audio and video are in sync.

Can you shed some light on this audio/video sync issue?

RB
10th June 2004, 11:58
Sorry, I actually never converted AVI stuff to MPEG2, so I have no experience with this. Maybe you could try DVD2SVCD in AVI2DVD mode or ask in another forum like VirtualDub.

Boulder
11th June 2004, 09:50
Is the original audio track VBR?

myriaxis
11th June 2004, 14:09
As a matter of fact, it is. The audio is an MP3 at 159 kb/s VBR.

Boulder
11th June 2004, 14:19
If you know your way around Avisynth scripts, you could try the following:

AVISource("path\clip.avi")
EnsureVBRMP3Sync()
Trim(0,0)

Open in VirtualDub and extract the audio track, it should already be in uncompressed WAV format. Process this file to AC3 and see if the length is still the same.

If you use Avisynth when you process the video, please post the script. I'm not familiar with the particular guide so I don't know which method is used..frameserving via Avisynth is the most common and reliable as well.

myriaxis
11th June 2004, 15:01
Thank you Boulder,

I'm a bit new to Avisynth, although that's what I use to process the video stream.

If I understand your suggestion correctly, I have to preprocess the clip.avi to ensure VBRMP3Sync, then I extract audio as usual and encode to AC3. Is this what you meant?

The script I used to encode video with CCE 2.5 is:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")
AVISource("path\clip.avi")
BicubicResize(656,448,0,0.6,0,0,512,384)
AddBorders(32,16,32,16)
ConvertToYUY2()

I load this in CCE 2.5 and use a template I made. Here are the template settings:

MPEG-2
CBR 4250
Add sequence end code
Progressive frames
Linear quantizer scale
Zigzag scanning order
DVD compliant
Luminance level: 16 to 235
Intra DC precision: auto
Aspect ratio: DAR 4:3
Timecode 00:00:00:00
GOP sequence: IBBPBBPBBPBB M=3 N/M=4
GOP header: every 1 x N frames
SEQ header: every 1 GOP
Image quality priority: 5

Also, I'm having some problems with the final results. I'm using DVD-Lab to create a DVD with the converted avi clips. When I play the DVD, the video gets jumpy. It's a bit hard to explain, but it seems that when I play the DVD in a standalone DVD player, the video freezes for a few milliseconds and then jumps to the next frame. It's more evident during scene change. I get the same results when playing the DVD files from the hard drive. However, when I play the pulldown .MPV file used to create the DVD, I don't get this jumpy behavior. The DVD project is NTSC 720x480 29.97.

Are you able to provide an explanation?

Boulder
11th June 2004, 16:50
Originally posted by myriaxis

If I understand your suggestion correctly, I have to preprocess the clip.avi to ensure VBRMP3Sync, then I extract audio as usual and encode to AC3. Is this what you meant?


Exactly. For video processing, use the script you've got, it looks ok to me although the 32-pixel borders on left and right make me shiver :D. You'll probably see them on your TV set so.


Also, I'm having some problems with the final results. I'm using DVD-Lab to create a DVD with the converted avi clips. When I play the DVD, the video gets jumpy. It's a bit hard to explain, but it seems that when I play the DVD in a standalone DVD player, the video freezes for a few milliseconds and then jumps to the next frame. It's more evident during scene change. I get the same results when playing the DVD files from the hard drive. However, when I play the pulldown .MPV file used to create the DVD, I don't get this jumpy behavior. The DVD project is NTSC 720x480 29.97.

Are you able to provide an explanation?

Based on what I know about NTSC stuff - being a PAL user myself - that's simply because there is no 23.976 fps MPEG-2 stuff when it comes to standalone players, they want stuff with a 3:2 pulldown and then display it at 29.97 fps. I can't give you any specific explanations since I don't understand much of this just because I don't have to deal with such material (thank God). Using the search will most likely give you plenty to read on the matter.

EDIT: Use non-linear quantization scale for MPEG-2!

myriaxis
11th June 2004, 17:20
Thanks again,

I did 3:2 pulldown on the video stream. DVD-Lab wouldn't allow me to use the encode MPEG-2 stream at 23.976. I understand that you're not a specialist with NTSC stuff (good for you), but what I can't understand is that when I play the 3:2 pulldown file, I don't get this jumpy behavior. It's only when playing the DVD files, either from the hard drive (because I ask DVD-Lab to create files on the hard drive before burning) or from the burned DVD. I think this problem might be also seen on PAL.

Is there a setup that I'm missing that can cause this when muxing the DVD?

Probably a newbie question, when you say "use non-linear quantization scale", it probably means to uncheck the linear quantization scale option in the CCE 2.5 template?

Boulder
11th June 2004, 17:58
Originally posted by myriaxis
Thanks again,

I did 3:2 pulldown on the video stream. DVD-Lab wouldn't allow me to use the encode MPEG-2 stream at 23.976. I understand that you're not a specialist with NTSC stuff (good for you), but what I can't understand is that when I play the 3:2 pulldown file, I don't get this jumpy behavior. It's only when playing the DVD files, either from the hard drive (because I ask DVD-Lab to create files on the hard drive before burning) or from the burned DVD. I think this problem might be also seen on PAL.



Nope, PAL doesn't have any pulldown, it's just 25 fps no matter what:)

The "pulldown" clip works smoothly because that's the way it should be, the 23.976 fps MPEG-2 material needs the pulldown to play properly (it actually plays at 29.97 fps). MPEG-1 however plays 23.976 fps and no pulldown is required (nor supported).


Probably a newbie question, when you say "use non-linear quantization scale", it probably means to uncheck the linear quantization scale option in the CCE 2.5 template?

Yes, that's correct.

myriaxis
11th June 2004, 18:05
Another, most probably newbie, question. What would be the best way to preprocess the avi clip? I've only used Avisynth with CCE. Can Avisynth be used on its own? Or should I use Avisynth with something else?

Thanks for your patience.

Boulder
11th June 2004, 20:00
Avisynth can't encode so you'll need CCE or some other program to do that for you. Avisynth is for preprocessing and frameserving purposes, which makes it a very flexible tool since you can use the same script in many different programs.

I suggest you check the Avisynth usage forum, there's a lot of useful threads to read;)