summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_hw.c
Commit message (Collapse)AuthorAge
* fftools/ffmpeg: drop OutputStream.encAnton Khirnov2022-08-29
| | | | | | It is either equal to OutputStream.enc_ctx->codec, or NULL when enc_ctx is NULL. Replace the use of enc with enc_ctx->codec, or the equivalent enc_ctx->codec_* fields where more convenient.
* fftools/ffmpeg_hw: stop logging to the decoder contextAnton Khirnov2022-08-08
| | | | | Only the decoder itself should do that. Use NULL as is done by all other logging code in ffmpeg.
* ffmpeg_hw: make hardware selection for filters more user friendlyHaihao Xiang2021-09-12
| | | | | | | | | | | | | | | | When a device is derived from a source device, there are at least 2 devices, and usually the derived device is the expected device, so let's pick the last device if user doesn't specify the filter device with filter_hw_device option After applying this patch, the command below can work: $> ffmpeg -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device qsv=hw@va -f lavfi -i yuvtestsrc -vf format=nv12,hwupload=extra_hw_frames=64 -c:v h264_qsv -y out.h264 Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg_hw: Don't ignore key parameters when initializing a hw deviceHaihao Xiang2021-08-17
| | | | | | | | | | Currently user may use '-init_hw_device type=name' to initialize a hw device, however the key parameter is ignored when use '-init_hw_device type=name,key=value'. After applying this patch, user may set key parameter if needed. Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* qsvdec: add support for HW_DEVICE_CTX methodHaihao Xiang2021-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows user set hw_device_ctx instead of hw_frames_ctx for QSV decoders, hence we may remove the ad-hoc libmfx setup code from FFmpeg. "-hwaccel_output_format format" is applied to QSV decoders after removing the ad-hoc libmfx code. In order to keep compatibility with old commandlines, the default format is set to AV_PIX_FMT_QSV, but this behavior will be removed in the future. Please set "-hwaccel_output_format qsv" explicitly if AV_PIX_FMT_QSV is expected. The normal device stuff works for QSV decoders now, user may use "-init_hw_device args" to initialise device and "-hwaccel_device devicename" to select a device for QSV decoders. "-qsv_device device" which was added for workarounding device selection in the ad-hoc libmfx code still works For example: $> ffmpeg -init_hw_device qsv=qsv:hw_any,child_device=/dev/dri/card0 -hwaccel qsv -c:v h264_qsv -i input.h264 -f null - /dev/dri/renderD128 is actually open for h264_qsv decoder in the above command without this patch. After applying this patch, /dev/dri/card0 is used. $> ffmpeg -init_hw_device vaapi=va:/dev/dri/card0 -init_hw_device qsv=hw@va -hwaccel_device hw -hwaccel qsv -c:v h264_qsv -i input.h264 -f null - device hw of type qsv is not usable in the above command without this patch. After applying this patch, this command works as expected. Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: Don't require a known device to pass a frames context to an encoderMark Thompson2020-05-03
| | | | | | | | | | | | | | The previous code here did not handle passing a frames context when ffmpeg itself did not know about the device it came from (for example, because it was created by device derivation inside a filter graph), which would break encoders requiring that input. Fix that by checking for HW frames and device context methods independently, and prefer to use a frames context method if possible. At the same time, revert the encoding additions to the device matching function because the additional complexity was not relevant to decoding. Also fixes #8637, which is the same case but with the device creation hidden in the ad-hoc libmfx setup code.
* ffmpeg: Use hardware config metadata with encodersMark Thompson2020-04-26
| | | | | | | This can support encoders which want frames and/or device contexts. For the device case, it currently picks the first initialised device of the desired type to give to the encoder - a new option would be needed if it were necessary to choose between multiple devices of the same type.
* ffmpeg: Make filter hardware device selection clearerMark Thompson2020-04-26
| | | | Also move it into a dedicated function in the hardware file.
* ffmpeg_hw: Treat empty device string as no device settingMark Thompson2019-06-02
| | | | | | | The implementation will use some default in this case. The empty string is not a meaningful device for any existing hardware type, and indeed OpenCL treats it identically to no device already to work around the lack of this setting on the command line.
* ffmpeg_hw: Mark some strings as constMark Thompson2019-06-02
|
* ffmpeg: Use codec hardware config to configure hwaccelsMark Thompson2017-11-26
| | | | | Removes specific support for all hwaccels supported by the generic code (DXVA2, D3D11VA, NVDEC, VAAPI and VDPAU).
* Merge commit 'c95169f0ec68bdeeabc5fde8aa4076f406242524'James Almer2017-10-01
* commit 'c95169f0ec68bdeeabc5fde8aa4076f406242524': build: Move cli tool sources to a separate subdirectory Merged-by: James Almer <jamrial@gmail.com>