Log in

View Full Version : PAL->NTSC, plus general questions about DVD2SVCD


BizUser
1st January 2003, 01:22
I'd like to thank everyone in this forum and on this site for the amazing array of software, guides, tips, help, etc. And I'd like to say I fully endorse and appreciate the concept of the 5 day waiting period before posting - great idea! I've now burned a good number of successful VCDs and S-VCDs from DVDs and I'm hooked.

My main goal is to create a VCD or SVCD (either is fine for now) from an original PAL DVD, but convert to NTSC along the way. I've searched and read, and basically got it to work. In the official Q&A, I found the tip (Q67), quick and dirty method 1, to add two lines to the avisynth script - "bilinearresize (480,480)", and "convertfps(29.97)". And since my source was interlaced (the PAL DVD is of a TV show), I also selected the "de-interlace: smartdeinterlace" setting elsewhere in the prog. This worked surprisingly well, right off the bat (hooray, and thanks for all the guides that got me there!). I also tried the second 'quick and dirty' solution which was "bilinearresize(480,480)", "convertfps(29.97*2)", "assumeframebased()", "separatefields()", "selectevery(4,0,3)", "weave()" - since my source was interlaced, but this did not work for some reason.

So to my question(s) on this topic -

The first line recommended above is "bilinearresize(480,480)". But the last line in the program-generated avisynth script file is already "bicubicresize(480,576,...)" (for a PAL SVCD) - so could I not simply edit this existing bicubicresize statement and change the '576' to '480' - that is, simply do a "bicubicresize(480,480,...)" once and skip the second resize? Sounds logical, but this is a pretty complicated process so I'd like to get some input.

Ideally, I would like to try the 'elegant' method given in the same Q&A, but don't know how to "Stop DVD2SVCD .. <correct audio> ... restart DVD2SVCD from muxing and cutting". I'm familiar with the restart capability from a crash, but I have not found a way to stop/start the process manually. Do I simply 'close' DVD2SVCD (since the launched, background programs are independent and wont be killed mid-stream anyway) and then rerun it after fixing audio, using recover mode? This is what I infer from several posts so just confirming.

Along the same lines, I've pored through the logs of the DVD2SVCD process, and figured out pretty much what is being done behind the scenes, and pretty much managed to run each phase manually (largely to gain insight!). I have not quite figured out yet what program is extracting the AC3 audio stream from the VOB files. Is this DVD2AVI? The log shows the DVD2AVI command line for the video extraction, but in the log for the audio extraction, I see only that "audio extraction finished", with no corresponding logged command line (I wanted to try doing this step manually).

Also, I can't figure out what program is generating the XML for the VCD Image build. I am currently manually editing the XML and re-generating the cue/bin files after DVD2SVCD completes to fix/add chapter links when merging two DVDs together (a la Q41 in the main Q&A). It would be great to use a program to do this. VCDXGEN seems to be a program for this but I don't see DVD2SVCD launching it.

As an experiment, I bypassed the whole DVD2SVCD process (except VOB rip), created a DVD2AVI project, used DVD2AVI to extract the audio as a .wav file (very large!), then loaded the (PAL, 25fps) project in TMPEGenc along with the audio just extracted, and simply had TMPEGEnc create a VCD-compatible output using a setting of NTSC, 29.97 fps - and got a decent result! I was expecting audio synch problems but didn't get any (several posters complain of synch problems with PAL->NTSC) ... So my question is - if TMPEGEnc can convert a 25fps source to 29.97, and resize it to 480x480, what's the reason for having avisynth do this in the frameserver stage? (as suggested in Q67 of the Q&A guide, mentioned above)? Is it just that DVD2SVCD does not have that setting in it's GUI for TMPEGEnc (I realize that DVD2SVCD supports CCE as well as TMPEGEnc, so if you can 'do it once'/'describe it once' in the process (Avisynth), why bother to do it later when you'd have to describe two methods - CCE and TMPEGEnc), or is there something inherently better about doing it in avisynth?

I note also that in the 'elegant' solution mentioned above, we are told to 'correct the time length of the audio file using WLA'. I found and downloaded WLA (Wave Length Adjuster), but ... I'm not clear on what adjustments to make. Is there a FAQ on how to figure this? In my searches on the web, I found a tool AC3Machine, which is just a GUI for BeSweet (used by DVD2SVCD). One of the options it has is to "Change frame rate from ... to ..." - this sounds like a good way to adjust the AC3 stream if any, does it not?

