VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. HumanViewer
    Join Date
    May 2022
    Location
    Finnish
    Search Comp PM
    I want to transcode my bule ray which 4K HDR video to SDR videos through FFmpeg, but there is something looks different result between -vf and -filter_complex, even if used the same numerical command.

    The tested HDR video have the property
    Code:
    "@type": "Video",
    "StreamOrder": "0",
    "ID": "1",
    "UniqueID": "9714518244579198061",
    "Format": "HEVC",
    "Format_Profile": "Main 10",
    "Format_Level": "5.1",
    "Format_Tier": "High",
    "HDR_Format": "SMPTE ST 2086",
    "HDR_Format_Compatibility": "HDR10",
    "CodecID": "V_MPEGH/ISO/HEVC",
    "Duration": "60.143000000",
    "BitRate": "5500827",
    "Width": "3840",
    "Height": "1608",
    "Sampled_Width": "3840",
    "Sampled_Height": "1608",
    "PixelAspectRatio": "1.000",
    "DisplayAspectRatio": "2.388",
    "FrameRate_Mode": "CFR",
    "FrameRate": "23.976",
    "FrameCount": "1442",
    "ColorSpace": "YUV",
    "ChromaSubsampling": "4:2:0",
    "ChromaSubsampling_Position": "Type 2",
    "BitDepth": "10",
    "Delay": "0.000",
    "StreamSize": "41354859",
    "Encoded_Library": "x265 - 2.5+27-0e168bdeb48b:[Windows][GCC 6.2.1][64 bit] 10bit",
    "Encoded_Library_Name": "x265",
    "Encoded_Library_Version": "2.5+27-0e168bdeb48b:[Windows][GCC 6.2.1][64 bit] 10bit",
    "Encoded_Library_Settings": "cpuid=1173503 / frame-threads=4 / numa-pools=16 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=3840x1608 / interlace=0 / total-frames=167640 / level-idc=51 / high-tier=1 / uhd-bd=0 / ref=4 / no-allow-non-conformance / repeat-headers / annexb / aud / hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=1 / keyint=24 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=25 / lookahead-slices=4 / scenecut=40 / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=3 / limit-refs=3 / limit-modes / me=3 / subme=3 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=-3:-3 / no-sao / no-sao-non-deblock / rd=4 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / analysis-reuse-mode=0 / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=17.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / vbv-maxrate=160000 / vbv-bufsize=160000 / vbv-init=0.9 / crf-max=0.0 / crf-min=0.0 / ipratio=1.40 / pbratio=1.30 / aq-mode=1 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=9 / transfer=16 / colormatrix=9 / chromaloc=1 / chromaloc-top=2 / chromaloc-bottom=2 / display-window=0 / master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50) / max-cll=9977,240 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / opt-qp-pps / opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / hdr / hdr-opt / no-dhdr10-opt / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0",
    "Default": "Yes",
    "Forced": "No",
    "colour_description_present": "Yes",
    "colour_description_present_Source": "Container / Stream",
    "colour_range": "Limited",
    "colour_range_Source": "Container / Stream",
    "colour_primaries": "BT.2020",
    "colour_primaries_Source": "Container / Stream",
    "transfer_characteristics": "PQ",
    "transfer_characteristics_Source": "Container / Stream",
    "matrix_coefficients": "BT.2020 non-constant",
    "matrix_coefficients_Source": "Container / Stream",
    "MasteringDisplay_ColorPrimaries": "Display P3",
    "MasteringDisplay_ColorPrimaries_Source": "Stream",
    "MasteringDisplay_Luminance": "min: 0.0050 cd/m2, max: 4000 cd/m2",
    "MasteringDisplay_Luminance_Source": "Stream",
    "MaxCLL": "9977 cd/m2",
    "MaxCLL_Source": "Stream",
    "MaxFALL": "240 cd/m2",
    "MaxFALL_Source": "Stream"
    -vf hdr to sdr
    Code:
    ffmpeg -hide_banner -y \
    -i ./001_red_hevc_3840x1608_60s_yuv420p10le_44MB.mkv -map 0:v:0 -c:v hevc \
    -vf "scale=3840:1608,zscale=t=linear:npl=55,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p" \
    -colorspace "bt709" -color_trc bt709 -color_primaries bt709 \
    -sc_threshold 0 -g 240 -keyint_min 240 -vsync passthrough -preset:v fast \
    -max_muxing_queue_size 9999 -analyzeduration 10M -probesize 50M -movflags faststart \
    ./003_red_hevc_sdr_vf.mkv
    -filter_complex hdr to sdr
    Code:
    ffmpeg -hide_banner -y \
    -i ./001_red_hevc_3840x1608_60s_yuv420p10le_44MB.mkv -map 0:v:0 -c:v hevc \
    -filter_complex "[0:v]scale=3840:1608,zscale=t=linear:npl=55,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=m=bt709:t=bt709:r=tv,format=yuv420p[out]" \
    -map "[out]" \
    -colorspace "bt709" -color_trc "bt709" -color_primaries "bt709" \
    -sc_threshold 0 -g 240 -keyint_min 240 -vsync passthrough -preset:v fast \
    -max_muxing_queue_size 9999 -analyzeduration 10M -probesize 50M -movflags faststart \
    ./002_red_hevc_sdr_fc.mkv
    Clearly, the -vf and -filter_complex executes the same command, but -vf looks closer to HDR, someone don't believe can use the video to try the command
    https://files.videohelp.com/u/302682/001_red_hevc_3840x1608_60s_yuv420p10le_44MB.mkv

    so, guys, I'm so encompassed with the -vf and -filter_complex, thanks someone who can solve it.
    Quote Quote  
  2. When adding '-loglevel trace' and comparing the output of those calls it seems like the filter_complex somehow also handles the audio,...
    Adding '-an' to the command line seems to fix the differences in the text trace output, but it still seems like tonemap doesn't work when using filter_complex.
    No clue why. ¯\_(ツ)_/¯
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. filter complex is used in cases where there is multiple inputs/outputs (and they not match) - it may be some silently called for example sws_scaler conversion somewhere
    Quote Quote  
  4. HumanViewer
    Join Date
    May 2022
    Location
    Finnish
    Search Comp PM
    actually the question has not been sloved until now, but thanks all relpies.
    Quote Quote  



Similar Threads

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