[FFmpeg-user] encoding H264 from pictures, encoding values manipulation

Moritz Barsnick barsnick at gmx.net
Thu Nov 21 12:15:37 EET 2019

On Thu, Nov 21, 2019 at 10:54:49 +0100, Jorge Mas wrote:
> i changed the profile to Main
> the profile_idc change to 77, i need it to be 66 which it is profile =
> baseline

What are you actually trying to achieve? Do you really need everything
to be identical? Even if you achieve that, the video may still be
different regarding some characteristics, as it's (likely) a different

You are going in to quite deep details, so it might be necessary for
you to get an understanding of these values, and what you need them

> This is the output of the conversion:
> Input #0, image2, from '1344x968.jpg%04d.jpg':
>   Duration: 00:00:05.00, start: 0.000000, bitrate: N/A
>     Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1344x968 [SAR 120:120 DAR 168:121], 25 fps, 25

Ah, so you're trying to create a similar video from JPEG files?

> [libx264 @ 0000029263673800] profile Constrained Baseline, level 4.0, 4:2:0, 8-bit

I don't see why libx264 would create a "Constrained Baseline" profile
video if you tell it to use "-profile Main".

> [libx264 @ 0000029263673800] 264 - core 157 r2935 545de2f - H.264/MPEG-4
> AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html -
> options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1
> psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0
> cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
> lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
> bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=1
> keyint_min=1 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=20.0
> qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00

BTW, these are some of the parameters which may differ from the
original encoder. (Some affect the encoding strategies, some affect the
resulting video.) Do you really understand them all? Do you know which
you want to reproduce?

That said, I don't see how your "original" video has
constraint_set0_flag = 0 while being "Contrained Baseline". As far as
x264 is concerned, this seems like a contradiction.


More information about the ffmpeg-user mailing list