View Full Version : Help needed PAL 25fps DIVX to NTSC 23.976 progressive MPEG
Jeff D
1st April 2004, 08:29
I've looked through several guides that get me close to what I want to do, but I haven't found anything that will acutally do what I need.
Most of the guides involve using AVI2SVCD and DVD2AVI, but... I've got a DIVX source that won't go through DVD2AVI and I can't get too far without that.
I think I have a good idea what to do with the audio. I think I can do a FRC on the audio within besweet and that should be all I need to do with the extracted wav audio I get from vdub. Without video it's tough to know if I've got it right...
So, the video, I've got 25fps PAL Divx and want to get 23.976fps NTSC progressive MPEG. It believe the 25fps source is progressive, but have not solid proof of that.
So how do I remove this 1.004fps? A deciminate(25) will get me 24fps, close, but not right.
I'm so confused. Everything I've tried has got me close, but not quite to the goal. I know it has to be possible, I just can't figure out what steps and in what order.
Anyone else ever done this? What simple step am I missing?
Thanks!
Kika
1st April 2004, 08:36
If your Video really is progressive, use AVISynth with AssumeFPS(23.976).
Maybe you have to resample the Audio-Part too, this depents on the production process of you Video. For resampling Audio, i do use WaveLab.
Jeff D
1st April 2004, 09:37
I believe the divx file is a PAL DVD source at 25fps, so that's got to be progressive, right? I can look at bits in an mpeg stream and figure out if a stream is progressive, but I have no clue how to tell with DIVX. And sure the author could have screwed up, but it's looks really clean.
I thought an an AssumeFPS (23.976) would acutally screw up the video, no? It's like saying take this 25 fps source and play it back at 23.976, which would roll 1.004 fps out in in time stretching the playback. I'm concerned about the output encoded mpeg frame rate and yeah the audio.
I figure the source was shot on film, so it's 24fps that was converted to pal and I just need to undo that conversion. I would think deciminate would do part of that. But then how to get the last fraction of a frame removed? And do you reall need to? If I were to feed a 24fps source into an encoder would it do this automatically?
The only time I've worked with encoding progressive sequences it's been from a NTSC capture which I did the IVTC on, so that I figue is truely 23.976 because the source was NTSC and so the timing would stay in NTSC timing (23.976fps instead of the film stock's 24 fps)
Am I just over thinking the problem?
Mug Funky
1st April 2004, 09:43
umm... easiest way to tell if a video (any kind) is progressive is to watch it... if you see mice-teeth then it's not (pure) progressive.
if it's been divx'ed already then there's not much doubt about it being progressive. you'd be nuts to encode interlaced in divx unless you're going for high bitrates.
there's a timestretch function in avisynth. i've yet to play with it all that much because of bugs, but the latest binary has fixes (for stereo at least).
check the avisynth wiki for timestretch docs...
generally you'd do something like:
bicubicresize(720,480,0,.5)
assumefps(23.976,true) #"true" is for the sync_audio parameter... you need this
timstretch(insert valid arguments here, i forgot them)
[edit]
so you know, _most_ PAL titles are shot at 24fps, then sped up to 25, so no decimation is needed (and that's why you need to timestretch the sound).
if the title is a recent english movie, it's quite possible that it was actually shot in PAL, deinterlaced then layed straight onto DVD (one title that springs to mind is "24 hour party people"... ever noticed the outtakes were interlaced?). i think this is done (a) to save production costs, and (b) to sh*t the NTSC world off with off-key sound for a change.
aklendathu
1st April 2004, 11:49
AVISynth timestretch doesn't work OK (yet).
AssumeFPS(23.976, sync_audio=true)
is the best option at present.
Also, you need to resample your audio to the desired BR
SSRC(48000)
otherwise the sync_audio will give you a non-standard samplerate
The pitch change caused by sync_audio is barely noticeable, in particular if the PAL DVD was created by speeding up the original
FILM source.
actionman133
1st April 2004, 12:18
i think youve been thinking that assumefps is like changefps. changefps adds and removes frames to match the new rate but maintain the original speed. assumefps slows down the playback without changing the original frames. its like slowing down a projecter. the frames are the same, but their 'exposure times' are enlongated.
but if you want to know if the source is progressive or not, load it up in virtualdub with mpeg2source, and just go through it over a second or two in a high motion scene and look for the horizontal combing effect. if you can't see any at all, then its progressive.
so the code to use is
AssumeFPS (23.976, True)
ResampleAudio (48000) # or SSRC (48000) if you have version 2.54
don't use timestretch, becuase the pitch is necessary. just make sure if youre making it ntsc, it has to be resized to 720x480, whatever the source and also interlaced to 29.97 fps.
Leak
1st April 2004, 15:12
Originally posted by actionman133
don't use timestretch, becuase the pitch is necessary.
Uh - what exactly do you mean by "the pitch is neccessary"? Going from 25 to 23.976 FPS changes the pitch by almost one halftone, which is very noticeable if you're used to a voice or song at normal pitch...
(Okay, so I haven't tried timestretch in AviSynth yet, but I've been using SoundStretch outside AviSynth for some time now and it works great if you don't change the pitch by more than 3 halftone steps or so...)
np: System - Spy (System)
Jeff D
1st April 2004, 18:18
I've stayed away from the audio tools in AVISynth, I'm still like most and scared by bad experiences in the past.
I'll look at the source, I was thinking I could use vdub to find dup frames, but I'm not sure if vdub really does that. There appears to b no combing in the source, I doubt it's interlaced.
BTW the audio is really strange in that it's 8 bit stereo, I'm curious if someone just screwed up the sample size or was it done intentional.
actionman133
1st April 2004, 23:03
sorry... meant to say the pitch shift is UNnecessary.
if the original source was shot on film (at 24 fps), then when it was sped up to 25 fps, the pitch was also increased (the chipmunk effect). so when the video is slowed back down to 24 fps again the effect is reversed, and the original pitch is restored. this isnt quite true for this case since he wants 23.976 fps, but its okay within 0.1% margin of error. i wouldnt bother with the timestretch over such a small discrepency.
to my knowledge, virtualdub is not able to find duplicated frames automatically, unless they're dropped frames. if you can't see a duplicated frame then the film was simply sped up, with no decimation involved, and you just have to slow it back down with assumefps...
Jeff D
2nd April 2004, 05:22
while on the subject... anyone got suggestions on resizing this thing?
I was hoping to got anamorphic sized video, but gave up after having problems.
What I did...
source 593x320 (1.85:1)
scale factor up to 720x?? is 1.216216216 so that results in 720x390.
Now, what I can't figure out is to get the anamorphic stretch 390 should be *12/9 to get the same AR in 16:9. The problem is that 390x12/9 is 540 way above the 480 lines is the DVD frame.
Is this a problem because I came from PAL soure or is my math all wrong?
I'm currently rendering an assume 23.976 mpv file with letterboxing, I'm curious to see how it plays back.
Thanks for all the help so far.
Jeff D
2nd April 2004, 07:44
Ok, render is done and looks jerky.
So I've gone and stepped through the source divx file in vdub and I'm now really confused.
The pattern for the video seems double frames, ie frame 112233445566778899. Each frame shown 2 times. Each frame looks like a full frame. It sounds like this is the source to be played at 50fps with 3:2 pull down film, right?
What should I do? Pull each dup frame, I can't see how that would work right, the timing would be wacked.
Kika
2nd April 2004, 09:10
What did you use as MPEG-Encoder? For a propper Playback of an 23.976 fps NTSC Movie, you need the 3:2-Pulldown Flag in the Stream.
Jeff D
2nd April 2004, 18:09
I used cinemacraft and didn't do a post process pass through pulldown. Would that be the problem?
I'm really concerned because the playback is jerky because of the duplicate frames. This is nothing I've seen during playback on a PC before running through pulldown. But.... this is my first and only experience with both PAL and DIVX source.
aklendathu
2nd April 2004, 18:34
1. Aspect Ratio:
You can always check the result with VDUB (newer versions) Right-click video window and select the desired AR.
True 16.9 is not 1.85:1, rather is 1.77:1 therefore you need to add black bars at top & bottom. Here's how I'd do it:
592x320 (true 1.85:1 on PC screen)
AddBorders(0,6,0,7) -> 592x333 (true 16:9 on PC screen)
LanczosResize(704,480)
AddBorders(8,0,8,0) -> 720x480 NTSC 16:9 Anamorphic (active area is 704x480)
Check the resulting video in VDUB.
2. Frame pattern
Is the frame pattern you see (1122...) on the DivX source ? That's very odd and at first glance would suggest an interlaced source.
In PAL you can have 2:2 pulldown, not 3:2. Look up the decomb filter package by Donald Graft. It has an excellent tutorial on the subject.
Jeff D
2nd April 2004, 19:24
Thanks for both hints. I never heard of 2:2 pulldown, but that sure sounds like what might be going on. I'll read Donald's docs. FWIW I did start to do decomb on the source before thinking that was a dumb move, so that's still in the script and can be added back easily!
I'll give it a shot.
Jeff D
2nd April 2004, 21:25
Ok, tried decomb, but once again.... lack of PAL experience is killing me.
I tried the following script:
LoadPlugin("C:\PROGRA~1\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
LoadPlugin("C:\avsplugs\2.5\decomb\Decomb.dll")
AVISource("F:\clip4.AVI",False)
SSRC (48000)
Telecide(order=0, guide=2, blend=false)
Decimate()
ChangeFPS(23.976, TRUE)
Still the output contains a lot of dups, maybe this is correct... it's tough for me to tell.
I've created a small 700K sample clip if someone could eyeball it and tell me what's going on.
Clip can be found here (http://home.comcast.net/~jeff.davies/video/clip4.avi)
Thanks again!
aklendathu
3rd April 2004, 00:52
Jeff,
OK, Your source clip does seem to have duplicate frames, PAL 2:2 pulldown won't work here because your movie is not interlaced.
Here's what I did with your clip. Try it out if you'd like on a bigger section and burn a test DVD(RW):
-----------------------------------------------
AVISource("I:\TEST\clip4.avi",audio=false)
AddBorders(0,6,0,7)
LanczosResize(704,480)
AddBorders(8,0,8,0)
AssumeFPS(23.976,sync_audio=true)
------------------------------------------------
This will slow down your movie by 5% (its the reverse of the NTSC FILM to PAL speedup conversion). A more precise conversion will necessarily result in an interlaced output but I've no idea how to do it.
Use this AVS to encode your AVI to MPEG-2 - Either specify "23.976 fps" and "3:2 puldown when playback" OR "29.97 fps" and "INVERSE 3:2 pulldown". These settings are for TMPEGENC (you can download a 14-day free trial from www.pegasys-inc.com).
You can't get rid of the duplicate frames because they're already in the source file.
Good luck and don't give up!
Guest
3rd April 2004, 15:23
I used MultiDecimate(pass=1) to analyse the duplicate structure of your clip (which I assume is the unprocessed source video!). There is a perfect pattern of one duplicate every other frame, i.e., the original frames have been doubled. There are no instances of runs of duplicates; they are all singletons. Therefore, you can simply do this:
Decimate(2)
ChangeFPS(23.976)
Another approach is to use a motion-compensated frame interpolator, such as MotionPerfect, after Decimate(2).
aklendathu
3rd April 2004, 16:43
@neuron2:
I'm curious about the solution you propose...
If you remove the duplicates aren't you left with 12.5 fps source ?
By using AssumeFPS() won't AVISynth put back duplicate frames ?
Then again, maybe I'm missing something ... ;)
Guest
3rd April 2004, 16:51
Originally posted by aklendathu
@neuron2:
I'm curious about the solution you propose...
If you remove the duplicates aren't you left with 12.5 fps source ?
By using AssumeFPS() won't AVISynth put back duplicate frames ?
Then again, maybe I'm missing something ... ;) You are confusing AssumeFPS() and ChangeFPS().
Yes, ChangeFPS() will add duplicate frames. By first returning to the original non-duplicated source with Decimate(2), ChangeFPS() can do the best job and create the smoothest result. The difference may not be great here compared to simply applying ChangeFPS() to the undecimated source, I acknowledge.
It is not possible to avoid duplicates here without motion-compensated frame interpolation, as I pointed out.
You could also consider using ConvertFPS().
aklendathu
3rd April 2004, 20:55
Originally posted by neuron2
You are confusing AssumeFPS() and ChangeFPS().
Yes. My mistake.
Jeff D
3rd April 2004, 22:38
Donald, I tried to run the multidecimate filter on the entire clip to see if the double frame pattern is throughout the file. I got done with pass 1 with the creation of mfile.txt and is there an easy way to decode the data?
Thanks
Guest
4th April 2004, 04:43
Send me the mfile.txt and I'll write a little console app to do it for you. I can do that in C in probably less than 3 minutes. :)
Mail it to neuron2@comcast.net and include the word MAGIC (in uppercase) in the subject line to bypass my filters. :sly:
Jeff D
5th April 2004, 08:42
Thanks for the offer, I sent the file.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.