View Full Version : encode variable frame rate mkv
supernater
30th March 2010, 18:19
90% of my encodes are anime and I was wondering if there is an avisynth plugin that will enable me to encode my mkv files using a variable frame rate. I would like to do something like encode high motions portions of the movie in 24 fps but lower the fps to 8 fps in portions of the movie that are still or have little to no motion. Is there an avisynth plugin that can do this? Thanks.
osgZach
30th March 2010, 18:35
There is no easy solution to do this, and especially no "magic plugin".
However there is a program called YATTA, that will allow you do to what you want. But some find it difficult to use.
You can get YATTA from here http://ivtc.org/
However there are several plugins you will need. Telecidehints and Fieldhint are probably going to be the hardest to find. However you can probably find them via forum searches.. You'll also need to get DGIndex (to create a D2v and also for the dgdecode DLL), Decomb, TIVTC, and any other usual plugins you may want to use.
AnimeIVTC is a script that can create a good VFR IVTC from most sources, I think that's in the Avisynth usage forum. TIVTC itself can also be used to produce VFR encodes (it should come with example files that show how) but AFAIK both of those methods lack the fine control necesarry to create a VFR file at multiple frame rates (like down to 8fps where you want to specify so). I'm not even sure the newest version of YATTA could do that now that I think about it.. They axed the "True VFR" project type but Stephen R Savage should be able to comment on what YATTA's current possibilities are, if he sees this thread.
In either case, everything I've listed will get you a VFR file of some sort.. Just maybe not as Variable as you desire.
The standard case these days is to create a VFR clip that contains both 23.796 sections and 29.97 sections - with either of those being the base framerate, and the other being the VFR sections listed in a timecodes file.
If you want to go full manual and you don't suck at math and keeping track of stuff, you might be able to create a more variable clip, by using the method outlined in the Matroska VFR proof of concept, thread.
http://forum.doom9.org/showthread.php?t=64314&highlight=Test+Case%2C+VFR
Ghitulescu
31st March 2010, 09:09
And are you sure that your playing device allows VFR?
supernater
31st March 2010, 15:29
And are you sure that your playing device allows VFR?
Hmmmm, good question. I watch movies on my computer but sometimes I transfer them to my xbox which has xbmc. I'm pretty sure that my computer supports vfr but I'll have to check about xbmc.
The reason I'm asking this is because a while back I was compressing some cartoon episodes that didn't have a great deal of "high motion" frames so I was wondering if there where a way to detect parts of the movie with almost no motion and decimate unneeded frames to drop the frame rate to something low (8fps) but then speed it back up in high motion parts of the movie. I guess this would result in a rapid fluctuation between low fps and high fps. I know that some avisynth plugins can detect differences between frames (fdecimate) but I don't think that they can decimate frames that are similar to each other based on a "motion threshold" and output a mkv timecode file that indicates which parts of the movie to slow down due to the removal of frames in order to keep the audio in sync.
osgZach
31st March 2010, 17:36
That's how Avisynth decimation filters work in the first place. They compare frames to remove duplicates. The TIVTC package will make VFR decimated files, as I said before. So that is one way of doing it. I just don't know how "fine" the control over frame rates would be, given its an automatic process. Either way you will end up with a VFR decimated AVI that you can encode to whatever, and a timecodes file to mux with it into the MKV.
If the goal is just to make VFR files then all the tools I've mentioned will suffice at the most basic level. If xbmc supports MKV files, then it should in theory support VFR files too..
However I can't rely on tools like TIVTC package, to make my VFR files. I have to do it through strict defining and cutting of different FPS sections, because my WDTV Live doesn't "like" VFR files generated any other way. Right now I use YATTA as part of the process, but I've been writing a utility that will hopefully end the need for that, and just use TIVTC to collect the stats I need, and then do the rest all by itself, and output a nice AVS script to get my a 30fps VFR file.
If your xbmc doesn't like TIVTC's VFR results for some reason (you can tell by corrupted image, massive stuttering, loss of sync, skipping and jumping then playing fine, then repeating, etc), you will have to try the 30fps (base framerate of the entire file) VFR method to be sure.
Ghitulescu
1st April 2010, 07:49
... I was compressing some cartoon episodes that didn't have a great deal of "high motion" frames so I was wondering if there where a way to detect parts of the movie with almost no motion and decimate unneeded frames to drop the frame rate to something low (8fps) but then speed it back up in high motion parts of the movie. I guess this would result in a rapid fluctuation between low fps and high fps.
Any interframe codec can detect these non-motion parts, since it encodes only the differences between these frames and since these are minimal for non-motion, you won't loose significant bytes, while maintaining the compatibility and the synch, all-together.
osgZach
1st April 2010, 19:04
I don't know about that Stephen.
I admit I know very little about subtitling and its many intricacies, but I could have sworn displaying a subtitle by time range has always been one way to sync, although perhaps more difficult?
Most utilities I have ever played around with, always work by using time codes and not frames as the sync point. Otherwise, how would Dual-Audio w/Subtitle VFR Anime that exists out there, be able to work (pretty much flawlessly) in the first place?
I think it is more a question of patience and skill than anything else.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.