Overall, I have immersed myself in the process, and had good results. What I'm hungry for, and can't seem to find, is a conceptual overview of what the various steps are, and an explanation of 'why' certain steps are performed. For example, I understand how DVD2SVCD uses avisynth, which in turn uses DVD2AVI, to 'frame serve' the VOB data to TMPEGEnc. The avisynth script is performing the resize to SVCD (to 480x480). But TMPEGEnc can do that same resize; why do it in avisynth (I'm sure there's good reason and don't question it - just curious!). Also, DVD2SVCD splits out the audio stream as an AC3 file, processes it using BeSweet, which then gets multiplexed back to the video stream by bbMPEG (my understanding to date!). Presumably done for higher quality, and/or to work around/prevent problems? I guess what I'm looking for is the 'why' of what is done. Is there a place to find that? Obviously, as I experiment more and more, I lean more and more and gain that insight. Searching and Reading through forums is helping and maybe that's the only way. My impression so far is that there are hundreds of programs/tools/plugins, and each typically does several steps of the process, but none does it perfectly, so you've glued together a whole process using only the best features of each component tool. Running each sub-tool independently (using the dvd2svcd log as a guide) is my best source of knowledge so far. I've read both the newbie and advanced guides, but they simply explain settings, not 'why' you may want to use them, or why one tool vs. another.

I've decided now that I need to buy a DVD burner since I've 'proven the concept' with SVCDs. I'm hoping to make use of the concepts I've learned (and will continue to learn) with SVCDs. That's why, even though I got everything to work, I don't want to stop 'understanding' what is going on.

Thanks everyone for your time and support! Sorry for the long post!

BizUser
1st January 2003, 19:29
Just one question about your extremely helpful and thoughtful response. Regarding audio conversion. The advice was this:

actually, it is theoretically possible to use the "elegant" solution without the need to stop D2S in the midle process. To do this, create in the BeSweet folder a file called pal2ntsc.bat that contains the following line:

code:--------------
besweet %* -ota( -r 25000 23976 )
-------------------



Question is ... why is the second argument 23976 and not 29976 ? In other words - I'm converting from PAL (25 fps) to NTSC (29.976), so shouldn't this second value be 29xxx not 23xxx, since I converted the video stream from 25 to 29xxx?

I understand that MPEG-2 can store information at 24 fps and use flags for playback control (applicable to movies). But if that's the reason here, then shouldn't I also be converting my video stream to 23.976, not 29.976? In other words - why not always convert PAL->NTSC by going from 25 to 24, since it's 'closer' to the original PAL rate, then rely on the output device (presumably the DVD player) to convert from 24 to 29.976? Is it because VCD does not support this (Being MPEG-1, not 2)? And/or, does the SVCD standard not support this, even though it's based on MPEG-2?

I read the very helpful guide 35mm Film to NTSC Video Conversion (http://www.doom9.org/index.html?/ac3tomp2.htm) and this one 100fps (http://www.100fps.com/) but it didn't help me answer this (I'm probably not seeing the wood for the trees at this point!).

Thanks again!

EDIT: I think I figured it out ... the 'elegant' solution was to use, in the avisynth script, ASSUMEFPS, not convertfps. Assumefps simply changes the clock info on the frames, causing the same frames to play in different time. Thus, the audio will need the same adjustment. When I use the 'dirty' method (convertfps), the overall time is not changed.

Assuming this is correct, one question remains in my poor brain on this ... why do we use 'assumefps' of 23xxx and not 29xxx, since the output is destined for NTSC at 29xxx, and we are not dealing with a movie or setting movie-like flags?

BizUser
5th January 2003, 03:05
Success! I was able to create an NTSC SVCD (29.976 fps) from a 25 fps PAL DVD (VOBs ripped already). In avisynth script, added 'smartdeinterlace' (my source is interlaced PAL as it is from a TV show), and then 'assumefps 23.976' . Encode to MPEG 2 in TMPG; run 'pulldown' to create a pulled-down version of the video file. Run BeSweet and convert from 25000->23976. Run bbMPEG to merge/multiplex the two together. Worked like a charm. Figured out how to do each of these steps manually (helpful when experimenting!).

Problem solved along the way - I WAS already doing an audio down-convert from 48->44.1 in BeSweet, and when I added frame rate conversion, it yielded an error (error 46, I believe) - unsupported combo of switches; searched forums, found answer - just don't down-convert since all DVD players can handle the non-compliant 48000 audio. As an experiment, I re-ran BeSweet a second time just to down-convert, and it worked also.

Observation - original show (PAL 25 fps) ran 58:22; mp2 elemental stream (which is now 23.976 fps) ran 60:51 (windows media player). Thus, my show runs 4% longer now, which is to be expected. There were a total of 87,550 frames.

Question - My understanding is that running 'pulldown' does nothing other than set flags in the video datastream to tell the playback device to repeat frames. This is somewhat confirmed by observing the before and after files - same physical size, thus no added frames. When I play the pulled down video stream in Windows Media Player, it shows the exact same playing time - 60:51. So I guess that doing pulldown simply gives the playback device an extra 6 frames every second so it's getting them 29.976 times a second, even though they are fundamentally 'supplied' by the data stream 23.976 times a second. And bbMPEG knows how to multiplex the audio to the video whether it's pulled down or not - presumably it hardly cares since the same number of actual frames exist in pulled down and non-pulled down streams. And presumably this whole process (converting PAL to NTSC this way) 'works' because PAL's 25 is 'close' to NTSC FILM's 23.976...

OK - got all that sorted out; then I went to make a VCD of the same source. What I noticed along the way was that it seems perfectly OK to have a VCD 'created' at 23.976 fps - no need to pulldown or anything. In fact, one of TMPG's templates is for VCD NTSC Film, 23.976 (whereas it's SVCD NTSC Film template shows 29.976). So I guess all this means is that the VCD spec 'allows' for 23.976 (the VCD player knows it has to do something to output this on an NTSC TV), while the SVCD spec 'requires' 29.976 ? This got me real confused for a while! I went ahead and Encoded in TMPG at 23.976, muxed this video with my audio stream (also converted to 23.976) and the resultant VCD seems to work great!

I actually spent 18 hours on this Friday, and got real messed up because I was leaving VBV buffer at the default size of 0 (automatic) in TMPG, and I was getting underflow errors in bbMPEG. I finally figured out that if I forced VBV buffer size to 40 kb (as set by the project file used by DVD2SVCD), the underflow errors disappeared! I think I saw a note about that in some guide or forum post somewhere, but I could not find it on subsequent searches. The perils of not using DVD2SVCD to control the process!

Is there any way, when using DVD2SVCD, to keep the bbMPEG log? dvd2svcd log only contains the command line.

So in summary, I can do a 'quick and dirty' PAL->NTSC by using 'smartdeinterlace' and 'convertfps' in avisyth script; or I can be more elegant and use 'smartdeinterlace' and 'assumefps' in avisynth script, convert audio framerate, then pulldown video (for SVCD), or skip pulldown for VCD. The 'quick and dirty' can be run from DVD2SVCD without much hassle; the more elegant method has to be done manually due to bbMPEG needing to be fed the pulled down video (which I will play with).

BizUser
12th January 2003, 21:38
Finally got something working... PAL interlaced TV DVD ->NTSC TV SVCD conv. using assumefps(23.976), resampled audio, pulled-down video. Almost fully automated with DVD2SVCD - two minor issues/questions remain ...

First, as you suggest above, created a bat file PAL2NTSC.bat in the BeSweet directory that contains


rem append frame rate command to existing BeSweet command line
besweet %* -ota( -r 25000 23976 )


Then point to this bat file in dvd2svcd as the BeSweet cmd line. As long as you don't resample down from 48k to 44k elsewhere, you are fine.

Then, check the 'edit avisynth' check box, and when the avisynth edit box pops up, change bicubicresize(480x576...) to bicubicresize(480, 480, ...) and add a line 'assumefps(23.976)'. <QUESTION: Can this added line be automated?>

Create a bat file bbMPEGpulldown.bat in the bbMPEG directory with the following commands, and point to this bat file in the bbMPEG command line: <NOTE: I inserted hard returns in the code below to make it readable, but you need to ensure final version has all relevent parameters on one line>

rem pulldown the encoded video:
F:\DVD2SVCD\pulldown\pulldown.exe
F:\DVD2SVCD\temp\dvd2test\Encoded_Video_TMPGEnc_PAL.mpv
F:\DVD2SVCD\temp\dvd2test\pulldowned_video.mpv

Rem - rename source to a saved name (in case we need it later):
rename F:\DVD2SVCD\temp\dvd2test\Encoded_Video_TMPGEnc_PAL.mpv
non-pulldowned_video.mpv

Rem - rename pulled down to the original name so bbMPEG can process it:
rename F:\DVD2SVCD\temp\dvd2test\pulldowned_video.mpv
Encoded_Video_TMPGEnc_PAL.mpv

rem multiplex using bbMPEG. bbMPEG will process the original
rem filename based on ini file settings created by dvd2svcd:

"F:\DVD2SVCD\bbMPEG\RunbbMPEG.exe"
"F:\DVD2SVCD\temp\dvd2test\bbMPEG_Muxed_File.mpg"


This works great but ... I could not find a way to determine the current default output path of dvd2svcd, so I have to hard-code the paths for each run (in the above bat file, the references to "F:\...dvd2test"). I tried putting the bat file in the same directory as my data files, but it complains about missing dlls, etc - so it needs to be in the bbMPEG directory. Also, The output file name from the TMPG process may vary; it seems pretty consistent as 'encoded_video_TMPGEnc_PAL.mpv', but it could change. I put 'pause' statements in my bat file so I can verify each name before it executes; no longer automated, but these steps only take minutes anyway.