View Full Version : can you explain tearing: mvflowfps. Did not expect bff from info()
Jeremy Duncan
10th March 2009, 07:30
picture showing the data from info(last)
http://thumbnails14.imagebam.com/2951/96e2b429505406.gif (http://www.imagebam.com/image/96e2b429505406)
This picture below is of only info(), no other avisynth used in ffdshow:
http://thumbnails12.imagebam.com/2951/8c710c29506375.gif (http://www.imagebam.com/image/8c710c29506375)
here is a sample clip of the film: link (http://rapidshare.com/files/208645209/sample.zip.html)
Codecs tab
Set Mpeg2 to Libmpeg2, and check "DVD decoding".
Set Avisynth to Avisynth, Raw video to All supported
Subtitles tab, Unchecked
Uncheck "Decode closed captions"
Uncheck "Accept embedded subs"
Uncheck "Accept SSA, ASS, ASS2 Subtitle (experimental)
Vobsub subpage, uncheck Vobsub Enable.
Avisynth tab checked
YV12 checked,
Add FFdshow Video source unchecked,
3:2 Pulldown box: Ignore Pulldown checked,
check Buffer back/Ahead: 0, 3
ffdshow_source()
global idx1 = 10 # global hint by IanB
MT("""
idx1 = idx1 + 1
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0, ml=49)
""",2)
Resize & aspect tab checked
Multiply by:
1.844 (for 1280x720 16:9 aspect ratio)
2.729 (for 1920x1080 16:9 aspect ratio)
Process Pixel aspect ratio internally checked
No aspect ratio correction checked
spline
Luma Sharpen: 0.00
Accurate rounding checked
Queue & Output tab
Queue output samples checked
Output tab
rgb32 checked
high quality yv12 to rgb conversion checked
rgb conversion tab
ycbcr: itu-bt 601
contrast: standard
Output levels: Tv/Projector
Sagekilla
10th March 2009, 18:26
Tearing isn't a problem with MVtools. It would be of trying to play any content that's not evenly divisible into your (I'm guessing LCD, so 60 Hz) display's native refresh rate of 60 Hz. NTSC is 24 fps, so unless you're converting it to 30 fps there will be tearing possible.
Jeremy Duncan
12th March 2009, 19:20
my monitor is a 60hz lcd 1080p tv.
I use the frame doubler script in the first post and I see some tearing.
I want to know if there is some way I can fix the tearing.
Second question is, if the film fps is not a multiple of my lcd refresh rate does this mean I will get tearing?
special note.) My film is from a unripped ntsc dvd, 29.97 fps I believe.
If the frame doubler used the framerate of 29.97 then the tearing should not be happening.
So is the frame doubler using the 23.976 fps on the internal code instead of the 29.97 fps?
And if it is then can I get mvflowfps to use the 29.97 fps instead?
If not can fizick make a upgrade to the plugin that does this?
scharfis_brain
13th March 2009, 00:44
tearing might be a problem of using MT in conjunction with mvtools.
it always is a bad idea to slice a frame you want ot motion compensate!
Jeremy Duncan
13th March 2009, 09:18
I have used the info() function is ffdshow avisynth and it tells me the film is bff.
I was unsure it actually was, so I ripped a sample and made a d2v sample and uploaded a clip for you to see and tell me if it really is bff.
Maybe something is wrong and the ffdshow avisynth is showing bff for a film that is not bff.
scharfis_brain
13th March 2009, 10:05
movies are progressive. so tff or bff is irrelevant.
also you can just set mvflowfps to output 60fps by altering the num und den parameters.
further: have you Read my previous post???
Jeremy Duncan
13th March 2009, 10:47
movies are progressive. so tff or bff is irrelevant.
also you can just set mvflowfps to output 60fps by altering the num und den parameters.
further: have you Read my previous post???
Using my avisynth code in the first post, could you alter it to make the fps 60 instead of 59.94 and post it in a reply, please? :)
I find that using setmtmode(mode=1) and distributor() gives me no tearing at all. The mt type used in the first post does give me tearing though.
I don't use setmtmode(mode=1) because of reasons I forget right now. Either it crashes or it jitters or the warp is giving a bad effect. I forget.
Edit,
This config shows no tearing or instability:
ffdshow_source()
global idx1 = 10 # global hint by IanB
MT("changefps(30)",2)
setmtmode(mode=1)
idx1 = idx1 + 1
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0, ml=49)
distributor()
Every other setting is the same as the first post.
Alex_ander
13th March 2009, 12:38
If you want to set MFlowFPS to 60 fps target, use the explicit 'num=60, den=1' (or num=60000, den=1001 for 59.94). Remove ChangeFPS(30) (this can only add duplicated frames to 23.976).
Jeremy Duncan
14th March 2009, 08:47
after reading the assumefps section here: link (http://avisynth.org/mediawiki/ConvertFPS)
I see there is a error with conversion from 64 bit to 32 bit in the avisynth dll itself.
I did a info(last) both with the assumefps used and not and there is definitely a change.
If I don't use assumefps and double the frame rate I get ntsc_round_double.
If I use assumefps I get ntsc_double.
So you need the assumefps so the conversion doesn't ruin the frame doubler.
My ntsc with assumefps:
ffdshow_source()
MT("
changefps(30000, 1000)
assumefps(30000, 1000, false)
",2)
setmtmode(mode=1)
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0, ml=49)
distributor()
And my pal with assumefps:
ffdshow_source()
MT("
assumefps(25000, 1000, false)
",2)
setmtmode(mode=1)
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0, ml=49)
distributor()
Alex_ander
14th March 2009, 10:49
In case of 23.976 input this way you'll have places with 3 or more repeated frames on output. It will play as 'smoothly' as if you added duplicate frames to 23.976 (which you actually did by changefps(30)) instead of pulldown. If you still want to use fps duplication rather than common MFlowFPS usage (input/output fps values may be in any relationship), better apply changefps(60) in the end (with assumefps(60) if necessary), maximum 2 repeated frames per cycle. Then it will work as smoothly as usual pulldown (+ benefits from interpolation to higher fps).
Jeremy Duncan
14th March 2009, 17:24
In case of 23.976 input this way you'll have places with 3 or more repeated frames on output. It will play as 'smoothly' as if you added duplicate frames to 23.976 (which you actually did by changefps(30)) instead of pulldown. If you still want to use fps duplication rather than common MFlowFPS usage (input/output fps values may be in any relationship), better apply changefps(60) in the end (with assumefps(60) if necessary), maximum 2 repeated frames per cycle. Then it will work as smoothly as usual pulldown (+ benefits from interpolation to higher fps).
Can you post the code your talking about please? :)
Sagekilla
14th March 2009, 19:33
Why do you use such a convoluted script with pointless things also? You don't need idx anymore, MVTools2 no longer uses idx. It has an explicit super clip that serves the same purpose. Don't blindly copy and paste, or you're gonna get a lot of junk that's just unnecessary.
ffdshow_source()
setmtmode(mode=1)
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=60, den=1, mask=0, ml=49)
distributor()
Jeremy Duncan
14th March 2009, 22:04
Sagekilla,
I tried that script. It crashes.
Sagekilla
14th March 2009, 22:14
The only thing I did was take this script, and remove the highlighted portions:
ffdshow_source()
global idx1 = 10 # global hint by IanB
MT("changefps(30)",2)
setmtmode(mode=1)
idx1 = idx1 + 1
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0, ml=49)
distributor()
num and den were set to 60 and 1 respectively, otherwise didn't add anything that wasn't already there. The most likely reason it crashed was because of how SetMTMode works.
Try higher modes and see if it crashes still:
* Mode 1 is the fastest but only works with a few filter.
* Mode 2 should work with most filters but uses more memory.
* Mode 3 should work with some of the filters that doesn't work with mode 2 but is slower.
* Mode 4 is a combination of mode 2 and 3 and should work with even more filter but is both slower and uses more memory
* Mode 5 is slowest but should work with all filters that doesn't require linear frameserving (that is the frames come in order (frame 0,1,2 ... last).
* Mode 6 is a modified mode 5 that might be slightly faster.
Alex_ander
14th March 2009, 23:05
Can you post the code your talking about please? :)
I meant that if you first apply ChangeFPS(30) to 23.976 fps video and then double framerate with MVTools, interpolation will insert 3d duplicated frame between already existing repeated frames. So it would be better instead of ChangeFPS(30) before MFlowFPS to use ChangeFPS(60) after it like this:
#23.976
super = MSuper(pel=1,hpad=16,vpad=16)
backward_vec = MAnalyse(super, blksize=16, isb = true, chroma=false, searchparam=1)
forward_vec = MAnalyse(super, blksize=16, isb = false, chroma=false, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0)
ChangeFPS(60)
#then the inserted frames will not form longer chains
The usual application of MFlowFPS to get 60 from 23.976 looks like this:
#23.976
super = MSuper(pel=2)
backward_vec = MAnalyse(super, isb = true)
forward_vec = MAnalyse(super, isb = false)
MFlowFps(super, backward_vec, forward_vec, num=60, den=1, ml=100)
It works not as fast as with script for double framerate (probably you wanted realtime processing), but this way you could completely avoid duplicated frames. It changes all the frames, not just inserts new ones.
Jeremy Duncan
15th March 2009, 11:06
sagekilla,
I need to use the changefps with your script, or it crashes. It is not too good though.
Alex_ander, your configuration is not too good either. With your configuration I also had to use changefps before mvflowfps.
I had to use the fps from the dvd which is 2997, 100. mvflowfps changed that to 2997, 50.
If I try other configurations it's not too good/stable with the mt I use, setmtmode(mode=1) distribute().
ffdshow_source()
setmtmode(mode=1)
changefps(2997, 100)
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0, ml=49)
distributor()
Alex_ander
15th March 2009, 11:46
I had to use the fps from the dvd which is 2997, 100.
Before any framerate conversion, you need to do inverse telecining (restore film to 23.976 progressive). Your sample of studio logo shows 23.976 pics/s (29.97 fps) in GSpot. This means soft telecining (encoded as 23.976 mpeg with display flags added for 29.97). If main film shows the same in GSpot, you want to import it into AviSynth as 23.976 (e.g. with DGIndex in 'force film' mode), otherwise you'll have 2 interlaced frames in every 5-frame cycle. If the film VOBs show 29.97/29.97 pics/frames per second, you need inverse telecining in AviSynth e.g. with Decomb plugin.
Don't rely on fps numbers determined by DirectShow-based import filters, use AssumeFPS() where necessary.
Jeremy Duncan
15th March 2009, 13:55
Alex_ander,
I have been trying different settings and the one below gives a smooth picture. I don't know how to do the inverse telecine. I just pass the changefps to mvflowfps so it doesn't crash.
I was told by Leak that ffdshow can't use assumefps.
Here is the configuration I made. Note the different queue output samples setting from the first post.
________ advanced ffdshow: framerate doubler. (ntsc 60hz monitor compatible) ________
Codecs tab
Set Mpeg2 to Libmpeg2, and check "DVD decoding".
Set Avisynth to Avisynth, Raw video to All supported
Subtitles tab, Unchecked
Uncheck "Decode closed captions"
Uncheck "Accept embedded subs"
Uncheck "Accept SSA, ASS, ASS2 Subtitle (experimental)
Vobsub subpage, uncheck Vobsub Enable.
Avisynth tab checked
YV12 checked,
Add FFdshow Video source checked,
3:2 Pulldown box: Ignore Pulldown checked,
check Buffer back/Ahead: 0, 2
setmtmode(mode=1)
changefps(30000, 1001)
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2*FramerateNumerator(last), \
den=FramerateDenominator(last), mask=0, ml=49)
distributor()
Resize & aspect tab checked
Multiply by:
1.844 (for 1280x720 16:9 aspect ratio)
2.729 (for 1920x1080 16:9 aspect ratio)
Process Pixel aspect ratio internally checked
No aspect ratio correction checked
spline
Luma Sharpen: 0.00
Accurate rounding checked
Queue & Output tab
Queue output samples unchecked
Very unstable. May cause player to crash.
No box is checked.
Output tab
rgb32 checked
high quality yv12 to rgb conversion checked
rgb conversion tab
ycbcr: itu-bt 601
contrast: standard
Output levels: Tv/Projector
Reclock: Be sure to use reclock vsync
If I don't use reclock vsync it jitters pretty bad on my 60hz lcd tv.
Leak
15th March 2009, 14:22
I don't know how to do the inverse telecine.
Ever heard of "Ignore pulldown" and/or "Smooth timestamps"?
np: The Fireman - Is This Love? (Electric Arguments)
Jeremy Duncan
16th March 2009, 09:32
Well, I tried using dcomb filter to use ivtc to change the fps to 23.976, then ran the mvflowfps in a bunch of different configurations. Some with leak's timestamp ideas.
Nine of them worked, each was either jerky or crashed.
I then tried motion.dll using scharfis brain settings he used at the german doom 9 web site and that had a lot of artifacts.
So I knew I wanted mvflowfps quality but how to get it to go?
So after trying for many hours I just put info(last) by itself with no other code in the ffdshow avisynth tab.
It told me it was 2997, 100.
before I thought it was 30000, 1001
So I set the mvflowfps to 2997, 50 and it worked, but then it crashed. because I was using setmtmode.
So I tried it with the mt the mvtools readme said to use and it did not crash, and it was not jerky. And I did not need to ivtc it. I just used mvtools.
here is the configuration that works. It has tearing, but to remove the tearing just delete the mt code.
Codecs tab
Set Mpeg2 to Libmpeg2, and check "DVD decoding".
Set Avisynth to Avisynth, Raw video to All supported
Subtitles tab, Unchecked
Uncheck "Decode closed captions"
Uncheck "Accept embedded subs"
Uncheck "Accept SSA, ASS, ASS2 Subtitle (experimental)
Vobsub subpage, uncheck Vobsub Enable.
Avisynth tab checked
YV12 checked,
Add FFdshow Video source checked,
3:2 Pulldown box: Ignore Pulldown checked,
check Buffer back/Ahead: 0, 2
MT("""
super = MSuper(pel=2,hpad=8,vpad=8)
backward_vec = MAnalyse(super,chroma=false, blksize=16, overlap=4, isb = true, search=5, searchparam=1)
forward_vec = MAnalyse(super, chroma=false, blksize=16, overlap=4, isb = false, search=5, searchparam=1)
MFlowFps(super, backward_vec, forward_vec, num=2997, den=50, mask=0, ml=49)
""",2)
Resize & aspect tab checked
Multiply by:
1.844 (for 1280x720 16:9 aspect ratio)
2.729 (for 1920x1080 16:9 aspect ratio)
Process Pixel aspect ratio internally checked
No aspect ratio correction checked
spline
Luma Sharpen: 0.00
Accurate rounding checked
Queue & Output tab
Queue output samples unchecked
Very unstable. May cause player to crash.
No box is checked.
Output tab
rgb32 checked
high quality yv12 to rgb conversion checked
rgb conversion tab
ycbcr: itu-bt 601
contrast: standard
Output levels: Tv/Projector
Reclock: Be sure to use reclock vsync
Guest
16th March 2009, 12:51
Well, I tried using dcomb filter to use ivtc to change the fps to 23.976 ... was either jerky ... The clip you posted is definitely 3:2 pulldown and needs IVTC. But it is soft pulldown, so you should use Force Film in DGIndex instead of using an external filter like Decomb. If you use Decomb *and* make the setting below, however, you will be doing IVTC twice, which is guaranteed to produce jerkiness.
3:2 Pulldown box: Ignore Pulldown checked This is where you performed an IVTC apparently without knowing that's what you were doing. Watch out though, as simply ignoring pulldown can destroy audio sync when the pulldown is irregular, as it sometimes is. That's the point of the difference between Force Film and Ignore Pulldown in DGIndex.
Leak
16th March 2009, 12:59
Watch out though, as simply ignoring pulldown can destroy audio sync when the pulldown is irregular, as it sometimes is. That's the point of the difference between Force Film and Ignore Pulldown in DGIndex.
Not really - pulldown in DirectShow is handled by returning frames with alternating lengths; "Ignore pulldown" just returns those exactly as they were, while "Smooth timestamps" averages the frametimes and "Apply pulldown" inserts extra frames - but the timestamps are all directly derived from the timestamps on the input frames so they're not more out of sync as the input already was.
That is - ffdshow's AviSynth filter calculates new timestamps for the returned frames based on the input frames' timestamps and the ratio between the number of input frames and the number of output frames, so it doesn't depend on the actual frame number returned by AviSynth.
Guest
16th March 2009, 13:20
Oh, thank you for that information about DirectShow's implementation.
Still, Jeremy was applying IVTC, even though he was apparently unaware of it.
Leak
16th March 2009, 15:19
Oh, thank you for that information about DirectShow's implementation.
Glad to help. :)
Still, Jeremy was applying IVTC, even though he was apparently unaware of it.
Yeah, that's only going to work with "Apply pulldown", but it should only be needed for hard-telecined video or a video that's flagged incorrectly - like the US Ghost In The Shell TV series DVDs... %&*#@!
Jeremy Duncan
17th March 2009, 13:35
The clip you posted is definitely 3:2 pulldown and needs IVTC. But it is soft pulldown, so you should use Force Film in DGIndex instead of using an external filter like Decomb.
I spent all day working out how to do that. And I made a youtube video showing how I did it.
It works, the video is not jerky. :)
http://www.youtube.com/watch?v=5YFdk4kOSM8
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.