0

I am currently testing a video player with DASH contents and I need to create a certain content with two video tracks: one with parameter @codecs = "avc1.4D4028" and the other one with value @codecs="avc1.4D401F".

After searching for a while I found out this videos are H.264 with main profile. I have been able to create content with @codecs=avc1.4d481f by using this command:

ffmpeg -hide_banner -y -i $IN_VIDEO \
-c:v libx264 -profile:v main -level:v 3.1 $DIR/vid264.mp4


packager \
input=$DIR/vid264.mp4,stream=video,init_segment=$OUTDIR/vid-a-init.m4a,segment_template=$OUTDIR/vid-\$Number\$.m4a \
--generate_static_mpd \
--mpd_output $OUTDIR/manifest.mpd

Also any explanation on those @codecs values would be much appreciated.

Thanks!

2 Answers 2

1

4D4028 is 3 8 bit integers. First is the profile 66 = baseline, 4d = main, and 64 is high. There is a handful of others.

The next byte is a series of constraint flags. Each bit has a different meaning, (sometimes depending on the profile) and is used to enable/disable some features of the encoder.

The last byte is the level multiplied by 10, and converted to hex. For example 3.1 = 1f. The level is an indication of how complex the stream is in terms of macroblocks per second, and maximum bitrate, the full table is on wikipedia

Now here is the bad news. You don't really set these values manually. They are usually calculated automatically by the encoder depending on the input settings and video that you are encoding. For example level is automatically calculated via a depending on the resolution, frame rate and desired bitrate. You can override this value but doing that is incorrect in 99% of cases. (choosing a value to low will break a lot of decoders, too high and decoders may reject the video as unsupported)

So, if you want force that exact codec string you must adjust the source video video restitution/frame rate and encoder presets to force the encoder to use the values you want.

2
  • So I cannot set those flags manually? Should I then try with different video configurations? (Resolutions, bit rates....) Commented Jan 28, 2020 at 8:45
  • I would start by targeting the level. Calculate a resolution and frame rate form that table in Wikipedia. The constraints will be harder (and less important to get rite)
    – szatmary
    Commented Jan 28, 2020 at 11:43
0

It's H.264 Main level 4.0 according to https://developers.google.com/cast/docs/media .

The MPEG-4 Part 10 standard H.264 has Profiles which denote the capabilities of each Profile. Those Profiles have multiple Levels within, commonly labeled Baseline, Extended, Main, and High.

Baseline's used for portable devices (phones).
Main gives you SD quality.
High gives you HD.

Level numbers within each named level give you higher resolution and frame rates.

Multiple different encoding methods which are available in specific Profiles, Levels, and level Numbers yield different results; a video recording engineer might select a specific combination to get the best results when encoding a video. Please remember that in video, like in computing, the wonderful thing about standards is that we have so many of them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .