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

Jorge Mas jorge.masn at gmail.com
Thu Nov 21 11:54:49 EET 2019


Hello Moritz.

i changed the profile to Main

the profile_idc change to 77, i need it to be 66 which it is profile =
baseline


this is the difference using ffmpeg -i

original video
  libavutil      56. 25.100 / 56. 25.100
  libavcodec     58. 43.100 / 58. 43.100
  libavformat    58. 25.100 / 58. 25.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[h264 @ 000001c19ceda580] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Input #0, h264, from 'original.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive),
1344x968, 25 fps, 25 tbr, 1200k tbn, 50.01 tbc

created:

  libavutil      56. 25.100 / 56. 25.100
  libavcodec     58. 43.100 / 58. 43.100
  libavformat    58. 25.100 / 58. 25.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[h264 @ 00000118abc6a680] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Input #0, h264, from
'McLaren-P16-ExtrinsicCalibration-Front_AT102A_1344x968.jpg.mp4.h264no_head':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive),
1344x968 [SAR 1:1 DAR 168:121], 25 fps, 25 tbr, 1200k tbn, 50 tbc


This is the output of the conversion:
ffmpeg version N-92899-g1dcb5b7dca Copyright (c) 2000-2019 the FFmpeg
developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
--enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid
--enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2
--enable-avisynth --enable-libopenmpt
  libavutil      56. 25.100 / 56. 25.100
  libavcodec     58. 43.100 / 58. 43.100
  libavformat    58. 25.100 / 58. 25.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
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
tbr, 25 tbn, 25 tbc
File '1344x968.jpg.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0000029263bb8340] deprecated pixel format used, make sure you
did set range correctly
[libx264 @ 0000029263673800] using SAR=1/1
[libx264 @ 0000029263673800] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000029263673800] profile Constrained Baseline, level 4.0,
4:2:0, 8-bit
[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
Output #0, mp4, to '1344x968.jpg.mp4':
  Metadata:
    encoder         : Lavf58.25.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
1344x968 [SAR 1:1 DAR 168:121], q=-1--1, 20000 kb/s, 25 fps, 12800 tbn, 25
tbc
    Metadata:
      encoder         : Lavc58.43.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/20000000 buffer size: 0 vbv_delay: -1
frame=  125 fps= 60 q=-1.0 Lsize=    6028kB time=00:00:04.96
bitrate=9955.0kbits/s speed= 2.4x
video:6026kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.021828%
[libx264 @ 0000029263673800] frame I:125   Avg QP:15.53  size: 49362
[libx264 @ 0000029263673800] mb I  I16..4: 59.3%  0.0% 40.7%
[libx264 @ 0000029263673800] coded y,uvDC,uvAC intra: 40.2% 38.9% 21.1%
[libx264 @ 0000029263673800] i16 v,h,dc,p: 64% 20% 10%  7%
[libx264 @ 0000029263673800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 22% 25%  3%
 4%  2%  5%  2%  5%
[libx264 @ 0000029263673800] i8c dc,h,v,p: 61% 23% 13%  3%
[libx264 @ 0000029263673800] kb/s:9872.42
ffmpeg version N-92899-g1dcb5b7dca Copyright (c) 2000-2019 the FFmpeg
developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
--enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid
--enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2
--enable-avisynth --enable-libopenmpt
  libavutil      56. 25.100 / 56. 25.100
  libavcodec     58. 43.100 / 58. 43.100
  libavformat    58. 25.100 / 58. 25.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1344x968.jpg.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.25.100
  Duration: 00:00:05.00, start: 0.000000, bitrate: 9875 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p, 1344x968 [SAR 1:1 DAR 168:121], 9873 kb/s, 25 fps, 25
tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
File '1344x968.jpg.mp4.h264' already exists. Overwrite ? [y/N] y
Output #0, h264, to '1344x968.jpg.mp4.h264':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.25.100
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p, 1344x968 [SAR 1:1 DAR 168:121], q=2-31, 9873 kb/s, 25
fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  125 fps=0.0 q=-1.0 Lsize=    6031kB time=00:00:05.00
bitrate=9881.0kbits/s speed= 384x
video:6031kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.000000%



El mié., 20 nov. 2019 a las 18:44, Carl Eugen Hoyos (<ceffmpeg at gmail.com>)
escribió:

> Am Mi., 20. Nov. 2019 um 16:39 Uhr schrieb Jorge Mas <jorge.masn at gmail.com
> >:
>
> > im trying to generate a video with the same h264 encoding parameters
> > as a video that was given to me.
>
> In addition to what Moritz wrote, I'd like to add that this may not be
> possible depending on the used encoders.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list