Log in

View Full Version : Is it possible to determine the preset of an encoding via mediainfo ?


d4rk3n
14th September 2021, 08:58
Hi,

I'm trying to get a better understanding about the encoding world and process, but I can't get to figure out how could it be possible to determine the preset (fast, slow, slower, etc) a video has been encoded.

Here is two example, where I suppose the first one is encoded with at least a slower preset because of ref=5 + analyse=0x3:0x133 (
https://dev.beandog.org/x264_preset_reference.html chapter about Metadata).


Is it possible to determine the preset ?
Which setting would be better in your point of view for an action movie?


Cheers

Example 1 :
cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=60 / lookahead_threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=8631 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00


Example 2 :
cabac=1 / ref=5 / deblock=1:-3:-3 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.25 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-4 / threads=25 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=8049 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:0.75

LoRd_MuldeR
14th September 2021, 21:13
Is it possible to determine the preset of an encoding via mediainfo?

Determine the preset "of an encoding", in the general case? Nope. What is "preset" even supposed to mean, in the general case? :confused:

If we are talking specifically about H.264 (AVC) streams that have been encoded by x264 (http://www.videolan.org/developers/x264.html), then you can determine the x264 settings that were used to create that particular stream, e.g. via MediaInfo.

This is possible, because the x264 encoder software happens to "embed" its settings into the produced H.264 stream as meta data (custom SEI message).

But keep in mind that the effective x264 settings, that were used for a particular encode, are the result of the combination of the selected "--preset" and the selected "--tune" – plus any options that were set manually on top!

Having said that, if you want to figure out the closest preset/tune combination for the particular x264 settings of a given encode, then you should have a look at the x264 help screen:
https://pastebin.com/BVnttbZC

For example, "me=umh" is only used in the "slower" and "slowest" presets, but these presets also use "ref=8" and "ref=16" – which already tells us that none of your examples above exactly matches one of x264's presets :eek:

(Either that, or they were created with some old version of x264; the presets have changed over time)

Which setting would be better in your point of view for an action movie?

As always:

Set "--tune" to whatever matches the type of footage your are encoding, set "--preset" to the slowest preset that you can afford, and finally adjust "--crf" until the resulting quality matches your demands.

That's pretty much it ;)

d4rk3n
14th September 2021, 23:10
thanks a lot for your explanation and the x264 help screen, I'll make some try to play with the settings to get a better understanding.
cheers :)