VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. I need to modify my BD authoring workflow somewhat because my intermediates are linear EXR. Therefore, I am trying to build an ffmpeg script that can encode a bluray compatible video without triggering the DVDA recompress setting. So far, no luck. In the past, the following worked fine:

    Code:
    x264 --bitrate 27500 --preset veryslow --tune film --bluray-compat --vbv-maxrate 28000 --vbv-bufsize 27500 --level 4.1 --keyint 60 --open-gop --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 in.avs
    x264 --bitrate 27500 --preset veryslow --tune film --bluray-compat --vbv-maxrate 28000 --vbv-bufsize 27500 --level 4.1 --keyint 60 --open-gop --slices 4 --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.264 in.avs
    where I processed a lossless 4:2:2 1080p29.97 video to 4:2:0 1280x720p59.94 using Avisynth. So, now I am trying to do all that using ffmpeg. This is what I have so far:

    Code:
    ffmpeg -y -t 10 -framerate 30000/1001 -apply_trc iec61966_2_1 -i "e:\in_%06d.exr" -pix_fmt yuv420p -vf scale=w=1280:h=720:out_color_matrix=bt709,setsar=sar=1/1 -sws_flags lanczos+accurate_rnd -sws_dither auto -r 60000/1001 -c:v libx264 -tune film -x264opts bitrate=27500:bluray-compat:vbv-maxrate=28000:vbv-bufsize=27500:level=4.1:keyint=60:open-gop:slices=4:colorprim=bt709:transfer=bt709:colormatrix=bt709:pass=1 -threads 8 -an -f rawvideo NUL
    ffmpeg -t 10 -framerate 30000/1001 -apply_trc iec61966_2_1 -i "e:\in_%06d.exr" -pix_fmt yuv420p -vf scale=w=1280:h=720:out_color_matrix=bt709,setsar=sar=1/1 -sws_flags lanczos+accurate_rnd -sws_dither auto -r 60000/1001 -c:v libx264 -preset veryslow -tune film -x264opts bitrate=27500:bluray-compat:vbv-maxrate=28000:vbv-bufsize=27500:level=4.1:keyint=60:open-gop:slices=4:colorprim=bt709:transfer=bt709:colormatrix=bt709:pass=2 -threads 8 -an e:\out.264
    As you can see there is a bunch of stuff in there related to the linear to Rec.709 conversion as well as 1080p to 720p and framerate, then I throw in all the x264 bluray compatible settings. It seems to work fine, DVDA reads the file but then wants to recompress.

    Here is what Mediainfo says:

    Code:
    General
    Complete name               : E:\out.264
    Format                      : AVC
    Format/Info                 : Advanced Video Codec
    File size                   : 25.3 MiB
    Overall bit rate mode       : Variable
    Writing library             : x264 core 148 r2762 90a61ec
    Encoding settings           : cabac=1 / ref=6 / deblock=1:-1:-1 / analyse=0x3:0x133 / 
    me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / 
    chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / 
    chroma_qp_offset=-3 / threads=8 / lookahead_threads=1 / sliced_threads=0 / 
    slices=4 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / 
    constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / 
    weightb=1 / open_gop=1 / weightp=1 / keyint=60 / keyint_min=1 / scenecut=40 / 
    intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=27500 / 
    ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / 
    qblur=0.5 / vbv_maxrate=28000 / vbv_bufsize=27500 / nal_hrd=vbr / filler=0 / 
    ip_ratio=1.40 / aq=1:1.00
    
    Video
    Format                      : AVC
    Format/Info                 : Advanced Video Codec
    Format profile              : High@L4.1
    Format settings, CABAC      : Yes
    Format settings, ReFrames   : 5 frames
    Bit rate mode               : Variable
    Bit rate                    : 27.5 Mbps
    Maximum bit rate            : 28.0 Mbps
    Width                       : 1 280 pixels
    Height                      : 720 pixels
    Display aspect ratio        : 16:9
    Frame rate mode             : Variable
    Color space                 : YUV
    Chroma subsampling          : 4:2:0
    Bit depth                   : 8 bits
    Scan type                   : Progressive
    Writing library             : x264 core 148 r2762 90a61ec
    Encoding settings           : cabac=1 / ref=6 / deblock=1:-1:-1 / analyse=0x3:0x133 / 
    me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / 
    chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / 
    chroma_qp_offset=-3 / threads=8 / lookahead_threads=1 / sliced_threads=0 / 
    slices=4 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=1 / 
    constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / 
    direct=3 / weightb=1 / open_gop=1 / weightp=1 / keyint=60 / keyint_min=1 / 
    scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / 
    bitrate=27500 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / 
    cplxblur=20.0 / qblur=0.5 / vbv_maxrate=28000 / vbv_bufsize=27500 / 
    nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Color range                 : Limited
    Color primaries             : BT.709
    Transfer characteristics    : BT.709
    Matrix coefficients         : BT.709
    Anyway, please let me know if something looks out of whack in my 2-pass ffmpeg script. TIA.
    Last edited by SameSelf; 26th May 2017 at 12:47.
    Quote Quote  
  2. One problem I see from MediaInfo:
    Variable framerate flag (not allowed on Blu-ray). Try to add "force-cfr" to x264opts.
    Last edited by sneaker; 26th May 2017 at 12:29. Reason: Ok, I tested. Output from ffmpeg and x264cli is bit-identical. Either I misremembered or ffmpeg got changed.
    Quote Quote  
  3. Great catch! That was it! Thanks so much for your eagle eye!
    Last edited by SameSelf; 26th May 2017 at 12:47.
    Quote Quote  



Similar Threads

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