Log in

View Full Version : PAL to NTSC and NTSC to PAL


Pages : 1 [2] 3 4 5

Xesdeeni
10th April 2003, 14:46
brw

I think you can play flag games with the DVD stream to get 25 fps to play at 29.97 fps, but I'm not sure all DVD players can deal with this correctly. My biggest question would be about progressive DVD players that use the flags to figure out how to deinterlace (or not to interlace). I would think that would seriously confuse them.

AdambI want to convert PAL DV to NTSC for DVD.
Xesdeeni, which of your scripts should I use? Is there a good guide to explain how to use the scripts?I'm afraid my Standards Conversion Page (http://www.geocities.com/xesdeeni2001/StandardsConversion) doesn't have this combination yet. Since I don't have a PAL DV and you do...do you want to volunteer to help? :)

Try this (you'll need the beta versions of BeSweet and BeSweetGUI):

1. Open BeSweetGUI.
2. Select "AC3" from the yellow pulldown in the right middle of the interface.
3. Click the "Input" folder icon to open the input dialog box.
4. Select the ".avi" entry in the pulldown in the upper right of the dialog, and then locate your input AVI. The full path should appear in the "VOB/AC3/LST" section at the bottom of the dialog.
5. Click the "WAV/MPx" button in the section at the bottom of the dialog, and then select the destination and name of the AC3 file at the top of the dialog.
6. Click "OK" at the bottom to close the dialog.
7. Click the "AC3 & OGG" button in the right middle of the interface.
8. Check the "Bitrate" box and choose your desired bitrate.
9. Click the "AVI to AC3" button in the lower right to convert the audio from the AVI file to an AC3 file.
10. Create and open a new text file with an AVS extension (to be used with AVISynth), using your favorite text editor (like Notepad).
11. Add the following lines, filling in the location and filename of the file you created above: LoadPlugin("SmoothDeinterlacer.dll")
DirectShowSource("DRIVE:\PATH\PAL.avi")
SeparateFields()
Weave()
SmoothDeinterlace(doublerate=true)
LanczosResize(720,480)
ChangeFPS(59.94) # or ConvertFPS(59.94)
SeparateFields()
SelectEvery(4,0,3)
Weave()
ConvertToRGB() 11. Save the AVS file.
12. Load the AVS file into TMPGEnc as the "Video Source."

NOTE: Cancel the Wizard dialog box which appears when you run TMPGEnc.

13. Load the "DVD (NTSC)" template into TMPGEnc.
14. Load the "unlock" template (located in the "Extra" directory).
15. Select "Video only" in the "Stream type" region.
16. Specify the location and name of the "Output file name" with an M2V extension.
17. In the "Rate control mode:" field, choose the type of encoding you want. Multi-pass variable bit rate (VBR) settings produce better quality, but take longer to encode. Choose your bit rate based on quality desired, length of video, size of AC3 above, size of other files that will be on the destinaion disc, and the size of destination medium. Do not exceed 9800 kbit/sec.
18. Choose "Motion estimate search (fast)" or "Highest quality (very slow)" in the "Motion search precision:" field on the "Video" tab of the "Setting" dialog.
19. Press "Start" to convert, and encode the video.Will this work with CCE Basic for encoding?Sure, just feed the AVISynth script to CCE instead of TMPGEnc.Just a thought, as PAL is 25fps (i) and DVD film is 24fps (p), is there not an easy way to convert the 25fps interlaced to progressive and then just slow it down by 4% (or whatever)? Would such an output work on a NTSC DVD player??Certainly, and you might think that the video would be a bit smoother. But remember that video is captured at 50 fields per second, while film is 24 frames per second. These two formats use different exposure times, so the 24 Fps frame will have more motion blur in each frame than a 50 fps capture, which makes the film seem just as smooth as the video. But when you convert from 50 fps to 25 Fps, you will be effectively throwing out half of the motion blurring. The remaining video will have a strobe effect. Then you are going to do a 3:2 pulldown on this after you've converted it to 23.976 Fps for NTSC, making the difference in duration between frames (3 vs 2 fields) much more apparent. I believe this will look worse and be more distracting than the jutter introduced by the conversion above. And the advantage of the above technique is that no processing of the audio is necessary.

But you'd need to try the conversion yourself and see what you think. I think this is similar to what my DVD player itself does when it does PAL to NTSC conversion internally (although instead of deinterlacing, it just throws away one field completely). You may find that you prefer this technique, and this hobby is nothing if it isn't about experimenting!

Xesdeeni

shoarthing
20th April 2003, 17:55
Xesdeeni - Hi - can't thank you enough for all the work you've put into this, & for the astonishing quality your technique & tools give for NTSC>PAL DVD conversion.

OK, it's slow at 2-pass VBR 5600ave; but crikey the quality is good - far better than Procoder [1.0.3.5 - haven't used the new one yet].

philippoumartin
22nd April 2003, 17:05
I'm trying to convert Gladiator PAL into NTSC to have a french 5.1 version (I does not exist in Canada)

I've been able to change the format using neoDVD : it does an acceptable job while transferring the format. However, the new file is stereo.

I try to use VOBedit and IFOedit to extract the AC3 soundtrack and the remux it with the film but I get unsynchronized (about 1 sec per 20 minutes)

I used besweet with the AC3 to try to fix the problem but it does not seem to fit.

I decided to split each VOB of the original (PAL) and extract an AC3 file for each of them. Then I convert each vob of the film to NTSC. I extract the m2v's to rebuilt all the film using "reauthor" in IFOedit. That way, I should "readjust" the sound at the end of each VOB.

