Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st March 2003, 22:20   #41  |  Link
jbalakri
Registered User
 
Join Date: Jun 2002
Posts: 28
I am afraid I was not very happy with results of the smoothdeinterlaced () version this NTSC to PAL conversion script because, the resultant video was jerky. It did not matter if I used SelectEvery(4,1,2) or SelectEvery(4,0,3). It was equally jerky.

I found the original AVISynth documentation version with bob() to give a better result as far as jerkyness is concerned.

- Jay
jbalakri is offline   Reply With Quote
Old 1st April 2003, 14:36   #42  |  Link
Xesdeeni
Registered User
 
Join Date: Aug 2002
Posts: 467
If you are seeing more "jerkiness" with the SmoothDeinterlacer() version, then you have some problem with your field polarity. I should never be worse than the Bob() implementation.

To ensure the input polarity is correct, try putting just the following into a script:
Code:
LoadPlugin("SmoothDeinterlacer.dll")
xxxSource("Input.xxx")
SeparateFields()
Weave()
SmoothDeinterlace(doublerate=true)
Look at the result in VirtualDub and step through the frames. If the video moves back and forth when it should be just moving one direction (call it the "Cha Cha Cha" effect ), then the automatic detection of the field dominance is failing (maybe due to the source file, maybe due to a screwup in SmoothDeinterlacer ). Add either ComplementParity() before the SmoothDeinterlace() line, or try "tff=false" and "tff=true" until you get the correct motion.

Then add the remainder of the conversion script and test on a small piece of the video using both SelectEvery(4, 0, 3) and SelectEvery(4, 1, 2) to get the output polarity correct.

If you have any more problems, let me know, and I'll work with you to get this right. The results are MUCH better than Bob().

Xesdeeni
Xesdeeni is offline   Reply With Quote
Old 1st April 2003, 23:58   #43  |  Link
jbalakri
Registered User
 
Join Date: Jun 2002
Posts: 28
Xesdeeni,

I think it is not the field polarity problem. I tried your script you mentioned and the video did not apprear to move back and forth as you said it might happen if field polarity was the problem. Out of curiosity, I introduced ComplementParity() and now, it did move back and forth. So parity was good to begin with.

Here is the script I am using:

LoadPlugin("SmoothDeinterlacer.dll")
AVISource("D:\input.avi")
SeparateFields()
Weave()
SmoothDeinterlace(doublerate=true,lacethresh=1,staticthresh=20)
LanczosResize(720,576)
ChangeFPS(50)
SeparateFields()
SelectEvery(4,0,3)
Weave()

The jerkeyness is not pronounced, but quite apparent only in sections where there is a fast moving object, for example a train moving across the screen. But I must admit, the result is better than bob() version of the script, but for this jerkeyness.

The source is NTSC DV avi file and I am trying to encode it in CCE and author a PAL DVD using DVDit PE.

Let me know if i am doing anything wrong. Thanks for helping.

Thanks,
- Jay
jbalakri is offline   Reply With Quote
Old 2nd April 2003, 14:41   #44  |  Link
Xesdeeni
Registered User
 
Join Date: Aug 2002
Posts: 467
Try using ConvertFPS() instead of ChangeFPS(). But in either case, there will be an artifact usually called "jutter" when the scene pans. ChangeFPS() will give you what you call a "jerk," while ConvertFPS() will give you more of a "strobing" effect. This is unavoidable when using the techniques we can accomplish on a PC today. To avoid this problem, you would need an expensive conversion device capable of doing motion estimation/compensation. But the above technique is very similar in quality and side-effects to the less expensive "four-field" standards converters...at a MUCH cheaper price. [There also may be some things you can do by hand to fix this if you want to go to the trouble, but you really have to want professional quality to take the time.]

Also, I'm curious why you needed to adjust the thresholds so radically. There have been a few videos that needed some tweaking (one particularly with lots of fog), but the defaults I borrowed from Gunnar's original VirtualDub version appeared to be very good in most cases.

Xesdeeni
Xesdeeni is offline   Reply With Quote
Old 2nd April 2003, 18:51   #45  |  Link
easy2Bcheesy
Moderator
 
easy2Bcheesy's Avatar
 
Join Date: Feb 2002
Posts: 643
The only way you can avoid the "jerkiness" you are talking about is to put your file onto digital tape and take it to a production house - ask for them to run the footage through an Alchemist PH.C. This uses motion vectors to replot every single pixel, and is the industry standard for standards conversion. An Alchemist will cost you over £80,000 so you basically hire time from someone who has one!

