I'm trying to prepare NTSC film (23.976) footage for PAL (25 fps) playback without resorting to the simple speed-up technique or frame duplication (pulldown). I prefer frame blending in this particular scenario.
AVISynth's ConvertFPS function is blending almost every frame, but I'd like to experiment with blending only two frames each second to maintain the original NTSC running time. Is there a method for blending select frames within AVISynth? Something like blending frame #23 and #24 every 1 second, so that frame #24 becomes #25:
... Fr22 | Fr23 | Fr23+24 | Fr24 ...
+ Reply to Thread
Results 1 to 10 of 10
-
-
Try this:
AssumeFPS(24)
c1 = ChangeFPS(25)
c2 = Trim(0,-1)+Trim(1,0).ChangeFPS(25)
Merge(c1,c2)
I think this actually blends frames 0 and 1 in every 24, but the effect is the same.
Since your scheme only makes sense for 24 fps (not 23.976), I've added Assume(FPS(24). -
This should get you what you want assuming your avi files is progressive.
avisource("progressive24fps.avi")
assumefps(24,1,sync_audio=true)
v1=changeFPS(48)
v2=trim(v1,1,0)
overlay(v1,v2,mode="blend",opacity=0.5)
selectevery(48,0,2,4,6,8,10,12,14,16,18,20,22,24,2 6,28,30,32,34,36,38,40,42,44,46,47)
assumefps(25,1,sync_audio=true)
resampleaudio(44100)
bicubicresize(720,576)
or
avisource("progressive24fps.avi")
assumefps(24,1,sync_audio=true)
v1=changeFPS(48).selectevery(2)
v2=convertFPS(48).selectevery(2,1)
interleave(v1,v2)
selectevery(48,0,2,4,6,8,10,12,14,16,18,20,22,24,2 6,28,30,32,34,36,38,40,42,44,46,47)
assumefps(25,1,sync_audio=true)
resampleaudio(44100)
bicubicresize(720,576)
What these do is double the framerate by duplicating the frames, creating a duplicate clip and offsetting it by 1 frame then overlaying these 2 clips. This produces a clip where one frame is an overlay of the same frame (unblended frame), and the next frame is a blend of two adjacent frames. It then selects 24 of the unblended frames and one of the blended frames giving you 25fps video.Last edited by Khaver; 22nd Jun 2010 at 15:26.
-
Thanks to both of you. Your code examples are very helpful.
The original audio assumes the 23.976 rate, so I'll either have to work in some additional frame correction or resample the audio to run several seconds faster over the course of the entire content (approximately 2 hrs). In this case the speed-up would be only 0.1% !!! -
My code should take into account the audio changes. That's what the sync_audio=true is for. The first one takes care of the 23.97 to 24 change and the last one takes care of the 24 to 25 change. The resampleaudio just converts it back to a standard samplerate. Put whatever you need in there.
-
That's right, but in fact the second AssumeFPS is redundant in both your scripts as the preceding SelectEvery has already produced a framerate of 25fps.
There was a slight bug in my version. Here is a correction, incorporating audio speedup similar to Khaver.
AssumeFPS(24, sync_audio=true).ResampleAudio(AudioRate())
c1 = ChangeFPS(25)
c2 = Trim(0,-1).AssumeFPS(25)+Trim(1,0).ChangeFPS(25)
Merge(c1,c2) -
DGPulldown doesn't duplicate one frame every second but 2 fields every second, resulting in smoother playback. And in my opinion the result will look better than will adding a blurred frame every second which will result in an unnatural looking 'strobing' effect.
-
DGPulldown was my first method (23.976 > 25), and the results did not look better. I was seeing a 2-jerk/sec effect, which looks terrrible on panning shots and closing credits. It actually looks worse in my opinion than the typical pulldown effect we see on NTSC DVDs.
You're assuming the single blend frame will produce some monstruous blurr every second. It does not. Most of the blend frames throughout the movie are undetectable. Or lets just say, the frequency of prominent blur artifacts is much, much lower than the frequency of jerks.This alone makes this method worth pursuing.
Thanks again for all the comments and thoughts. -
Using your expertise and suggestions, here's what I ended up with:
AVISource("progressive_video_23.976.avi", audio=false)
f1=ChangeFPS(24)
f2=Trim(0,-1).AssumeFPS(24)+Trim(1,0).ChangeFPS(24)
Film=Merge(f1,f2)
p1=ChangeFPS(Film,25)
p2=Trim(Film,0,-1).AssumeFPS(25) + Trim(Film,1,0).ChangeFPS(25)
Pal=Merge(p1,p2)
Return Pal
The second section then brings to the footage to PAL rate, but with the original running time.
In the end, the newly converted PAL version presents a running time that is only ~20 msec faster than the NTSC original! This error is less than the duration of a single video frame, so no audio adjustments are need. The original A/V sync is preserved. -
Similar Threads
-
MeGUI/AviSynth automatically changing frame rate to 17.843
By Hakuromatsu in forum Video ConversionReplies: 9Last Post: 14th Jun 2013, 01:48 -
is it possible to do blend mode to color like photoshop? in avisynth or vd
By kopmjj in forum RestorationReplies: 6Last Post: 24th Apr 2010, 09:28 -
Slo-mo & frame blend, deinterlace, flicker, export settings, lions, tigers
By ivanarias in forum EditingReplies: 3Last Post: 24th Feb 2010, 22:35 -
Seeking avisynth function for "blend-a-field" idea
By vhelp in forum EditingReplies: 2Last Post: 21st Sep 2008, 20:52 -
How do I edit the frame rate of a selection of frames in VirtualDubMod?
By manilow in forum RestorationReplies: 4Last Post: 21st Dec 2007, 22:12