On the final product, I have sound on the first vob only...??? Can somebody help me

ryangs
28th April 2003, 02:34
I tried converting a progressive-scan PAL video into an interlaced, DVD-format NTSC video, and it didn't quite work. The source is originally 25i, from British TV, but it was deinterlaced when it was made into an OGM. Using the 25i->29.97i tutorial on your site, Xesdeeni, looks fine on the computer monitor, but when I try to play it on a TV I get a really terrible strobing flickering. It's hard to describe. When I look at it closer frame by frame I can see that it's going in and out of interlacing. That is, looking at constant motion, a few frames are interlaced, then a few are solid, then interlaced, etc. It kind of weaves back and forth between interlacing and no interlacing, and I believe this is what's causing the strobing. Is there a way I can modify your 25i->29.97i script to do 25p->29.97i?

Thanks for all the help you're providing with standards conversion!

philippoumartin
28th April 2003, 16:14
Ryangs,

if you only want to convert PAL to NTSC with stereo or mono soundtracks, NEODVD is a very cheap and do a good job for a non-professionnal use.

I was able to convert the video very well. My problem is that NEODVD downgrade the AC3 5.1 soudntrack in stereo and I want to keep it

Xesdeeni
29th April 2003, 14:52
ryangs
What you describe sounds like the output fields may be reversed. If shots that don't move look good, but moving stuff seems to "shimmy" back and forth, then that's probably the issue. If you are using SelectEvery(4, 0, 3), switch to SelectEvery(4, 1, 2) or vice versa and see what you get.

Xesdeeni

scharfis_brain
29th April 2003, 15:24
for 25p->29,97i, I would slowdown 25p to 23,976p and then telecine to 29,97i. (telecine not really nessesary, because the DVD player will telecine the 23,976p Video)
This would IMO give the best result.