I've spent three years in DVD production now and Xesdeeni's script is a revelation. The jerkiness you talk about is only visible on sustained pans and won't be noticed by 95% of your audience. There are some exceptions where it's really not useable - for example, I captured some racing footage. Here all the cameras pan from left to right and the results of the conversion are not impressive at all. But for all other applications, I've found that it sustains quality and sync in brilliant fashion. You couldn't do this on Adobe After Effects or any other industry level tool. Canopus Procoder - a decent enough second place, but still not a patch on this (you'll get jerking on that too).

In terms of the parameters for the deinterlacer - those are mine from my tweaked version of the script earlier in the thread! I've tinkered a little more, but I still can't find better. But I should stress that those settings are optimised for the style of footage I use - you'll most likely get better results by tinkering with them on your own clips.
easy2Bcheesy is offline   Reply With Quote
Old 3rd April 2003, 21:14   #46  |  Link
jbalakri
Registered User
 
Join Date: Jun 2002
Posts: 28
Using ConvertFPS() does help a lot in improving the jutter or jerkeyness because that "strobing" effect as you put it, makes it better to watch. Now the jutter is the same as the original bob() version, but overall quality and sharpness is much better than bob() version. I am quite happy with it now. Thanks for your help.

Yes, I used easy2Bcheesy's parameters for the SmoothDeinterlace initially. Now I removed both the parameter's and am going with the default parameters.

Thanks,
- Jay
jbalakri is offline   Reply With Quote
Old 7th April 2003, 20:50   #47  |  Link
redeemer-dk
Registered User
 
Join Date: Oct 2002
Location: Copenhagen, Denmark
Posts: 121
NTSC to PAL

Dunno if this has been tried before, but i just tried this NTSC to PAL script and it works pretty good.

It will create interlaced contents, but standalone dvd players will be able to display that fine right?

LoadPlugin("D:\Program Files\GordianKnot\MPEG2Dec.dll")
MPEG2Source("H:\8MILE\8mile.d2v")
ChangeFPS(50)
SeparateFields()
LanczosResize(720,288)
SelectEvery(4,1,2)
Weave()


I'd like to get some comments to see if this is a good way or if it's bad with some movies.

Thanks
redeemer-dk is offline   Reply With Quote
Old 8th April 2003, 14:33   #48  |  Link
Xesdeeni
Registered User
 
Join Date: Aug 2002
Posts: 467
Yes, the output is interlaced. But, I would recommend that you scale the video before you change the frame rate and before you separate the fields:
Code:
LoadPlugin("D:\Program Files\GordianKnot\MPEG2Dec.dll")
MPEG2Source("H:\8MILE\8mile.d2v")
LanczosResize(720,576)
ChangeFPS(50)
SeparateFields()
SelectEvery(4,1,2)
Weave()
This will be faster (since you are only scaling 24 fps instead of 50) and give you a bit better image (because you are using the entire frame to scale, instead of every other line).

This technique will work for movies, but it won't be quite as smooth as the other technique used on my Standards Conversion Page. OTOH, with that method, the movie will run slightly slower, and the audio will need to be processed. Since 8 Mile probably has a lot of music (I'm guessing because Eminem is in it...I haven't seen it), that probably wouldn't be acceptable with the usual methods. But give it a try using WSOLA and let us know what you think.

Xesdeeni
Xesdeeni is offline   Reply With Quote
Old 9th April 2003, 23:35   #49  |  Link
Adamb
Registered User
 
Join Date: Apr 2002
Posts: 4
PAL to NTSC final

Very Interesting thread. I 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? Will this work with CCE Basic for encoding?

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??
Adamb is offline   Reply With Quote
Old 10th April 2003, 09:54   #50  |  Link
brw
Registered User
 
Join Date: Mar 2003
Posts: 6
I don't see any technical reason why you would need to slow down 25 fps to 24 fps to go from PAL to NTSC since your target is 29.97 fps. I was a little surprised to find that pulldown.exe won't properly convert 25 fps to 29.97 fps so I'm attaching a program I wrote a little while ago which will insert the rff and tff flags necessary to bring an mpeg2 video stream to 29.97 fps, it will work on input that's 25, 24, or 23.976 fps. The usage is fairly simple, just type: m2ntsc source.m2v destination.m2v. It doesn't have all the options of pulldown.exe but it is faster if your source and destination are on the same drive (larger buffer results in less drive seeks than with pulldown.exe) so you may want to try it out even if you're working exclusively with NTSC. I haven't extensively tested it (I don't even use it anymore), but I have used it with 23.976 and 25 fps material and it has worked fine.
brw is offline   Reply With Quote
Old 10th April 2003, 14:46   #51  |  Link
Xesdeeni
Registered User
 
Join Date: Aug 2002
Posts: 467
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.

Adamb
Quote:
I 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 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:
Code:
      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.
Quote:
Will this work with CCE Basic for encoding?
Sure, just feed the AVISynth script to CCE instead of TMPGEnc.
Quote:
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
Xesdeeni is offline   Reply With Quote
Old 20th April 2003, 17:55   #52  |  Link
shoarthing
old
 
Join Date: Feb 2003
Posts: 69
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].
shoarthing is offline   Reply With Quote
Old 22nd April 2003, 17:05   #53  |  Link
philippoumartin
Registered User
 
Join Date: Mar 2003
Posts: 5
PAL to NTSC

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
philippoumartin is offline   Reply With Quote
Old 28th April 2003, 02:34   #54  |  Link
ryangs
Registered User
 
Join Date: Feb 2003
Posts: 21
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!
ryangs is offline   Reply With Quote
Old 28th April 2003, 16:14   #55  |  Link
philippoumartin
Registered User
 
Join Date: Mar 2003
Posts: 5
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
philippoumartin is offline   Reply With Quote
Old 29th April 2003, 14:52   #56  |  Link
Xesdeeni
Registered User
 
Join Date: Aug 2002
Posts: 467
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
Xesdeeni is offline   Reply With Quote
Old 29th April 2003, 15:24   #57  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
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.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 29th April 2003, 15:44   #58  |  Link
Xesdeeni
Registered User
 
Join Date: Aug 2002
Posts: 467
More info on several methods of conversion on my Standards Conversion page.

Xesdeeni
Xesdeeni is offline   Reply With Quote
Old 29th April 2003, 19:55   #59  |  Link
ryangs
Registered User
 
Join Date: Feb 2003
Posts: 21
Quote:
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!
ryangs is offline   Reply With Quote
Old 29th April 2003, 23:54   #60  |  Link
Xesdeeni
Registered User
 
Join Date: Aug 2002
Posts: 467
Quote:
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.
Quote:
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).
Quote:
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
Xesdeeni is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.