Log in

View Full Version : Framerate conversion and related troubles / bugs


kizuna
19th November 2004, 00:16
Hello everyone, I hope someone can help me out.

I've got a bunch of video clips with either 23.976 or 119.880 fps. I want to encode them with TMPGEnc to standard PAL MPEG2 files. First I ran them directly through TMPGEnc but the resulting video was not smooth enough. So I figured I could speed the video up to 25 fps. I used the following simple script:
AVISource ("somefile.avi")
AssumeFPS (25)
For the 120 fps clips I also did a FDecimate (23.976) to bring them down to 24 fps. The result was perfectly smooth but on some videos were too long. Basically, the last frame played for some seconds (up to 30) after the video and audio had stopped. I'd have to manually cut all these files so I looked for another solution since this doesn't seem to be a normal behavior to me. I tried to trim the last frame with Trim (0,framecount-1) and this got rid of some of the extra time but there was still some left in some videos and I felt that I cut too much in others.
I tried to pin down the function that made this. I changed FDecimate to ChangeFPS and removed the AssumeFPS but still the same. Then I tried AVIFileSource and OpenDRMSource insted of AVISource and I didn't have the problem with AVIFileSource but it seems like it's not able to read all of the audio channels from my videos. OpenDRMSource produces the same fault. I also tried DirectShowSource and that worked fine too but it played choppy in MediaPlayer Classic and when I tried to encode it, the video would play much too fast and half through the movie the frame froze and only the audio continued playing.

Is this some kind of bug or is something worng with my codecs or setup? Is there another way that could work?

Mug Funky
19th November 2004, 07:46
hmm. i haven't had this problem with 23.976 stuff. i haven't got any of those weird 120fps avis, so i don't know how they behave.

what is decoding yv12 in your system? xvid or something else? you can find out by going to file properties in Virtualdub.

AS
19th November 2004, 08:14
How about selectevery(5,0) for your 120 fps video?

kizuna
19th November 2004, 13:53
@AS
As I tried to explain, the problem doesn't seem to be related to the individual filters but to the opening of the AVIs for processing. To be sure I also tried your suggestion but no change.

@Mug Funky
All movies are NTSC TV captures. They are all animation and it seems that in some shows parts of the animation are done in different fps (some full 30fps, others only 24fps) and to make sure no frames are missed, they are encoded to 120fps (gcm of both framerates). Though I never really understood exactly why to do this.
YV12 is being deoded by XviD. I uninstalled it and let ffdshow handle the YV12 decoding but no change. The problem seems to be with AviSource.
Some of the videos are DivX and XviD but there are also some WMV9. I checked a few of them to see if there's some correlation with the extra lenght but I couldn't find any. Though I'd need to check more systematically.

lamer_de
20th November 2004, 13:43
I work with 120ps files on a more or less regular basis, and usually the selectevery approach works pretty well to bring the video stream down to 23.976 fps. I dont see how a 24fps->25fps can screw up something afterwards. Be sure to speed up the audio as well, though.

Though I never really understood exactly why to do this.
Because avi can't handle 2 different framerates in the same file. If you decimate everything to 23.976, you get jerking in the 30fps parts (which I personally don't care too much about, using Changefps or the MVtools on those parts only works fairly well), if you encode everything at 29.970 fps you encode quite some overhead frames. That's why the original cappers use 120fps.

Unfortunately for people who want to work with those files afterwards, they're starting to use vfr mkv files, which might delight christianhjw, but as those files can't be converted to avi (because they're vfr, duh), the only way accressing them is via directshowsource, which gives funky effects. You have to supply a framereate argument to dshowsource, so the timeline in vdub is based on that. The segments with higher framecount are not included in the timeline, but get encoded at the framerate specified, so if you encode your file using vdub, there will be a segment you can't access, because the actual framecount which will be encoded is higher than what you can access in vdub. So be lucky you still have those old fashioned 120fps files ;)

CU,
lamer_de