Xesdeeni
29th April 2003, 15:44
More info on several methods of conversion on my Standards Conversion page (http://www.geocities.com/xesdeeni2001/StandardsConversion).

Xesdeeni

ryangs
29th April 2003, 19:55
Originally posted by Xesdeeni
ryangs
What you describe sounds like the output fields may be reversed. If shots that don't move look good, but moving stuff seems to "shimmy" back and forth, then that's probably the issue. If you are using SelectEvery(4, 0, 3), switch to SelectEvery(4, 1, 2) or vice versa and see what you get.

Xesdeeni

I was using (4,1,2). Switching to (4,0,3) doesn't seem to help much. I can't really tell because both look acceptable on a computer monitor; it's once you get them on a real TV they look terrible. I wish I could check more accurately without wasting a DVD-R.

Scenes with no motion look fine; it's only motion. With both (4,1,2) and (4,0,3) I see the same problem: a few frames seem to be interlaced, then a few seem to be progressive. Here's some examples.

http://mail.chartermi.net/~ryangs/frame1.jpg
http://mail.chartermi.net/~ryangs/frame2.jpg

This is taken from a scene with constant motion. The big colored blocks (actually letters) are moving at the same speed. The first screenshot shows a frame which appears progressive. The next shot, from two or three frames later, appears to be interlaced. Since it's constant motion, shouldn't they both be interlaced? I think it's the "going in and out of interlacing" thing that's causing the flickering/strobing, and changing the numbers in SelectEvery doesn't seem to affect it. Do you have any other ideas, Xesdeeni?

One thing I thought could be the cause was SmoothDeinterlacer. It shouldn't be necessary since I'm starting with a progressive source, right? I removed it from the script and it didn't seem to affect the output, aside from making encoding go a hell of a lot faster!

Xesdeeni
29th April 2003, 23:54
I was using (4,1,2). Switching to (4,0,3) doesn't seem to help much. I can't really tell because both look acceptable on a computer monitor; it's once you get them on a real TV they look terrible. I wish I could check more accurately without wasting a DVD-R.You could try a DVD-RW, but once you've established the correct output polarity, you shouldn't have to make any more changes unless you change your MPEG encoding program (or potentially your DVD authoring program). Unfortunately you'll only be able to judge the correct polarity on the actual interlaced device. Scenes with no motion look fine; it's only motion. With both (4,1,2) and (4,0,3) I see the same problem: a few frames seem to be interlaced, then a few seem to be progressive....The first screenshot shows a frame which appears progressive. The next shot, from two or three frames later, appears to be interlaced. Since it's constant motion, shouldn't they both be interlaced?The output will not always be interlaced. Remember that we can't genuinely generate 60 new fields from the original 25 frames. You will be duplicating data from each frame into either two or three fields. Depending on whether the pairs show up on your progressive PC or not, you may see a progressive frame or an interlaced one (telecined NTSC has exactly the same effect, but when converting 25 fps, the jutter pattern is irregular, so it's more noticable).One thing I thought could be the cause was SmoothDeinterlacer. It shouldn't be necessary since I'm starting with a progressive source, right?Well, I warned you that although the conversion would be easier, depending on your source and on your eye, you might not be satisfied. From the video you describe, I'm sure you'll need to instead reverse the telecine and slow the video frames. In PAL, reversing the telecine is normally just a matter of combining pairs of fields, but sometimes you have to tweak which pair (even then odd or odd then even). Then the best bet is to slow the video down to 23.976 Fps and scale it.

Of course, you then have the pain of converting the audio. Most conversions will shift the pitch of the audio down by 4%. This might not be too bad for your use, but it's the tradeoff for avoiding the video artifacts you saw. I've tried to make WSOLA available as a replacement. It does the slow down (or speed up for the reverse direction) without changing the pitch. However, I'm still not sure whether the quality is as good as the guy who posted the algorithm says. I'm still trying to get feedback. Also, my implementation has some problems:

1. DVD2AVI's WAV outputs don't appear to be legal. WSOLA checks this and refuses to deal with these WAVs. I posted a message last week about this, but no-one has addressed it. I suspect I'm going to have to make the modification to DVD2AVI myself, and I just won't have the time, at least for the next few weeks. In the mean time, I think just loading the audio into any other sound program and re-saving it should fix the headers.

2. WSOLA is a huge memory hog. I've tried to modify it a bit, but I haven't figured out exactly how the spaghetti code works inside, so I haven't been successful in eliminating the multiple allocations of huge memory. I already eliminated one level, but I didn't realize it was like peeling an onion. Breaking the audio into sub-chunks appears to be the only solution at presents....my apologies.

All of the above is why I suggested that you instead just convert to interlaced NTSC and leave the audio alone. Yes, you will have some jutter, which may or may not be better to your eyes using ConvertFPS() instead of ChangeFPS(), but the above issues seemed to be a bigger problem in the short term. But for the video you describe, you may need to deal with converting the audio. Try ConvertFPS() first on a test section, and if you don't like it, do the slow down and audio conversion. You are welcome to try WSOLA and give me feedback on the quality, but you can also use the conversion in BeSweet (you can also do the same with AVISynth), although you'll get the pitch shift.

Xesdeeni

philippoumartin
2nd May 2003, 15:08
The link given by xesdeeni about the conversion is really good and worked perfectly for my conversion....

Great tool!!

Phil

ronnie_t
27th December 2003, 02:32
Amazing deinterlace script. This script has been the key for me to successfully transcode a NTSC-dvd to a PAL Mpeg2 stream.

I had to edit the script on several lines and had to downgrade to avisynth 2.08, but the endresult is amazingly good. I mainly followed this (http://www.geocities.com/xesdeeni2001/StandardsConversion/index.html) guide and I borrowed some lines from here (http://biphome.spray.se/gunnart/video/)

Background: I live in Europe (PAL) I bought an import dvd from the USA (NTSC) as a present to my father. Unfortunately his dvd-player doesn't support NTSC dvd's. After looking on the forum I quickly came to this de-interlace script and it helped me to feed TMPGenc a PAL non-interlaced AVI to encode. Now my father can enjoy his dvd afterall.

my script looks as follows:

LoadPlugin("SmoothDeinterlacer.dll")
AVISource("H:\New Folder\123_d2v_vfapi.avi").ConvertToYUY2()
SmoothDeinterlace(tff=true, doublerate=true)
LanczosResize(720,1152)
ConvertFPS(50)
SeparateFields()
SelectEvery(4, 1, 2)

scharfis_brain
27th December 2003, 02:43
You may want to try my automated NTSC -> PAL conversion function.

http://forum.doom9.org/showthread.php?s=&threadid=67161

It can convert your NTSC-Video with PAL-Speedup (progressive output)
or without PAL-SPeedup (interlaced Output)

Additional, it automatically dectects Telecined Film, which will be passed by the framerate conversion. Thus Avoiding blending in Film parts.

Alex Z
14th April 2004, 06:12
Originally posted by scharfis_brain
You may want to try my automated NTSC -> PAL conversion function.

http://forum.doom9.org/showthread.php?s=&threadid=67161

It can convert your NTSC-Video with PAL-Speedup (progressive output)
or without PAL-SPeedup (interlaced Output)

Additional, it automatically dectects Telecined Film, which will be passed by the framerate conversion. Thus Avoiding blending in Film parts.

@scharfis_brain

Is it posible to convert badly converted PAL->NTSC DVD (25p->29.96i) back to 25p and then slowdown to 23.976?

auenf
14th April 2004, 12:46
Originally posted by Alex Z
@scharfis_brain

Is it posible to convert badly converted PAL->NTSC DVD (25p->29.96i) back to 25p and then slowdown to 23.976?

automagically? almost impossible

even remotely easy? doubtful

Enf...

Xesdeeni
14th April 2004, 13:52
It depends on how badly the conversion was done.

If there is actual missing information (i.e. frames from the source that didn't make it to the destination), then it would be nearly impossible (well, some kind of heavy motion estimation might be able to reconstruct guesses at the missing frames).

If the frames are mixed (e.g. AVISynth's ConvertFPS()), it would be extremely difficult, but maybe not impossible. I did read a while back about doing some people doing some video recovery from this type of thing. I believe it was in connection with the Dr. Who episode recovery effort (some episodes were converted to NTSC and broadcast in North America, where they were recorded on early VCRs, but then the original and NTSC converted broadcast tapes were destroyed). By knowing the amount of mixing that was done, and following the cadence of the conversion, I believe they had some luck recovering most of the original PAL frames/fields from the NTSC recording. But I don't believe anyone has published their algorithm for us to use.

Xesdeeni

Alex Z
14th April 2004, 15:11
Originally posted by Xesdeeni
It depends on how badly the conversion was done.

If there is actual missing information (i.e. frames from the source that didn't make it to the destination), then it would be nearly impossible (well, some kind of heavy motion estimation might be able to reconstruct guesses at the missing frames).

If the frames are mixed (e.g. AVISynth's ConvertFPS()), it would be extremely difficult, but maybe not impossible. I did read a while back about doing some people doing some video recovery from this type of thing. I believe it was in connection with the Dr. Who episode recovery effort (some episodes were converted to NTSC and broadcast in North America, where they were recorded on early VCRs, but then the original and NTSC converted broadcast tapes were destroyed). By knowing the amount of mixing that was done, and following the cadence of the conversion, I believe they had some luck recovering most of the original PAL frames/fields from the NTSC recording. But I don't believe anyone has published their algorithm for us to use.

Xesdeeni


Well, it looks really bad on pc just ok on TV. I think to keep audio unchanged they added 4fps. You can reproduce the effect if use this .avs on PAL progressive source. Any fast motion scene looks a bit stuttered and the edges of fast moving objects are not sharp. Is there a way to undo it?

xxxSource("PALFilm.xxx")
LanczosResize(720,480)
ChangeFPS(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()

Xesdeeni
14th April 2004, 17:16
Originally posted by Alex Z
Well, it looks really bad on pc just ok on TV. I think to keep audio unchanged they added 4fps. You can reproduce the effect if use this .avs on PAL progressive source. Any fast motion scene looks a bit stuttered and the edges of fast moving objects are not sharp. Is there a way to undo it?

xxxSource("PALFilm.xxx")
LanczosResize(720,480)
ChangeFPS(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()The script you show does not add 4fps. It uses a technique similar to NTSC 3:2 pulldown (telecine) for 24p material. It distributes the 25 frames among the 60 fields, repeating as necessary (001112233444556667788999...) On a computer, this will look pretty bad, because of the difference between fields, unless the player can deinterlace pretty well (this is true for any interlaced source). On a TV, this should look pretty good, at least not much worse than any film you've ever seen, since the process is similar to telecine.

My personal opinion on this is to use this technique instead of slowing the video to 23.976p fps. If you do the conversion, playback will be telecined (3:2 pulldown) either explicitly or implicitly anyway. So you still get the replicated pattern. Even on a progressive TV, the gain is fairly minimal, depending on how good the deinterlacer in the TV may be. But you are guaranteed to be screwing with the audio if you adjust the frame rate. So I recommend just leaving the audio alone and using the above technique.

That said, if you want to undo the conversion, and it was done the way you illustrate in the script above, you definitely can. If you think you can match the cadence (sequence of repeated fields), then you can just use an AVISynth script like this:xxxSource("NTSCVidOfPALFilm.xxx")
DoubleWeave()
ChangeFPS(50)
SelectEvery(2,0)
LanczosResize(720,576)But you have to make sure this matches the cadence for the entire movie. I suspect this isn't practical (I've never tried it), so I'd recommend using Decomb instead. You should DoubleWeave() and then use Decomb to decimate back to 25p. Then you can do what you want.

Xesdeeni

Alex Z
14th April 2004, 17:45
Originally posted by Xesdeeni
The script you show does not add 4fps. It uses a technique similar to NTSC 3:2 pulldown (telecine) for 24p material. It distributes the 25 frames among the 60 fields, repeating as necessary (001112233444556667788999...) On a computer, this will look pretty bad, because of the difference between fields, unless the player can deinterlace pretty well (this is true for any interlaced source). On a TV, this should look pretty good, at least not much worse than any film you've ever seen, since the process is similar to telecine.

My personal opinion on this is to use this technique instead of slowing the video to 23.976p fps. If you do the conversion, playback will be telecined (3:2 pulldown) either explicitly or implicitly anyway. So you still get the replicated pattern. Even on a progressive TV, the gain is fairly minimal, depending on how good the deinterlacer in the TV may be. But you are guaranteed to be screwing with the audio if you adjust the frame rate. So I recommend just leaving the audio alone and using the above technique.

That said, if you want to undo the conversion, and it was done the way you illustrate in the script above, you definitely can. If you think you can match the cadence (sequence of repeated fields), then you can just use an AVISynth script like this:xxxSource("NTSCVidOfPALFilm.xxx")
DoubleWeave()
ChangeFPS(50)
SelectEvery(2,0)
LanczosResize(720,576)But you have to make sure this matches the cadence for the entire movie. I suspect this isn't practical (I've never tried it), so I'd recommend using Decomb instead. You should DoubleWeave() and then use Decomb to decimate back to 25p. Then you can do what you want.

Xesdeeni

@Xesdeeni

Can you explain the Decomb script in more details. What am I doing wrong here?

xxxSource("NTSCVidOfPALFilm.xxx")
DoubleWeave()
decimate()

Xesdeeni
14th April 2004, 20:15
Originally posted by Alex Z
Can you explain the Decomb script in more details. What am I doing wrong here?

xxxSource("NTSCVidOfPALFilm.xxx")
DoubleWeave()
decimate() I'm sorry, my mistake. You don't have to use DoubleWeave(). Just tryxxxSource("NTSCVidOfPALFilm.xxx")
ConvertToYUY2()
Telecide(order=1)
Decimate(6)
AssumeFPS(25)The only problem with this is that the NTSC timing isn't 60 fps, but 59.94 fps. As a result, there may be a hiccup now and then. This is why I had to add the AssumeFPS() at the end.

Xesdeeni

Alex Z
14th April 2004, 22:04
Originally posted by Xesdeeni
I'm sorry, my mistake. You don't have to use DoubleWeave(). Just tryxxxSource("NTSCVidOfPALFilm.xxx")
ConvertToYUY2()
Telecide(order=1)
Decimate(6)
AssumeFPS(25)The only problem with this is that the NTSC timing isn't 60 fps, but 59.94 fps. As a result, there may be a hiccup now and then. This is why I had to add the AssumeFPS() at the end.

Xesdeeni

@Xesdeeni and all

Thanks a lot. The script is working wonderfully.

cweb
1st July 2004, 15:39
What's best with regards to quality, converting an NTSC film dvd source backed to PAL dvd using this script with some minor filtering or just making an NTSC dvd backup reencoded from the source (playback with pulldown)? Assume that a PAL dvd player is available and it can play back NTSC encoded dvd's.
Of course the first option would take more time to encode..

Xesdeeni
1st July 2004, 17:28
That depends on the quality of the DVD player's conversion.

My NTSC DVD player can convert PAL DVDs to NTSC. It's real NTSC out of the player, because almost no NTSC TVs can take PAL or a hybrid. But the way the player does the conversion is pretty poor. I'm not privy to the internals of the DVD player, but just based on observation and SWAGs, it appears to me as if it starts by throwing out every other field. This makes any PAL source 25 progressive frames, but of course reduces the vertical resolution to 288 lines. It then scales this video. Based on the fact that the resulting video is a bit short vertically (black bars at the top and bottom), I'm guessing it uses the already built-in letterbox scaler. That scaler done 480->360 scaling, or .75x. Taking 288 * 2 * .75 gives 432 lines, which is just less than the 440-ish lines that show up on a typical TV. You can see evidence of the missing lines in stair-stepping on nearly horizontal lines. But 288 lines scaled to 432 is not quite as bad as throwing away one field of NTSC would be. Of course, since the letterbox scaler is already in use, it can't use the scaler to letterbox 16:9 stuff, so anamorphic PAL is vertically stretched. It then looks like it shows the 25 fps video at 24 fps with 3:2 telecine. I'm not certain how it plays back the audio slower, but it has pitch shifting in the Karaoke feature, which might be useful for this.

Anyway, if you'll pardon my digression, the point is that the player doesn't do that great a job. My understanding of PAL players playing NTSC DVDs is that the results might be a bit more satisfactory.

I've heard that most PAL TVs will accept 525/60 inputs, although they may not like the NTSC color encoding. So I believe that most PAL DVD players, when they play an NTSC DVD, output 525/60 with the PAL color encoding. This hybrid would look pretty good, and in general should be better than converting the video. But of course, there are no guarantees.

Xesdeeni

max2k
1st July 2004, 21:16
@Xesdeeni:

I've read this thread and your "Standards Conversion" page with great interest.

My source material is NTSC DV, interlaced ( Digital Camcorder footage ) - captured to AVI (Type2, DV).
Need to make a PAL DVD ( interlaced would be fine, I guess ) - to be viewed on TV.

Which script should I start with ? I saw the grid on the webpage - but there was nothing corresponding to this ....

Can you point me to the script that I can use as a starting point ?

Thanks a bunch :)

Xesdeeni
1st July 2004, 21:53
I use the Main Concept DV codec, which works as a Video For Windows codec. I had no luck with the Microsoft (included with Windows) codec. The Main Concept one worked great, and it's free for decode, which is all you need in your case.

Use the latest AVISynth and get the 2.5.x SmoothDeinterlacer from http://www.avisynth.org/warpenterprises. Put the DLL into the AVISynth plugins directory.

Start with the following script:AVISource("NTSCDV.avi")
SeparateFields() # Correct for bug...
Weave() # ...in SmoothDeinterlacer
SmoothDeinterlace(doublerate=true)Load this script into VirtualDub and step through the video to be sure that the input field polarity is correct. SmoothDeinterlacer reads the polarity, but some codecs don't seem to get it right (well, it could be SmoothDeinterlacer, but I'll blame the codecs ;)). If the video doesn't move correctly, add ComplementParity() before the SmoothDeinterlace() call above and check again. Then complete the script:ConvertFPS(50) # or ChangeFPS(50)
LanczosResize(720,576)
SeparateFields()
SelectEvery(4,0,3)
Weave()Load this script into VirtualDub just to do a sanity check. Then load the script into your encoder. Encode a short sample clip that includes some still and some motion. Author and burn a sample (DVDRW) to test the output field polarity. View the result on a TV (not a PC) and ensure the still images look OK and that the motion is correct. If the motion is wrong, replace the SelectEvery() call above with SelectEvery(4,1,2).

Then you are set to make your DVD.

Xesdeeni

scharfis_brain
2nd July 2004, 01:11
xesdeeni: why do you recommend using that old smoothdeinterlacer?

kernelbob is much better IMO....

Xesdeeni
2nd July 2004, 03:17
Originally posted by scharfis_brain
xesdeeni: why do you recommend using that old smoothdeinterlacer?

kernelbob is much better IMO.... I assume that's a rhetorical question (http://biphome.spray.se/gunnart/video/AVSPorts/SmoothDeinterlacer/) ;)

Xesdeeni

cyberbob25
8th July 2004, 20:46
Xesdeeni,

I have followed your instructions on your website for converting a PAL movie to NTSC. When I load the .avs file into TMPGENC, in the preview window, it shows the following message: "Evaluate: Unrecognized Exception: D:\movies\dvd\dvd2avi\test.avs, line 3"

I've followed your steps exactly. If I continue anyway, and click on start, it creates a 2.5KB file that I can't play. The only exception is that i am using MPEG2DEC3dg.

I am using the following versions:
-The latest version of DVD2AVI (1.77.3)
-The newest Deinterlacer.dll off of http://www.avisynth.org/warpenterprises. (2.5xx)
-AVISynth 2.5
-TMPGENC 2.54.36.134

Do you have any ideas?

Xesdeeni
8th July 2004, 21:01
Originally posted by cyberbob25
"Evaluate: Unrecognized Exception: D:\movies\dvd\dvd2avi\test.avs, line 3"I've never seen an error like that one. What is on line 3 of your AVS script? Can you load the D2V directly into TMPGEnc (it has this ability)?

Also, at this point, although I've sinned by not updating the web page, I'm using DGMPGDec (http://neuron2.net/fixd2v/decodefix.html) instead of DVD2AVI and MPEG2DEC.dll. I'd recommend switching to those.

Xesdeeni

cyberbob25
8th July 2004, 21:23
Wow...I think that was the quickest reply I've ever gotten on a forum.

As for the .avs script, I literaly did a copy and paste from your example on your website, and just changed line 3 to:

mpeg2source("d:\movies\dvd\dvd2avi\test.d2v").

I'm sure I'm doing something wrong, I just can't figure out what. When I get home, I'll try using DGMPGDec instead. I had previously tried using MPEG2DEC.dll, and I'm pretty sure that I got an error in TMPGENC then stating that MPEG2DEC is not a valid plugin for AVISynth 2.5. Can't remember for sure though. That was using a version of MPEG2DEC.dll that I found somewhere off of the internet.

Please forgive my newbiness.

Xesdeeni
8th July 2004, 21:47
Before you switch to DGMPGDec, just try loading the D2V into TMPGEnc. It should load.

If not, then there's something wrong with the D2V file. Be sure your source is still there and hasn't been moved. A path to the VOBs is stored in the D2V, so if you remove a DVD or move the files, the D2V isn't valid any more.

If the D2V loads into TMPGEnc, then it's probably MPG2DEC.dll that is the problem. Since DGMPGEnc includes DGIndex.exe and DGDecode.dll as a matched set, fixing this is probably easiest by just switching to DGMPGDec.

We were all newbies once, and we're all newbies in some other area still.

Xesdeeni

max2k
9th July 2004, 01:49
xesdeeni:

Thanks a bunch for your detailed response .... I would try it out and let you know if it went well

Thanks again !

Originally posted by Xesdeeni
I use the Main Concept DV codec, which works as a Video For Windows codec. I had no luck with the Microsoft (included with Windows) codec. The Main Concept one worked great, and it's free for decode, which is all you need in your case.

Use the latest AVISynth and get the 2.5.x SmoothDeinterlacer from http://www.avisynth.org/warpenterprises. Put the DLL into the AVISynth plugins directory.

Start with the following script:AVISource("NTSCDV.avi")
SeparateFields() # Correct for bug...
Weave() # ...in SmoothDeinterlacer
SmoothDeinterlace(doublerate=true)Load this script into VirtualDub and step through the video to be sure that the input field polarity is correct. SmoothDeinterlacer reads the polarity, but some codecs don't seem to get it right (well, it could be SmoothDeinterlacer, but I'll blame the codecs ;)). If the video doesn't move correctly, add ComplementParity() before the SmoothDeinterlace() call above and check again. Then complete the script:ConvertFPS(50) # or ChangeFPS(50)
LanczosResize(720,576)
SeparateFields()
SelectEvery(4,0,3)
Weave()Load this script into VirtualDub just to do a sanity check. Then load the script into your encoder. Encode a short sample clip that includes some still and some motion. Author and burn a sample (DVDRW) to test the output field polarity. View the result on a TV (not a PC) and ensure the still images look OK and that the motion is correct. If the motion is wrong, replace the SelectEvery() call above with SelectEvery(4,1,2).

Then you are set to make your DVD.

Xesdeeni

cyberbob25
9th July 2004, 15:23
Xesdeeni:

I'm apparently really stupid. The reason I was getting that particular error was because I was trying to do this using a remote desktop from work. Because of this, I didn't notice that DVD2AVI was actually trying to process the entire video to create the .d2v file... Ihad assumed that since you were only saving the project, it was just saving the settings for what was to be done later.

Anywho, after I got home and realized this and let it finish processing, I no longer get that error in TMPGENC. Instead, I get a new one :)

"Unrecognized Exception: D:\movies\dvd\dvd2avi\test.avs, line 5"

Pretty much the same error message, just different line this time. My .avs file looks like this (and this time I tried using DGMPGDec).

LoadPlugin("dgdecode.dll")
LoadPlugin("SmoothDeinterlacer.dll")
MPEG2Source("D:\movies\dvd\dvd2avi\test.d2v")
SmoothDeinterlace(doublerate=true)
LanczosResize(720,480)
ChangeFPS(59.94) # or ConvertFPS(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()
ConvertToRGB()

Where lanczosresize is obviously the command on line 5.

Also, just to give all details and look for the best way of doing this... My source is a PAL interlaced DVD which has one VTS containing lots of PGC's (a few for the menus, several slides(each being a PGC), and then the video).

Is there anyway to convert this DVD to NTSC without losing the menu functionality, or do I basically have to let TMPGENC/AVISynth convert everything, and then re-create the menu buttons, and re-author?

Thanks again for all of your help.

Xesdeeni
9th July 2004, 16:14
Originally posted by cyberbob25
"Unrecognized Exception: D:\movies\dvd\dvd2avi\test.avs, line 5"LoadPlugin("dgdecode.dll")
LoadPlugin("SmoothDeinterlacer.dll")
MPEG2Source("D:\movies\dvd\dvd2avi\test.d2v")
SmoothDeinterlace(doublerate=true)
LanczosResize(720,480)
ChangeFPS(59.94) # or ConvertFPS(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()
ConvertToRGB()Well first, since you are using AVISynth 2.5.x, you don't have to have the LoadPlugin() calls any more. Just put the DLLs into the AVISynth plugin directory.

Second, you need to add a SeparateFields() and Weave() before SmoothDeinterlace() to work around a bug.

Next, break things down and see where the problem lies.
1. Does the D2V load correctly into TMPGEnc?
2. Does a script consisting only of the MPEG2Source() line load into VirtualDub? TMPGEnc?
3. Does a script with MPEG2Source() and SmoothDeinterlacer() (with SeparateFields() and Weave()) load into VirtualDub? TMPGEnc?
4. Do BilinearResize() or BicubicResize() make a difference instead of LanczosResize()?My source is a PAL interlaced DVD....Is there anyway to convert this DVD to NTSC without losing the menu functionality, or do I basically have to let TMPGENC/AVISynth convert everything, and then re-create the menu buttons, and re-author?Unfortunately, there isn't an automated way. You have to convert the content and re-author from scratch. Sorry.

Xesdeeni

cyberbob25
9th July 2004, 16:54
I'll try the other things you mentioned, I just wanted to add that I forgot to include in my last post that the D2V file does properly load into TMPGENC. I'll try the other things as soon as I get the chance.

cyberbob25
9th July 2004, 19:38
Ok, after playing around and trying different things, I think I finally found a script that works. Part of the problem was definitely the "LanczosResize(720,480)". As soon as I deleted this out of the .avs file, moved around the elements you described earlier, it loaded fine. My script now looks like this:


MPEG2Source("d:\movies\dvd\dvd2avi\test.d2v")
SeparateFields()
Weave()
ConvertToRGB()
SmoothDeinterlace(doublerate=true)
BicubicResize(720,480)
ChangeFPS(59.94) # or ConvertFPS(59.94)
SelectEvery(4,1,2)

I also had to move up the ConvertToRGB() command to get it to work properly. It loaded up fine, but after doing a test encode, the resulting video was just a black screen with red text across the top stating that it could only work in a specific color space (though I don't remember the exact message).

Does everything look OK to you Xesdeeni? Will this work for me?

Forgive me if this is a stupid question, but I just realized...since the source is already interlaced, why do I run smoothdeinterlacer()?

Xesdeeni
9th July 2004, 21:19
Originally posted by cyberbob25
Part of the problem was definitely the "LanczosResize(720,480)"I thought LanczosResize() was OK with the same inputs as BilinearResize() and BicubicResize(), but maybe not. See below...My script now looks like this:MPEG2Source("d:\movies\dvd\dvd2avi\test.d2v")
SeparateFields()
Weave()
ConvertToRGB()
SmoothDeinterlace(doublerate=true)
BicubicResize(720,480)
ChangeFPS(59.94) # or ConvertFPS(59.94)
SelectEvery(4,1,2)I also had to move up the ConvertToRGB() command to get it to work properly. It loaded up fine, but after doing a test encode, the resulting video was just a black screen with red text across the top stating that it could only work in a specific color space (though I don't remember the exact message).AVISynth and DGMPGDec can deal with YV12 (a.k.a. 4:2:0), which is the native format of MPEG, and this is what is output by MPEG2Source() in this case. SmoothDeinterlacer can't deal with this space, it can only handle YUY2 and RGB. But you'll get a bit better speed out of SmoothDeinterlacer if you use YV12toYUY2(interlaced=true) instead of ConvertToRGB(). You should also be able to put LanczosResize() back.Forgive me if this is a stupid question, but I just realized...since the source is already interlaced, why do I run smoothdeinterlacer()? The standards conversion process uses SmoothDeinterlacer. You get 50 fields/sec at 720x576 out of MPEG2Source(). You have to get this to 59.94 fields/sec at 720x480. There is a document at Snell and Wilcox's site (http://www.snellwilcox.com/knowledgecenter/books/books/estandard.pdf) that goes into the gory detail of doing this while interlaced. My eyes cross every time I re-read it (I was given a copy over 10 years ago at NAB by a guy with S&W).

But if you convert your 50 fields/sec to 50 frames/sec, it is much easier to deal with the concept of converting that to 59.94 frames/sec. And going from 59.94 frames/sec to 59.94 fields/sec is simply a matter of throwing out half of every frame.

So all you have to do is do a decent deinterlacing job to get to 50 frames/sec, a decent scaling job to get to 720x480, and then figure out how to convert the frame rate itself to get to 59.94 frames/sec. SmoothDeinterlacer handles the first, LanczosResize() handles the second, and for now ConvertFPS() or ChangeFPS() handles the third.

Xesdeeni

scharfis_brain
10th July 2004, 00:08
xesdeeni: I tried your smoothdeinterlacer and found its metric being as good as dgbob's.

smoothdeinterlacer simply does a pixel duplication on moving areas, correct?

plus, it isn't in phase with all other bobbers out there (it is one frame behind/future, sorry can't tell you now)

I like the special interpolation tecniques of kerneldeint & tomsmocomp/sangnom.

if you have time to implement choosable kernel or edgedirected interpolation, your smoothdeinterlace will definately go to the upper level of the bobbers, but with simple pixel-duplication (stairstepping is your everytime friend) it becomes unacceptable for my purposes...

cyberbob25
10th July 2004, 01:47
Xesdeeni:

I've made the changes that you recommended:

MPEG2Source("d:\movies\dvd\dvd2avi\test.d2v")
SeparateFields()
Weave()
YV12toYUY2(interlaced=true)
SmoothDeinterlace(doublerate=true)
LanczosResize(720,480)
ConvertFPS(59.94)
SelectEvery(4,0,3)

It loads fine into TMPGENC, however, the product is unwatchable. Nearly every frame is full of noise blocks (and I don't mean just a few...the entire picture), and the video seems to run quite a bit faster. So far, I've tried using both convertfps(), and changefps(), and also both SelectEvery(4,1,2) and SelectEvery(4,0,3). No matter the configuration, it still looks the same.


Any ideas?

cyberbob25
11th July 2004, 08:16
Nevermind my last post...I had used DVDReMake to strip everything out of the dvd with the exception of a 150Meg clip for testing, and apparently, that was my problem, as I just tried the original movie, and it worked great.

However, now, when I remux the sound back in, it gets out of sync. This of course makes sense to me, but how do I correct it?

Thanks again for all of your help Xesdeeni

Xesdeeni
11th July 2004, 14:24
Originally posted by scharfis_brain
smoothdeinterlacer simply does a pixel duplication on moving areas, correct?No, on moving areas it does a linear interpolation.plus, it isn't in phase with all other bobbers out there (it is one frame behind/future, sorry can't tell you now)You mean the frame output doesn't match? Have you compared to Bob()?I like the special interpolation tecniques of kerneldeint & tomsmocomp/sangnom.Any basic interpolation can't account for the missing lines, so stairsteps will happen. I've always wanted to do some experiments with a smarter interpolator that notices nearly-horizontal edges and tries to do a better job. Maybe these interlacers have done so. I'll have to find some time to check them out.if you have time to implement choosable kernel or edgedirected interpolation, your smoothdeinterlace will definately go to the upper level of the bobbers, but with simple pixel-duplication (stairstepping is your everytime friend) it becomes unacceptable for my purposes...You should understand that all I did was port Gunnar Thalin's VirtualDub filter to AVISynth. I did add the bob feature, but the algorithms are Gunnar's. Maybe he would like to take a look.Originally posted by cyberbob25
However, now, when I remux the sound back in, it gets out of sync. This of course makes sense to me, but how do I correct it?With this type of conversion, the resulting video is exactly the same length as the original, so the audio should not be out of sync. You shouldn't have to process the audio at all. Just use the AC3 extracted by DGIndex.

Xesdeeni

cyberbob25
11th July 2004, 16:37
Strange then. It is in sync in the beginning, but by the end it's maybe a full 2 seconds off.

Xesdeeni
12th July 2004, 14:11
Is the resulting file the same length as the original?

Xesdeeni

sjc65
13th July 2004, 04:31
Hi all,

I'm new to the forums but have learned much on my own by searching and reading. Using Xesdeeni's conversion guides and info from various forums, I tried converting Pal dvd to Ntsc dvd with only one reencode using TmpgEnc. The results looked fine on the TV, no jittering or other anomalies, but the simplicity of the procedure makes me think I'm missing something. Here's what I did:

loaded a demuxed pal 4:3 m2v into TmpgEncv2.521.58.169 with these settings:

Advanced:
interlace
top field first
4:3 625 line(pal)
Full Screen
Do Not Frame rate Conversion

Video:
MPEG-2
720x480
4:3 display
23.976 fps(internally 29.97 fps)
2-pass VBR
MP@ML
NTSC
3:2 pulldown when playback
4:2:0
10 bits
highest quality

I also slowed down the audio. As I said, the results looked very good, ~4% increase in running time and audio matched up perfectly when remuxed within Scenarist. So my question is, am I missing something? Can the dvd2avi/avisynth steps be bypassed and conversion be done using TmpgEnc alone? And, is any information lost in bringing the pal video back to 24fps? Thanks for any input/thoughts/advice you may have.

cyberbob25
13th July 2004, 16:12
Is the resulting file the same length as the original?

I checked the length of my ac3 file that DGMPGDec created. It was 2:03:37. I then checked the length of the m2v file that DGMPGDec created. It was 2:03:41, a clear 4 second difference.

To be completely honest, sync isn't that much of an issue in this movie, since it is in German, and I would only have to watch it with subtitles anyway, but it would still have the action moments sync up. How would I go about slowing down the audio to fill that 4 second gap?

Kika
13th July 2004, 16:44
@sjc65

Your methode only works on progressive source. If you try it with interlaced Video, you will get very strange looking results.
An other thing is the resizing engine of TMPGEnc, it isn't as good as AVISynth can handle this.

sjc65
13th July 2004, 18:20
Thanks for your response Kika. The 2 sources I've used have been from pal dvd, most of which is progressive I believe. I'm actually practicing for converting a pal digital cable sourced film recorded on a standalone dvdrecorder in 16x9, not sure if that would be progressive or interlaced(I haven't got the files yet, should arrive this week). The inferior resizing of TmpgEnc is reason enough to run through avisynth. If quality suffers from the shortcut, the extra steps will be worth it. Time to read up on avisynth. Thanks again.

cyberbob25
14th July 2004, 21:10
Anybody? What program would I use to slow down the .ac3 file enough to fill the 4 second gap so that I can synch it with my video? What is the easiest way to accomplish this?

auenf
20th July 2004, 14:07
Originally posted by cyberbob25
Anybody? What program would I use to slow down the .ac3 file enough to fill the 4 second gap so that I can synch it with my video? What is the easiest way to accomplish this?

besweet

Enf...

jojo15
26th July 2004, 09:26
Hi,
what's the best way to demux vobs, and mux the files after ntsc2pal conversion to vob again??
and do i have to demux all vob files and then it'll work or do i have to edit something in the other files also??
Thnx in advance..