VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Hi,

    please respect for cats

    This is my reference source:

    https://www.dropbox.com/s/mbnopa1evongfak/C0049.MXF?dl=0

    I used this commandline to encode in AVC/h264 MP4 the source:

    Code:
    ffmpeg64bitmar2017.exe -threads 12 -y -i c0049.mxf -filter_complex "[0:1] [0:2] amerge" -vf scale=interl=1 -pix_fmt yuv420p -c:v libx264 -profile:v main -level:v 4.1 -g 72 -bf 2 -crf 22 -flags +ildct+ilme -top 1 -c:a aac -b:a 320k -ar 48000 -aspect 16:9 out.MP4
    and this is the result (out.MP4):

    https://www.dropbox.com/s/tiun555oymfd52o/out.MP4?dl=0

    During the transcoding process ffmpeg says:

    Code:
    C:\testMP4\2>ffmpeg64bitmar2017.exe -threads 12 -y -i c0049.mxf -filter_complex "[0:1] [0:2] amerge" -vf scale=interl=1 -pix_fmt yuv420p -c:v libx264 -profile:v main -level:v 4.1 -g 72 -bf 2 -crf 22 -flags +ildct+ilme -top 1 -c:a aac -b:a 320k -ar 48000 -aspect 16:9 out.MP4
    ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 5.4.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
      libavutil      55. 34.100 / 55. 34.100
      libavcodec     57. 64.101 / 57. 64.101
      libavformat    57. 56.100 / 57. 56.100
      libavdevice    57.  1.100 / 57.  1.100
      libavfilter     6. 65.100 /  6. 65.100
      libswscale      4.  2.100 /  4.  2.100
      libswresample   2.  3.100 /  2.  3.100
      libpostproc    54.  1.100 / 54.  1.100
    Guessed Channel Layout for Input Stream #0.1 : mono
    Guessed Channel Layout for Input Stream #0.2 : mono
    Guessed Channel Layout for Input Stream #0.3 : mono
    Guessed Channel Layout for Input Stream #0.4 : mono
    Guessed Channel Layout for Input Stream #0.5 : mono
    Guessed Channel Layout for Input Stream #0.6 : mono
    Guessed Channel Layout for Input Stream #0.7 : mono
    Guessed Channel Layout for Input Stream #0.8 : mono
    Input #0, mxf, from 'c0049.mxf':
      Metadata:
        uid             : d2161c00-2579-05c1-0270-08004602023b
        generation_uid  : d2161c00-2579-05c2-0270-08004602023b
        company_name    : SONY
        product_name    : Opt
        product_version : 1.22
        product_uid     : 060e2b34-0401-0103-0e06-012002010300
        modification_date: 2017-06-21T20:25:53.000000Z
        material_package_umid: 0x060A2B340101010501010D4313000000D00E1C002579058008004602023B0270
        timecode        : 00:29:42:15
      Duration: 00:01:18.88, start: 0.000000, bitrate: 60202 kb/s
        Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:3: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:4: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:5: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:6: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:7: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
        Stream #0:8: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
    [Parsed_amerge_0 @ 0000000002828520] No channel layout for input 1
    [Parsed_amerge_0 @ 0000000002828520] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
    [libx264 @ 00000000025746c0] interlace + weightp is not implemented
    [libx264 @ 00000000025746c0] using SAR=1/1
    [libx264 @ 00000000025746c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 00000000025746c0] profile Main, level 4.1
    [libx264 @ 00000000025746c0] 264 - core 148 r2744 b97ae06 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: 
    cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=tff bluray_compat=0 constrained_intra=0 bframes=2 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=0 keyint=72 keyint_min=7 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'out.MP4':
      Metadata:
        uid             : d2161c00-2579-05c1-0270-08004602023b
        generation_uid  : d2161c00-2579-05c2-0270-08004602023b
        company_name    : SONY
        product_name    : Opt
        product_version : 1.22
        product_uid     : 060e2b34-0401-0103-0e06-012002010300
        modification_date: 2017-06-21T20:25:53.000000Z
        material_package_umid: 0x060A2B340101010501010D4313000000D00E1C002579058008004602023B0270
        timecode        : 00:29:42:15
        encoder         : Lavf57.56.100
        Stream #0:0: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 320 kb/s (default)
        Metadata:
          encoder         : Lavc57.64.101 aac
        Stream #0:1: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
        Metadata:
          file_package_umid: 0x060A2B340101010501010D4313000000D10E1C002579058008004602023B0270
          encoder         : Lavc57.64.101 libx264
        Side data:
          cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream mapping:
      Stream #0:1 (pcm_s24le) -> amerge:in0 (graph 0)
      Stream #0:2 (pcm_s24le) -> amerge:in1 (graph 0)
      amerge (graph 0) -> Stream #0:0 (aac)
      Stream #0:0 -> #0:1 (mpeg2video (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame= 1972 fps= 17 q=-1.0 Lsize=   90788kB time=00:01:18.89 bitrate=9427.4kbits/s speed=0.666x
    video:87674kB audio:3058kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.062236%
    [aac @ 00000000025520e0] Qavg: 1667.579
    [libx264 @ 00000000025746c0] frame I:33    Avg QP:19.80  size:165914
    [libx264 @ 00000000025746c0] frame P:803   Avg QP:22.90  size: 62245
    [libx264 @ 00000000025746c0] frame B:1136  Avg QP:24.01  size: 30210
    [libx264 @ 00000000025746c0] consecutive B-frames: 13.0%  2.2% 84.7%
    [libx264 @ 00000000025746c0] mb I  I16..4: 49.7%  0.0% 50.3%
    [libx264 @ 00000000025746c0] mb P  I16..4:  3.5%  0.0%  6.5%  P16..4: 40.0% 13.3%  9.2%  0.0%  0.0%    skip:27.6%
    [libx264 @ 00000000025746c0] mb B  I16..4:  0.3%  0.0%  0.8%  B16..8: 40.9%  8.1%  2.4%  direct: 3.7%  skip:43.9%  L0:44.0% L1:46.0% BI:10.0%
    [libx264 @ 00000000025746c0] field mbs: intra: 74.1% inter:61.5% skip:56.4%
    [libx264 @ 00000000025746c0] coded y,uvDC,uvAC intra: 66.0% 82.8% 63.0% inter: 14.4% 28.8% 5.7%
    [libx264 @ 00000000025746c0] i16 v,h,dc,p: 44% 23% 16% 17%
    [libx264 @ 00000000025746c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 29% 21%  5%  6%  5%  9%  4%  9%
    [libx264 @ 00000000025746c0] i8c dc,h,v,p: 43% 32% 16%  9%
    [libx264 @ 00000000025746c0] ref P L0: 50.3% 29.4% 11.6%  3.6%  2.7%  2.5%
    [libx264 @ 00000000025746c0] ref B L0: 58.1% 33.1%  5.5%  2.4%  0.5%  0.4%
    [libx264 @ 00000000025746c0] ref B L1: 73.0% 27.0%
    [libx264 @ 00000000025746c0] kb/s:9105.21
    I assume this out.MP4 as the best transcoding. But now I would like to use Elecard Converter Studio 3.6 to create the "same" mp4, with settings that are the maximum close to ffmpeg's setting, if possibile. So that I can act on this settings of Elecard:

    Image
    [Attachment 46257 - Click to enlarge]


    So I wonder: what setting of Elecard can be match with FFmpeg?

    considering that x264/ffmpeg seems use this parameters:

    cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=tff bluray_compat=0 constrained_intra=0 bframes=2 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=0 keyint=72 keyint_min=7 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00

    In the Elecard panel:

    Profile correspond to the 4:2:0 profile so this is ok
    In the Rate controlo: menu shows "constant bitrate" "variable bitrate" and "constant quantizer"

    I think the "constant quantizer" is more closure to the ffmpeg CRF, or I mistake?

    Gop Lenght: what is the value of ffmpeg?

    In Elecard "Deblock mode" have 3 option: "NONE" "Picture" and "Slice", what is the ffmpeg setting?

    In Elecard GOP Structure and B-frames --> Bframes mode show: "ALL disposable" "ALL reference" and "Hierarchical": what is the FFMPEG setting?

    In Elecard have I to check/uncheck the "scene change detection" and ADAPTIVE GOP" box?

    In Elecard --> RDO --> Trellis quantization shown "OFF" "PSNR" and "HVS": what is the ffmpeg setting?
    and wheigted prediction of P and B slices are to check/uncheck?

    In Elecard Rate Control --> LOOCKAHEAD can be set from 0 to 100: what is the ffmpeg setting?

    In Elecard --> Motion Estimation --> Search range can be set to: "31" "63" "127" "255" and "511" : what is the ffmpeg setting?
    and "use out of picture MV" and "use sub block search" have to be check or unchecked?

    In Elecard --> Motion Estimation --> Number of reference frame can be set from "1" to "16": what is the FFmpeg setting?

    In Elecard --> Motion Estimation --> Subpixel Refinement Size can be set "HALF PEL" and "Quarter PEL": what is the FFmpeg setting?



    thanks
    Last edited by marcorocchini; 4th Aug 2018 at 03:37.
    Quote Quote  
  2. Only some libx264 parameters are mapped to ffmpeg syntax - that's why i use private libx264 parameters:
    Code:
    @SET x264opts="qp=12:qpmin=4:level=4.1:ref=0:bframes=0:no-chroma-me=1:subme=2:open_gop=0:keyint=2:sliced_threads=0:slices=-1:bluray_compat=1:pic_struct=1:aud=1:force_cfr=1:cabac=0:threads=auto:no_psnr=1:no_ssim=1:colorprim=bt709:transfer=bt709:colormatrix=bt709:stitchable=1:constrained_intra=0:no-psy=1:scenecut=0:no-deblock=1:aq-mode=0:ipratio=1.1"
    @ffmpeg.exe -y -hide_banner -v 32 -benchmark -i "%1" -c:a copy -bsf:a? aac_adtstoasc -c:v libx264 -preset:v fast -tune:v fastdecode -profile:v high444 -x264opts %x264opts% -x264-params %x264opts% -f mpegts "%~n1_264.ts"
    Or more "normal"

    Code:
    @SET x264opts="crf=%vq%:vbv_maxrate=10240:vbv_bufsize=5120:level=4.0:qpmin=8:ref=3:cabac=1:tff=1:interlaced=0:fake-interlaced=0:no_psnr=1:no_ssim=1:bluray_compat=1:open-gop=0:pic_struct=1:aud=1:nal_hrd=vbr:force_cfr=1:fullrange=off:overscan=show:colorprim=bt709:transfer=bt709:colormatrix=bt709:stitchable=0"
    
    @ffmpeg.exe -hide_banner -v 32 -stats -y -i %name% -sn -dn -vf %vproc% -c:v libx264 -preset faster -tune film -profile:v high -level:v 4.0 -x264opts %x264opts% -x264-params %x264opts% -af %aproc% -flags:a +qscale -c:a libmp3lame -q:a %aq% -f matroska "%~n1_.mkv"
    Quote Quote  
  3. I understand but I need to "match" the parameters of my encoded ffmpeg (out.mp4) in Elecard Converter Studio,

    for example I cannot understand what is the "Gop Lenght" of the ffmpeg's encoded and in particularry:

    1) the Search range of Motion Estimation (ME), alwais in ME the "Number of reference frame" of the ffmpeg encoded
    2) in the Rate Control (RC): the "Lookahed" value of the ffmpeg encoded
    Quote Quote  
  4. Originally Posted by marcorocchini View Post
    I understand but I need to "match" the parameters of my encoded ffmpeg (out.mp4) in Elecard Converter Studio,

    for example I cannot understand what is the "Gop Lenght" of the ffmpeg's encoded and in particularry:

    1) the Search range of Motion Estimation (ME), alwais in ME the "Number of reference frame" of the ffmpeg encoded
    2) in the Rate Control (RC): the "Lookahed" value of the ffmpeg encoded
    https://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping

    ME and ref are two different things - ME describe vector length where ref number of reference frames (important for DPB)

    Rate Control and lookahead are also two different thing - RC describe how bitrate variability is controlled where lookahead describe how many frames mare taken in motion analysis

    ---

    Ok, i see - there are two different things - and site is so slow...not sure why?

    CRF means variable bitrate not constant quantizer - definitely you should read about x264 settings and libx264 ffmpeg mapping
    Last edited by pandy; 4th Aug 2018 at 08:05.
    Quote Quote  
  5. Thank you cat but in what way I can "extract" the parameters of my encoded out.mp4?

    I see that the ffmpeg encoded (out.mp4) have a very good quality, the file size/quality seems to be correspondant to a efficient econding although speed of encodig is little slow:

    ffmpeg encode at 18 fps but the quality is absolutly OK.

    I have try other encoders: Mainconcept Totalcode, Adobe Media encoder, Elecard Converter Studio.. using general presets they work not bad and fast (Adobe Media Encoder works at 50/60 fps) but the quality is absolutly NOT the same of ffmpeg, and really is quite far from ffmpeg.

    In my example, with source C0049.MXF, the central portion of image when is encoded by ffmpeg is fine, is encoded ok. When is encoded usign, for example Adobe Media Encoder it almost seems like it's "raining": not the same quality result. And I cannot find in Adobe Media Encoder advanced setting like ME and RC controls that in ffmpeg are presents.

    FFMPEG have a lot of quality, other program not. Maybe I have not jet learn Adobe Media Encoder but I do not seem to find advanced settings of the AVC encoder like ffmpeg or Elecard Converter Studio.

    I try to understand if I can set Elecard with the same parameters, or at least the most similar, of the ffmpeg encoding.

    So for example, how can I understand the value of "Gop Lenght" of my out.mp4? and overall the ME affect the quality, but I cannot find in my encoded the exact parameters to be trasposed in the Elecard so that the quality of encoding is as similar as possible to the ffmpeg encoding.
    Quote Quote  
  6. Your question require practically to manually match settings from encoder (tools) that i don't have on my computer - have no clue what elecard mean by this or something else - i can only guide you to widely available knowledge related to probably one of the best H.264 implementations existing i.e. x264 - this is the most popular encoder also used by ffmpeg as libx264 (ffmpeg can use also other H.264 codec implementations but i see no point when x264 is available).

    Use http://dev.beandog.org/x264_preset_reference.html ; https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles ; https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels with previously provided links and additionaly use x264.exe --fullhelp to match options... for example number of reference frames is strictly related to your decoder target (HW players are usually quite restricted and they expect BD compatible flag active) and this is related to your level and resolution - check also comparison for x264 where various settings are compared (how they scale with CPU and quality vs bitrate) - commonly medium presets is used so by using it as reference you can decide what is more important to you.
    There is is too many to wrote - your question requiring too much feedback.

    I bet that elecard encoder is based on x264 but they intentionally using different terms to describe same functionality like cbr vs vbr vs constant qp (IMHO constant qp gives by definition variable bitrate video) and ambiguity is intentional.

    I could try to match settings but for single area not for every codec parameter.
    Especially now when i see that forum is under some attack or other issue and it took me like 2 - 3 minutes to refresh/reload page
    Quote Quote  
  7. Elecard and AME AVC are based on Mainconcept SDK . Not all options are exposed in Elecard and AME. But even when you use full SDK version with all options available, you won't come close to compression efficency and quality as x264. Don't bother wasting your time
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!