FFmpeg Невозможно конвертировать между форматами, поддерживаемыми фильтром - PullRequest
0 голосов
/ 29 марта 2020

Я пытаюсь сделать ускоренное графическое преобразование HDR HDR (HDR-> SDR) с помощью ffmpeg и opencl, но продолжаю сталкиваться с этой ошибкой: Impossible to convert between the formats supported by the filter 'Parsed_hwupload_1' and the filter 'auto_scaler_1'.
Я пытался использовать фильтр фильтрации документации с этой командой

ffmpeg -loglevel debug -y -hwaccel cuvid -init_hw_device opencl:0.0 -threads 1 -i \ 
hdr.mkv -filter_complex
"format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010, \
hwdownload,format=p010" \
-c:a copy -scodec copy -c:v hevc_nvenc -preset slow -level 5.1 -rc:v vbr_hq -cq:v \
 19 -b:v 17500k \
-maxrate:v 22000k ~/Desktop/sdr.mkv

, что приводит к этому журналу

Applying option init_hw_device (initialise hardware device) with argument opencl:0.0.
[AVHWDeviceContext @ 0x5587b5542fc0] 1 OpenCL platforms found.
[AVHWDeviceContext @ 0x5587b5542fc0] 1 OpenCL devices found on platform "NVIDIA CUDA".
[AVHWDeviceContext @ 0x5587b5542fc0] 0.0: NVIDIA CUDA / Graphics Device
[AVHWDeviceContext @ 0x5587b5542fc0] The cl_intel_va_api_media_sharing extension is required for QSV to OpenCL mapping.
[AVHWDeviceContext @ 0x5587b5542fc0] QSV to OpenCL mapping not usable.
{{ Shortened }}
[hevc @ 0x5587b60c8e00] Initializing CUDA frames context: sw_format = yuv420p10le, width = 3840, height = 2160
[AVHWFramesContext @ 0x5587b7573f00] Pixel format 'yuv420p10le' is not supported
[hevc @ 0x5587b60c8e00] Error initializing a CUDA frame pool
cuvid hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc @ 0x5587b60c8e00] Error parsing NAL unit #6.
Error while decoding stream #0:0: Operation not permitted
{{ Shortened }}
[Parsed_format_0 @ 0x5587b6330c40] Setting 'pix_fmts' to value 'p010'
[Parsed_tonemap_opencl_2 @ 0x5587b632d3c0] Setting 't' to value 'bt2020'
[Parsed_tonemap_opencl_2 @ 0x5587b632d3c0] Setting 'tonemap' to value 'linear'
[Parsed_tonemap_opencl_2 @ 0x5587b632d3c0] Setting 'format' to value 'p010'
[Parsed_format_4 @ 0x5587b6331d40] Setting 'pix_fmts' to value 'p010'
[graph 0 input from stream 0:0 @ 0x5587b6359f40] Setting 'video_size' to value '3840x2160'
[graph 0 input from stream 0:0 @ 0x5587b6359f40] Setting 'pix_fmt' to value '64'
[graph 0 input from stream 0:0 @ 0x5587b6359f40] Setting 'time_base' to value '1/1000'
[graph 0 input from stream 0:0 @ 0x5587b6359f40] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x5587b6359f40] Setting 'frame_rate' to value '24000/1001'
[graph 0 input from stream 0:0 @ 0x5587b6359f40] w:3840 h:2160 pixfmt:yuv420p10le tb:1/1000 fr:24000/1001 sar:1/1
[format @ 0x5587b6359e00] Setting 'pix_fmts' to value 'yuv420p|nv12|p010le|yuv444p|p016le|yuv444p16le|bgr0|rgb0|cuda'
[auto_scaler_0 @ 0x5587b7581a00] w:iw h:ih flags:'bilinear' interl:0
[Parsed_format_0 @ 0x5587b6330c40] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0'
[auto_scaler_1 @ 0x5587b634e8c0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_tonemap_opencl_2 @ 0x5587b632d3c0] auto-inserting filter 'auto_scaler_1' between the filter 'Parsed_hwupload_1' and the filter 'Parsed_tonemap_opencl_2'
Impossible to convert between the formats supported by the filter 'Parsed_hwupload_1' and the filter 'auto_scaler_1'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0

Я использую cuvid, потому что я не смог заставить ffmpeg скомпилироваться с nvde c поддержка, хотя мой графический процессор поддерживает его. Любая помощь будет оценена!

1 Ответ

0 голосов
/ 17 апреля 2020

Используйте это

C:\ffmpeg\bin\ffmpeg.exe -i video-input.mp4 -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -c:v libx265 -crf 22 -preset medium -tune fastdecode -t 90 video-output.mp4

для получения дополнительной информации прочитайте это https://www.maxvergelli.com/how-to-convert-hdr10-videos-to-sdr-for-non-hdr-devices/

...