View Full Version : Using IVTC on video with segments with different fps
eriler
30th June 2012, 21:45
Hi,
I've got a DVD source video which i want to encode, however the video has varying framerate, where the first and last parts are telecined progressive animation, and the middle part is interlaced film of real people.
The source is ofcourse 29,970 throughout the entire video.
When i encode it i want it to have 23,976 fps in the first and last parts, and 29.970 in the middle part. I tried various deinterlacers like AnimeIVTC, Tdecimate, QTGMC, but they all created irregularities in the video.
So i'm wondering if it's possible to use normal IVTC and get varying frame rate with the first and last parts 23,976 fps and the middle part 29,970 fps?
eriler
30th June 2012, 23:27
Since i will have both 23,976 and 29,970 fps, i will need to set the final frame rate to VFR.
This thread which i found in the thread you linked to seems interesting, and i will take a look at it tomorrow since it's gotten very late here now: http://forum.doom9.org/showthread.php?t=64314&highlight=Test+Case%2C+VFR
Thanks for the help. I will post back if there is anything more i wonder about as i try to make the vfr encode.
TheFluff
1st July 2012, 03:02
He explicitly stated that he wants VFR so I don't think it's a dilemma at all, and thus your link doesn't answer the question.
@eriler: The automated VFR tools are all pretty bad. Do it by hand: use a deinterlacing filter (such as NNEDI or QTGMC) on the middle part, and a standard IVTC filter on the first and last parts, using trim(). Now assumefps() the middle part to 23.976 fps, combine the three parts again, and create a Matroska v1 timecodes file that states which frame ranges should be played back at which fps. Mux to MKV or MP4 and you're done.
There are tools that can help you with this process, but if you're only going to do this for this one DVD, learning to use the tools would probably take more time than just doing it by hand.
eriler
7th July 2012, 12:19
He explicitly stated that he wants VFR so I don't think it's a dilemma at all, and thus your link doesn't answer the question.
@eriler: The automated VFR tools are all pretty bad. Do it by hand: use a deinterlacing filter (such as NNEDI or QTGMC) on the middle part, and a standard IVTC filter on the first and last parts, using trim(). Now assumefps() the middle part to 23.976 fps, combine the three parts again, and create a Matroska v1 timecodes file that states which frame ranges should be played back at which fps. Mux to MKV or MP4 and you're done.
There are tools that can help you with this process, but if you're only going to do this for this one DVD, learning to use the tools would probably take more time than just doing it by hand.
You're suggesting i first encode the first and last parts by themselves, and then the middle part by itself, and then i join them together?
06_taro
7th July 2012, 19:50
No, TheFluff suggested you to use AssumeFPS to assume all de-interlaced 29.97fps contents as 23.976fps (or vice versa), so they can be appended to IVTCed 23.976fps contents inside avs. Then write a timecodes file to tell x264 the actually fps of each frame when encoding. You only need to encode one avs script with all the frames in it.
eriler
7th July 2012, 21:33
No, TheFluff suggested you to use AssumeFPS to assume all de-interlaced 29.97fps contents as 23.976fps (or vice versa), so they can be appended to IVTCed 23.976fps contents inside avs. Then write a timecodes file to tell x264 the actually fps of each frame when encoding. You only need to encode one avs script with all the frames in it.
But the entire source video is 29.970 fps. If i turn the middle part into 23.976 before IVTCing it, it will still have it's every 5th frame removed, just like the rest of the video, will it not?
manono
7th July 2012, 21:49
But the entire source video is 29.970 fps. If i turn the middle part into 23.976 before IVTCing it, it will still have it's every 5th frame removed, just like the rest of the video, will it not?
No, not when using AssumeFPS. That middle part will be slowed to 23.976fps (without any frames being removed), so it can be joined with the rest. That part's playback speed will be adjusted with the use of a timecode file.
eriler
7th July 2012, 23:42
Ah, ok. I was just afraid it would still have frames removed. If it's like this i will try and dish up a simple avs script tomorrow when i have time to try and encode it.
Just so i don't have to go and figure this out tomorrow, how do i assumefps() one section of the video without doing it to the others? I could probably find out tomorrow, but to save time, i'd be very grateful if someone who knew could quickly tell here while i am asleep. Thank you in advance :)
mirkosp
8th July 2012, 03:06
Quick example:
From the original source, frame 0 to a are 3:2, a+1 to b are 29.97 and b+1 to the end are 3:2 again.
You'd do something like:
mpeg2source("stuff.d2v")
firstclip = trim(0,a).tfm().tdecimate()#or other ivtc
secondclip = trim(a+1,b).assumefps("ntsc_film")
thirdclip = trim(b+1,0).tfm().tdecimate()#or other ivtc
firstclip+secondclip+thirdclip
At this point, the number of frames has decreased. What used to be frame a+1 is now frame x and what used to be frame b is now frame y.
You write a timecode file (you can call it as "stuff.txt") like so:
# timecode format v1
Assume 23.976023976024
x,y,29.97
And give the --tcfile-in "stuff.txt" parameter to x264.
EDIT: Additional info you might find useful. If I'm not mistaken:
x = a*4/5+1
y = a*4/5+b-a
eriler
8th July 2012, 14:02
Hi again,
I have just started a test encode with the script you gave me, thank you very much.
firstclip = trim(0,40407).tfm().tdecimate()#or other ivtc
secondclip = trim(40408,43279).assumefps("ntsc_film")
thirdclip = trim(43280,0).tfm().tdecimate()#or other ivtc
firstclip+secondclip+thirdclip
However, i tried changing it myself, so it would use animeivtc rather than Tdecimate, because in my previous encodes animeivtc worked best (With the other deinterlacers sometimes when the view was panning things far away in the video started moving irregularly (could this be what's called dotcrawling?), though it also happens with animeivtc, it is minimal. Same with some combing, though this i can filter out with decombing. Here's the script i tried changing it to, but it did not work telling me "Video framerate doesn't match":
firstclip = trim(0,40407).assumefps("ntsc_video").AnimeIVTC (mode=1, ifade=false, killcomb=3, aa=0, omode=2, pass=1, cbob=4)
secondclip = trim(40408,43279).assumefps("ntsc_film")
thirdclip = trim(43280,0).assumefps("ntsc_video").AnimeIVTC (mode=1, ifade=false, killcomb=3, aa=0, omode=2, pass=1, cbob=4)
firstclip+secondclip+thirdclip
mirkosp
8th July 2012, 16:28
The problem is that the parameters you're giving AnimeIVTC are telling it to do an automatic VFR, which is not what you want in this case. Use omode=1 and it should work.
That said, if you're really concerned about the quality of the IVTC, you should rather consider using YATTA or manually writing ovr files to have a better control on the ivtc. Automatic IVTC is hit and miss.
eriler
8th July 2012, 20:08
To quote myself:
Hi again,
When the view was panning things far away in the video started moving irregularly (could this be what's called dotcrawling?)
Here is a sample of the problem, if you pay attention to the girl while the view is panning to the left, you'll see odd movements around her outlines:
http://www.mediafire.com/download.php?rqs1obfq7ih9yu4
I tried applying TComb after the deinterlacing, to help get rid of the combing which i also have a littlebit of, however this only made the irregularities worse.
Is there a way to fix this? Is this what is called dotcrawling? It was not like that in the source.
The problem is that the parameters you're giving AnimeIVTC are telling it to do an automatic VFR, which is not what you want in this case. Use omode=1 and it should work.
That said, if you're really concerned about the quality of the IVTC, you should rather consider using YATTA or manually writing ovr files to have a better control on the ivtc. Automatic IVTC is hit and miss.
Even when changing omode to 1 and removing the other parameters behind it, it gives the same error.
Overdrive80
9th July 2012, 01:42
If I remind good, use various instances of animeivtc on same script you get error. Try use it separately.
eriler
15th July 2012, 12:13
AnimeIVTC failed also when only calling it once in the script.
Does anyone know of any way to deal with those irregularities i showed in the clip i posted?
Thanks for all the help so far.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.