Log in

View Full Version : Tool to find x264 encoding parameters?


DreckSoft
13th December 2023, 13:41
I'm trying to add credits to an existing video file. For this to work, the encoding parameters need to match (I don't want to reencode everything).

I can get CABAC / ref-frames from media info but matching thiose is not enough.

Is there any tool that can read or guess the correct parameters from a video file?

Selur
13th December 2023, 15:17
a. If your video was encoded with x264 the encoding settings should be available in the headers too (unless someone removed them).
b. you could also use h264_parse on the raw .264 stream to get enough data to create compatible streams with x264 (assuming the stream isn't paff encoded); worked for me in MKVCutter.

DreckSoft
13th December 2023, 18:39
Unfortunately that's an old HDTV recording with strange parameters
Main profile, CABAC, 2 ref frames is what I've got.

h264parse from gStreamer? That seems awfully complex software.

Selur
13th December 2023, 20:09
No, h264_parse from mpeg4ip, see: https://github.com/timmattison/h264_parse

ivanb
14th December 2023, 08:35
Is there any tool that can read or guess the correct parameters from a video file?
You can use VTCLab Media Analyzer (https://media-analyzer.pro) (or just `mediainfo --Details=1`) to get SPS/PPS parameters, but then you'll have to figure out how to translate them into x264 options

DreckSoft
15th December 2023, 14:24
No luck so far. The original file seems to use really strange parameters and I can't read anything useful from those programs.