Log in

View Full Version : How to change the fps of H.264 inside MKV?


Romulus76
4th September 2006, 08:35
Hi all,
I'm trying to change the FPS of a H.264 video stream inside an MKV, from 23.976 to 25... but WITHOUT have to reencoding!!!

How can I make this operation? Someone can help me please?

Thanks,
Romulus.

foxyshadis
4th September 2006, 11:09
Yes, very simply, with a timecode file. Create a text file with this content:

# timecode format v1
Assume 25.0000

Open mkvmerge gui, drop the video in, and add the text file in the timecode slot. Remux to a new name and you're done!

That will only work if the original was of a constant framerate, but that's almost always the case.

bond
4th September 2006, 18:44
moved to where it belongs

Romulus76
6th September 2006, 08:46
Thanks so much :D it's working

DeathTheSheep
21st September 2006, 01:01
Wow, I wish you could do that with AVI :D

foxyshadis
21st September 2006, 09:01
For AVI you just load it into VDubMod, change the FPS, and resave. It's about the same amount of work and time-to-remux. (Alternately you can hex edit the header, which you can't in other formats, but since there are several possible fps fields it tends to break easily.)

DeathTheSheep
22nd September 2006, 00:54
Lol, yup. I just think the remuxing with text commands is spankingly cool. Spankingly! I wonder what other sweet commands can be used in that text file... convertfps, changeAspect, resize, etc... all of which might be things that couldn't be done with other formats without re-encoding, eh?
Or maybe I'm getting ahead of myself...

Yep, I'm gunna have to find me a site all about the different text documents I can mux into mkv...Who knows, maybe I can type my essay in one and mkv will make a movie out of it, yes, of course...
;)

GodofaGap
22nd September 2006, 07:26
Uhh, this is not muxing a text file in the container. The text file is just used to set some header fields or timestamps in the video stream. The text file will not be present in the resulting file.

It is possible to *attach* just about any file to an MKV (even other video files), which is useful for example coverart or fonts, but it is pretty much up to the player what it does with that (if anything).

foxyshadis
22nd September 2006, 09:33
You could attach an avisynth script for a custom media player to use - along with avisynth itself if you're feeling adventurous. In fact, that gives me a good idea: Attaching a set of optimal processing settings for ffdshow to pick up and use. For instance, stripping the noise out of an encode entirely and including a carefully adjusted noise profile for playback. A poor fellah's FGM, but more versatile.

Don't expect this in the near future though. >_o