VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Member
    Join Date
    Apr 2014
    Location
    Nederland
    Search Comp PM
    Hi there,

    I'm currently working on a command that lets me convert a full DCP to a x264 high 4.1 MKV file. here's what I have:

    Code:
    ffmpeg -i "VIDEO_INPUT.mxf" -i "AUDIO_INPUT.mxf" -map 0:0 -filter:v "crop=1984:1072:8:4" w=1920 h=1038 -c:v:0 libx264 -preset placebo -crf 14 -map 1:0 -c:a:1 copy -c:a:2 ac3 -ab 640k "OUTPUT.mkv"
    I detected the crop size using ffplay. the error it now gives is:

    Code:
    [NULL @ 0000000008c80680] Unable to find a suitable output format for 'w=1920'
    w=1920: Invalid argument
    is there maybe something wrong with the order it's in?

    I also want it to be high profile 4.1. I usually do these encodes with HandBrake, but I couldn't find the settings that handBrake uses and how to use those settings in ffmpeg. So if some of you have any tips about that, that would be great .

    bye!
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    It is not possible to crop to an amount LARGER than your source. If you start with 1920x1080 or 1920x1038, the resulting values have to be <=, yet you have 1984 in there...

    Scott
    Quote Quote  
  3. looks like ffmpeg syntax error - IMHO this should be like this:
    Code:
    -filter:v "crop=1984:1072:8:4,scale=w=1920:h=1038"
    Quote Quote  
  4. Member
    Join Date
    Apr 2014
    Location
    Nederland
    Search Comp PM
    I start out with a flat video, so 1998x1080, crop it to 1984x1072 and then resize to 1920x1038.
    Quote Quote  
  5. Member
    Join Date
    Apr 2014
    Location
    Nederland
    Search Comp PM
    @pandy works! Thanks! Any advice on high 4.1 x246?
    Quote Quote  
  6. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    If it doesn't pass the parameter (like -crf in your existing command):
    Code:
    -profile high
    you may have to pass libx264 specific parameters, probably like:
    Code:
    -x264opts "profile=high"
    (according to the recent help output, the first variant should work, but no warranty).

    Regarding Level 4.1, you should usually not use such a parameter because it won't ensure that encoding limits are used, just that this level is put in the header; instead, use VBV limits matching this desired level to guide the encoder in utilizing the available bitrate range.
    Quote Quote  
  7. Originally Posted by arthurm View Post
    @pandy works! Thanks! Any advice on high 4.1 x246?
    part from one of my scripts (DOS, Win CMD):

    Code:
    @SET x264opts="bframes=2:bitrate=%vbitrate%:vbv-maxrate=%vbitrate%:vbv-bufsize=%vbuffsiz%:no-scenecut:nal-hrd=cbr:slices=4:tff=1:open-gop=0:colorprim=bt470bg:transfer=bt470bg:colormatrix=bt470bg:fullrange=off:overscan=show:pic-struct:aud:force-cfr:level=4.1:keyint=%gop%:keyint_min=%gop%:qpmin=4:cabac=1:threads=auto:no-psnr:no-ssim:bluray-compat"
    and

    Code:
    @ffmpeg -i %1 -c:v libx264 -preset veryfast -tune fastdecode -profile:v high -x264opts %x264opts% -x264-params %x264opts%  ...
    feel free to modify
    Quote Quote  
  8. Member
    Join Date
    Apr 2014
    Location
    Nederland
    Search Comp PM
    thanx, I now have written this command:
    Code:
    ffmpeg -i "VIDEO_INPUT.mxf" -i "AUDIO_INPUT.mxf" -map 0:0 –map 1:0 -filter:v "crop=1984:1072:8:4,scale=w=1920:h=1038" -c:v:0 libx264 -preset medium -profile:v high -level 4.1 -crf 17 –maxrate 62.5M –bufsize 78.125M -x264opts keyint=240 -pix_fmt yuv420p -map 1:0 -c:a:0 copy -c:a:1 ac3 -ab 640k –map_metadata -1  "OUTPUT.mkv"
    I tried to use the same encoding settings as Handbrake.

    Here's the media info of a video I encoded with Handbrake:
    Code:
    General
    Format                                   : Matroska
    Format version                           : Version 4 / Version 2
    File size                                : 322 MiB
    Duration                                 : 1mn 50s
    Overall bit rate                         : 24.5 Mbps
    Writing application                      : Lavf56.36.100
    Writing library                          : Lavf56.36.100
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Width                                    : 1 920 pixels
    Height                                   : 1 036 pixels
    Display aspect ratio                     : 1.85:1
    Frame rate mode                          : Constant
    Frame rate                               : 23.976 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Writing library                          : x264 core 142 r2479 dd79a61
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / 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=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=14.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Default                                  : Yes
    Forced                                   : No
    
    Audio #1
    ID                                       : 2
    Format                                   : PCM
    Codec ID                                 : A_PCM/INT/LIT
    Duration                                 : 1mn 50s
    Bit rate mode                            : Constant
    Channel(s)                               : 6 channels
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 24 bits
    Delay relative to video                  : 3ms
    Default                                  : No
    Forced                                   : No
    
    Audio #2
    ID                                       : 3
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Format settings, Endianness              : Big
    Codec ID                                 : A_AC3
    Duration                                 : 1mn 50s
    Bit rate mode                            : Constant
    Bit rate                                 : 640 Kbps
    Channel(s)                               : 6 channels
    Channel positions                        : Front: L C R, Side: L R, LFE
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Delay relative to video                  : 11ms
    Stream size                              : 8.40 MiB (3%)
    Default                                  : No
    Forced                                   : No
    And here is the media-info of a video I encoded with this tool:
    Code:
    General
    Format                                   : Matroska
    Format version                           : Version 4 / Version 2
    File size                                : 455 MiB
    Duration                                 : 2mn 24s
    Overall bit rate                         : 26.3 Mbps
    Writing application                      : Lavf56.36.100
    Writing library                          : Lavf56.36.100
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Width                                    : 1 920 pixels
    Height                                   : 1 038 pixels
    Display aspect ratio                     : 1.85:1
    Frame rate mode                          : Variable
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Writing library                          : x264 core 146 r2538 121396c
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / 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=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=17.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Default                                  : Yes
    Forced                                   : No
    
    Audio #1
    ID                                       : 2
    Format                                   : PCM
    Codec ID                                 : A_PCM/INT/LIT
    Duration                                 : 2mn 24s
    Bit rate mode                            : Constant
    Channel(s)                               : 6 channels
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 24 bits
    Delay relative to video                  : 5ms
    Default                                  : Yes
    Forced                                   : No
    
    Audio #2
    ID                                       : 3
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Format settings, Endianness              : Big
    Codec ID                                 : A_AC3
    Duration                                 : 2mn 24s
    Bit rate mode                            : Constant
    Bit rate                                 : 640 Kbps
    Channel(s)                               : 6 channels
    Channel positions                        : Front: L C R, Side: L R, LFE
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 32 bits
    Compression mode                         : Lossy
    Stream size                              : 11.0 MiB (2%)
    Writing library                          : Lavc56.41.100 ac3
    Default                                  : Yes
    Forced                                   : No
    As you can see I used different videos, that's probably (hopefully) why I had to use different CRF values. I triend to use the settings from the encoding settings from Handbrake, here are the settings from handbrake and ffmpeg:

    Code:
     HB: cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=14.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    FF:  cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / 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=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=17.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    @pandy:

    Is this kind of simular to what you suggested? And how do I enable the first script you posted? I don't really know how to do that yet...

    I'll try to do the encode the same video with both handbrake and FFmpeg soon for comparison.

    Greets!
    Quote Quote  
  9. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    The tool is called "Handbrake", just like this device which stops a car: a brake.

    Breaking your hand is not intended.
    Quote Quote  
  10. Member
    Join Date
    Apr 2014
    Location
    Nederland
    Search Comp PM
    whoops... fixed it
    Quote Quote  
  11. Originally Posted by arthurm View Post
    @pandy:

    Is this kind of simular to what you suggested? And how do I enable the first script you posted? I don't really know how to do that yet...

    My examples are from same script - only because script is more complex and focus on other things than transcode i didn't provided it fully.
    After modification those examples may look in Your script like this: [beware - i had no possibility to verify script with your files and also my scripting skills are not good]

    Code:
    @SET x264opts="vbv_maxrate=62500:vbv_bufsize=78125:slices=4:open_gop=0:pic_struct=1:aud=1:force_cfr=1:level=4.1:keyint=240:cabac=1:threads=auto:no_psnr=1:no_ssim=1:bluray_compat=1:colorprim=bt709:transfer=bt709:colormatrix=bt709"
    
    @ffmpeg -i "VIDEO_INPUT.mxf" -i "AUDIO_INPUT.mxf" -map 0:0 –map 1:0 -filter:v "crop=1984:1072:8:4,scale=w=1920:h=1038:sws_flags=spline:sws_dither=a_dither,format=pix_fmts=yuv420p" -c:v:0 libx264 -preset medium -tune film -profile:v high -crf 17 -x264opts %x264opts% -x264-params %x264opts% -map 1:0 -c:a:0 copy -c:a:1 ac3 -ab 640k –map_metadata -1 "OUTPUT.mkv"
    You may ask why -x264opts and -x264-params are used for exactly same thing i.e. passing parameters in ffmpeg to xlib264 - from some reason sometimes using only one of them may not work fully as expected - i've learned that passing parameters (same) trough both eliminate sometimes surprises.
    Last edited by pandy; 18th Sep 2015 at 03:25.
    Quote Quote  



Similar Threads

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