Log in

View Full Version : Converting frame rate of a raw AVC/H.264 file with X264 in command line?


broaser
17th December 2014, 11:23
Hi,

I'm new on the forum and I hope I'm posting this question in the right section.

I would like to convert the FPS of a raw AVC/H.264 file with the X264 utility, namely, to convert a 30 fps file down to 25 fps.

I'm aware that a raw .h264 file doesn't have FPS information embedded so it has to be provided externally. I have tried the "--demuxer raw" switch along with the "--fps" but didn't get any result.

VirtualDub does the job nicely when I add X264 as an external encoder (via fraps2.vdprof) but I wonder if this can be done via command line?

Any help would be kindly appreciated, thanks in advance!

xooyoozoo
17th December 2014, 20:54
Like you said the base bitstream format ('raw' refers to an de/uncompressed signal) doesn't have FPS information built-in. The easiest way to (losslessly) choose a new FPS is by muxing the bitstream.

mkvmerge --default-duration -0:25fps $INPUT.264 -o $OUTPUT.mkv

broaser
18th December 2014, 06:17
Thanks for the reply! I'm new to video formats and conversion so sorry for not being able to be more precise...

It seems then it's impossible to do using X264.exe only, it has to be embedded into some container format (that supports FPS information)...

In fact I was hoping to be able to reduce the FPS of videos downloaded from YouTube (downloaded in MP4 format), using X264.exe in a batch file (de/remuxing done with MP4Box)... but I guess I'll have to use VirtualDub then as it passes the stream to X264 in some kind of container.

:thanks:

Selur
22nd December 2014, 14:27
roozhou's patched ffmpeg version should be able to modify raw h.264 content, see: http://forum.doom9.org/showthread.php?t=152419