• Haihao Xiang's avatar
    ffmpeg_opt: consider HW acceleration method when selecting decoder · ad67ea9e
    Haihao Xiang authored
    Usually a HW decoder is expected when user specifies a HW acceleration
    method via -hwaccel option, however the current implementation doesn't
    take HW acceleration method into account, it is possible to select a SW
    decoder.
    
    For example:
    $ ffmpeg -hwaccel vaapi -i av1.mp4 -f null -
    $ ffmpeg -hwaccel nvdec -i av1.mp4 -f null -
    $ ffmpeg -hwaccel vdpau -i av1.mp4 -f null -
    [...]
    Stream #0:0 -> #0:0 (av1 (libdav1d) -> wrapped_avframe (native))
    
    libdav1d is selected in this case even if vaapi, nvdec or vdpau is
    specified.
    
    After applying this patch, the native av1 decoder (with vaapi, nvdec or
    vdpau support) is selected for decoding(libdav1d is still used for
    probing format).
    $ ffmpeg -hwaccel vaapi -i av1.mp4 -f null -
    $ ffmpeg -hwaccel nvdec -i av1.mp4 -f null -
    $ ffmpeg -hwaccel vdpau -i av1.mp4 -f null -
    [...]
    Stream #0:0 -> #0:0 (av1 (native) -> wrapped_avframe (native))
    Tested-by: 's avatarMario Roy <marioeroy@gmail.com>
    Signed-off-by: 's avatarHaihao Xiang <haihao.xiang@intel.com>
    Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
    ad67ea9e
Name
Last commit
Last update
..
Makefile Loading commit data...
cmdutils.c Loading commit data...
cmdutils.h Loading commit data...
ffmpeg.c Loading commit data...
ffmpeg.h Loading commit data...
ffmpeg_filter.c Loading commit data...
ffmpeg_hw.c Loading commit data...
ffmpeg_mux.c Loading commit data...
ffmpeg_opt.c Loading commit data...
ffplay.c Loading commit data...
ffprobe.c Loading commit data...
fopen_utf8.h Loading commit data...
objpool.c Loading commit data...
objpool.h Loading commit data...
opt_common.c Loading commit data...
opt_common.h Loading commit data...
sync_queue.c Loading commit data...
sync_queue.h Loading commit data...
thread_queue.c Loading commit data...
thread_queue.h Loading commit data...