so, it looks like qsv integration a bit harder than just adding few lines ....
got answer from ffmpeg devs https://ffmpeg.org//pipermail/ffmpeg-devel/2024-September/333906.html
Den 24.09.2024 22:20, skrev Andrew Randrianasulu via Cin:
got answer from ffmpeg devs
https://ffmpeg.org//pipermail/ffmpeg-devel/2024-September/333906.html
But will it be hard to enable Cingg "presets" to utilize hwaccels like QSV decoding/encoding via the unbundled built via QSV-enabled system FFmpeg? ffmpeg -hide_banner -codecs | grep qsv DEV.L. av1 Alliance for Open Media AV1 (decoders: libdav1d libaom-av1 av1 av1_cuvid av1_qsv) (encoders: libaom-av1 librav1e libsvtav1 av1_nvenc av1_qsv av1_amf av1_vaapi) DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv libopenh264 h264_cuvid) (encoders: libx264 libx264rgb libopenh264 h264_amf h264_nvenc h264_qsv h264_v4l2m2m h264_vaapi) DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_v4l2m2m hevc_cuvid) (encoders: libx265 hevc_amf hevc_nvenc hevc_qsv hevc_v4l2m2m hevc_vaapi) DEVIL. mjpeg Motion JPEG (decoders: mjpeg mjpeg_cuvid mjpeg_qsv) (encoders: mjpeg mjpeg_qsv mjpeg_vaapi) DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m mpeg2_qsv mpeg2_cuvid) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi) D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_qsv vc1_v4l2m2m vc1_cuvid) DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx vp8_cuvid vp8_qsv) (encoders: libvpx vp8_v4l2m2m vp8_vaapi) DEV.L. vp9 Google VP9 (decoders: vp9 vp9_v4l2m2m libvpx-vp9 vp9_cuvid vp9_qsv) (encoders: libvpx-vp9 vp9_vaapi vp9_qsv) Applied decoding benchmarks examples from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#Decode-only ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv420p+opus.mp4 -f null - frame= 1781 fps=1745 q=-0.0 Lsize=N/A time=00:01:11.24 bitrate=N/A speed=69.8x ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv422p10le_SR.mp4 -f null - frame= 1779 fps=1351 q=-0.0 Lsize=N/A time=00:01:11.16 bitrate=N/A speed=54.1x
ср, 25 сент. 2024 г., 00:55 Terje J. Hanssen <[email protected]>:
Den 24.09.2024 22:20, skrev Andrew Randrianasulu via Cin:
got answer from ffmpeg devs
https://ffmpeg.org//pipermail/ffmpeg-devel/2024-September/333906.html
But will it be hard to enable Cingg "presets" to utilize hwaccels like QSV decoding/encoding via the unbundled built via QSV-enabled system FFmpeg?
you can try to copy vaapi profiles under new name, then replace codec_vaapi for codec_qsv and see how it goes .... I just did the same for mediacodec, seems to work but unsure if you need additional patch I have in tree here ...
ffmpeg -hide_banner -codecs | grep qsv DEV.L. av1 Alliance for Open Media AV1 (decoders: libdav1d libaom-av1 av1 av1_cuvid av1_qsv) (encoders: libaom-av1 librav1e libsvtav1 av1_nvenc av1_qsv av1_amf av1_vaapi) DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv libopenh264 h264_cuvid) (encoders: libx264 libx264rgb libopenh264 h264_amf h264_nvenc h264_qsv h264_v4l2m2m h264_vaapi) DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_v4l2m2m hevc_cuvid) (encoders: libx265 hevc_amf hevc_nvenc hevc_qsv hevc_v4l2m2m hevc_vaapi) DEVIL. mjpeg Motion JPEG (decoders: mjpeg mjpeg_cuvid mjpeg_qsv) (encoders: mjpeg mjpeg_qsv mjpeg_vaapi) DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m mpeg2_qsv mpeg2_cuvid) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi) D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_qsv vc1_v4l2m2m vc1_cuvid) DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx vp8_cuvid vp8_qsv) (encoders: libvpx vp8_v4l2m2m vp8_vaapi) DEV.L. vp9 Google VP9 (decoders: vp9 vp9_v4l2m2m libvpx-vp9 vp9_cuvid vp9_qsv) (encoders: libvpx-vp9 vp9_vaapi vp9_qsv)
Applied decoding benchmarks examples from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#Decode-only
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv420p+opus.mp4 -f null - frame= 1781 fps=1745 q=-0.0 Lsize=N/A time=00:01:11.24 bitrate=N/A speed=69.8x
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv422p10le_SR.mp4 -f null - frame= 1779 fps=1351 q=-0.0 Lsize=N/A time=00:01:11.16 bitrate=N/A speed=54.1x
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually. ср, 25 сент. 2024 г., 01:02 Andrew Randrianasulu <[email protected]>:
ср, 25 сент. 2024 г., 00:55 Terje J. Hanssen <[email protected]>:
Den 24.09.2024 22:20, skrev Andrew Randrianasulu via Cin:
got answer from ffmpeg devs
https://ffmpeg.org//pipermail/ffmpeg-devel/2024-September/333906.html
But will it be hard to enable Cingg "presets" to utilize hwaccels like QSV decoding/encoding via the unbundled built via QSV-enabled system FFmpeg?
you can try to copy vaapi profiles under new name, then replace codec_vaapi for codec_qsv and see how it goes .... I just did the same for mediacodec, seems to work but unsure if you need additional patch I have in tree here ...
ffmpeg -hide_banner -codecs | grep qsv DEV.L. av1 Alliance for Open Media AV1 (decoders: libdav1d libaom-av1 av1 av1_cuvid av1_qsv) (encoders: libaom-av1 librav1e libsvtav1 av1_nvenc av1_qsv av1_amf av1_vaapi) DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv libopenh264 h264_cuvid) (encoders: libx264 libx264rgb libopenh264 h264_amf h264_nvenc h264_qsv h264_v4l2m2m h264_vaapi) DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_v4l2m2m hevc_cuvid) (encoders: libx265 hevc_amf hevc_nvenc hevc_qsv hevc_v4l2m2m hevc_vaapi) DEVIL. mjpeg Motion JPEG (decoders: mjpeg mjpeg_cuvid mjpeg_qsv) (encoders: mjpeg mjpeg_qsv mjpeg_vaapi) DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m mpeg2_qsv mpeg2_cuvid) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi) D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_qsv vc1_v4l2m2m vc1_cuvid) DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx vp8_cuvid vp8_qsv) (encoders: libvpx vp8_v4l2m2m vp8_vaapi) DEV.L. vp9 Google VP9 (decoders: vp9 vp9_v4l2m2m libvpx-vp9 vp9_cuvid vp9_qsv) (encoders: libvpx-vp9 vp9_vaapi vp9_qsv)
Applied decoding benchmarks examples from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#Decode-only
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv420p+opus.mp4 -f null - frame= 1781 fps=1745 q=-0.0 Lsize=N/A time=00:01:11.24 bitrate=N/A speed=69.8x
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv422p10le_SR.mp4 -f null - frame= 1779 fps=1351 q=-0.0 Lsize=N/A time=00:01:11.16 bitrate=N/A speed=54.1x
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch . # git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing make install > make_install.log 2&1 [1] 21180 1: command not found localhost:/home/cinelerra/cinelerra-5.1 # make: *** No rule to make target '2'. Stop. ^C [1]+ Exit 2 make install 2 > make_install.log attach make_install.log with an email. Qsv test 1: ----------------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv Cingg render error: libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished.
ср, 25 сент. 2024 г., 01:02 Andrew Randrianasulu <[email protected]>:
ср, 25 сент. 2024 г., 00:55 Terje J. Hanssen <[email protected]>:
Den 24.09.2024 22:20, skrev Andrew Randrianasulu via Cin: > > got answer from ffmpeg devs > > https://ffmpeg.org//pipermail/ffmpeg-devel/2024-September/333906.html > > >
But will it be hard to enable Cingg "presets" to utilize hwaccels like QSV decoding/encoding via the unbundled built via QSV-enabled system FFmpeg?
you can try to copy vaapi profiles under new name, then replace codec_vaapi for codec_qsv and see how it goes .... I just did the same for mediacodec, seems to work but unsure if you need additional patch I have in tree here ...
ffmpeg -hide_banner -codecs | grep qsv DEV.L. av1 Alliance for Open Media AV1 (decoders: libdav1d libaom-av1 av1 av1_cuvid av1_qsv) (encoders: libaom-av1 librav1e libsvtav1 av1_nvenc av1_qsv av1_amf av1_vaapi) DEV.LS <http://DEV.LS> h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv libopenh264 h264_cuvid) (encoders: libx264 libx264rgb libopenh264 h264_amf h264_nvenc h264_qsv h264_v4l2m2m h264_vaapi) DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_v4l2m2m hevc_cuvid) (encoders: libx265 hevc_amf hevc_nvenc hevc_qsv hevc_v4l2m2m hevc_vaapi) DEVIL. mjpeg Motion JPEG (decoders: mjpeg mjpeg_cuvid mjpeg_qsv) (encoders: mjpeg mjpeg_qsv mjpeg_vaapi) DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m mpeg2_qsv mpeg2_cuvid) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi) D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_qsv vc1_v4l2m2m vc1_cuvid) DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx vp8_cuvid vp8_qsv) (encoders: libvpx vp8_v4l2m2m vp8_vaapi) DEV.L. vp9 Google VP9 (decoders: vp9 vp9_v4l2m2m libvpx-vp9 vp9_cuvid vp9_qsv) (encoders: libvpx-vp9 vp9_vaapi vp9_qsv)
Applied decoding benchmarks examples from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#Decode-only
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv420p+opus.mp4 -f null - frame= 1781 fps=1745 q=-0.0 Lsize=N/A time=00:01:11.24 bitrate=N/A speed=69.8x
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv422p10le_SR.mp4 -f null - frame= 1779 fps=1351 q=-0.0 Lsize=N/A time=00:01:11.16 bitrate=N/A speed=54.1x
Den 25.09.2024 17:25, skrev Terje J. Hanssen:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1 [1] 21180 1: command not found localhost:/home/cinelerra/cinelerra-5.1 # make: *** No rule to make target '2'. Stop. ^C [1]+ Exit 2 make install 2 > make_install.log
attach make_install.log with an email.
Qsv test 1: -----------------
localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07
Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
Cingg render error: libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished.
Notice, in case this matters: This is on Arc 750 GPU and i915 driver # inxi -GSz System: Kernel: 6.6.52-1-longterm arch: x86_64 bits: 64 Console: pty pts/0 Distro: openSUSE Tumbleweed-Slowroll 20240901 Graphics: Device-1: Intel DG2 [Arc A750] driver: i915 v: kernel Device-2: Microdia Camera driver: snd-usb-audio,uvcvideo type: USB Display: unspecified server: X.org v: 1.21.1.12 with: Xwayland v: 24.1.2 driver: X: loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 resolution: 2560x1440~60Hz API: OpenGL v: 4.6 vendor: intel mesa v: 24.1.3 renderer: Mesa Intel Arc A750 Graphics (DG2) API: Vulkan v: 1.3.290 drivers: N/A surfaces: xcb,xlib API: EGL Message: EGL data requires eglinfo. Check --recommends. # vainfo Trying display: wayland Trying display: x11 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.22 (libva 2.22.0) vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.1.5 () vainfo: Supported profile and entrypoints VAProfileNone : VAEntrypointVideoProc VAProfileNone : VAEntrypointStats VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSliceLP VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSliceLP VAProfileHEVCMain10 : VAEntrypointVLD VAProfileHEVCMain10 : VAEntrypointEncSliceLP VAProfileVP9Profile0 : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointEncSliceLP VAProfileVP9Profile1 : VAEntrypointVLD VAProfileVP9Profile1 : VAEntrypointEncSliceLP VAProfileVP9Profile2 : VAEntrypointVLD VAProfileVP9Profile2 : VAEntrypointEncSliceLP VAProfileVP9Profile3 : VAEntrypointVLD VAProfileVP9Profile3 : VAEntrypointEncSliceLP VAProfileHEVCMain12 : VAEntrypointVLD VAProfileHEVCMain422_10 : VAEntrypointVLD VAProfileHEVCMain422_10 : VAEntrypointEncSliceLP VAProfileHEVCMain422_12 : VAEntrypointVLD VAProfileHEVCMain444 : VAEntrypointVLD VAProfileHEVCMain444 : VAEntrypointEncSliceLP VAProfileHEVCMain444_10 : VAEntrypointVLD VAProfileHEVCMain444_10 : VAEntrypointEncSliceLP VAProfileHEVCMain444_12 : VAEntrypointVLD VAProfileHEVCSccMain : VAEntrypointVLD VAProfileHEVCSccMain : VAEntrypointEncSliceLP VAProfileHEVCSccMain10 : VAEntrypointVLD VAProfileHEVCSccMain10 : VAEntrypointEncSliceLP VAProfileHEVCSccMain444 : VAEntrypointVLD VAProfileHEVCSccMain444 : VAEntrypointEncSliceLP VAProfileAV1Profile0 : VAEntrypointVLD VAProfileAV1Profile0 : VAEntrypointEncSliceLP VAProfileHEVCSccMain444_10 : VAEntrypointVLD VAProfileHEVCSccMain444_10 : VAEntrypointEncSliceLP
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ? [1] 21180
1: command not found localhost:/home/cinelerra/cinelerra-5.1 # make: *** No rule to make target '2'. Stop. ^C [1]+ Exit 2 make install 2 > make_install.log
attach make_install.log with an email.
Qsv test 1: -----------------
localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07
Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
try different Pixels if possible?
Cingg render error: libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished.
ср, 25 сент. 2024 г., 01:02 Andrew Randrianasulu <[email protected]
:
ср, 25 сент. 2024 г., 00:55 Terje J. Hanssen <[email protected]>:
Den 24.09.2024 22:20, skrev Andrew Randrianasulu via Cin:
got answer from ffmpeg devs
https://ffmpeg.org//pipermail/ffmpeg-devel/2024-September/333906.html
But will it be hard to enable Cingg "presets" to utilize hwaccels like QSV decoding/encoding via the unbundled built via QSV-enabled system FFmpeg?
you can try to copy vaapi profiles under new name, then replace codec_vaapi for codec_qsv and see how it goes .... I just did the same for mediacodec, seems to work but unsure if you need additional patch I have in tree here ...
ffmpeg -hide_banner -codecs | grep qsv DEV.L. av1 Alliance for Open Media AV1 (decoders: libdav1d libaom-av1 av1 av1_cuvid av1_qsv) (encoders: libaom-av1 librav1e libsvtav1 av1_nvenc av1_qsv av1_amf av1_vaapi) DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv libopenh264 h264_cuvid) (encoders: libx264 libx264rgb libopenh264 h264_amf h264_nvenc h264_qsv h264_v4l2m2m h264_vaapi) DEV.L. hevc H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv hevc_v4l2m2m hevc_cuvid) (encoders: libx265 hevc_amf hevc_nvenc hevc_qsv hevc_v4l2m2m hevc_vaapi) DEVIL. mjpeg Motion JPEG (decoders: mjpeg mjpeg_cuvid mjpeg_qsv) (encoders: mjpeg mjpeg_qsv mjpeg_vaapi) DEV.L. mpeg2video MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m mpeg2_qsv mpeg2_cuvid) (encoders: mpeg2video mpeg2_qsv mpeg2_vaapi) D.V.L. vc1 SMPTE VC-1 (decoders: vc1 vc1_qsv vc1_v4l2m2m vc1_cuvid) DEV.L. vp8 On2 VP8 (decoders: vp8 vp8_v4l2m2m libvpx vp8_cuvid vp8_qsv) (encoders: libvpx vp8_v4l2m2m vp8_vaapi) DEV.L. vp9 Google VP9 (decoders: vp9 vp9_v4l2m2m libvpx-vp9 vp9_cuvid vp9_qsv) (encoders: libvpx-vp9 vp9_vaapi vp9_qsv)
Applied decoding benchmarks examples from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#Decode-only
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv420p+opus.mp4 -f null - frame= 1781 fps=1745 q=-0.0 Lsize=N/A time=00:01:11.24 bitrate=N/A speed=69.8x
ffmpeg -hide_banner -hwaccel_output_format qsv -c:v hevc_qsv -i h265_yuv422p10le_SR.mp4 -f null - frame= 1779 fps=1351 q=-0.0 Lsize=N/A time=00:01:11.16 bitrate=N/A speed=54.1x
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;( Now make install went through without faults as I could see, but attach it by email again. But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): ---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4 Compression: h265_qsv.mp4 Pixels: qsv [hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished. ---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le [hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished. ---------------- 3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4 Compression: av1_qsv.mp4 Pixels: qsv FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le [av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4 Compression: h265_qsv.mp4 Pixels: qsv [hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished. -------------------- 4b) Compression: h265_qsv.mp4 Pixels: yuyv422 [hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished. ---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished. ---------------- 3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4 You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us --------------------
4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available) Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress: # profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2 Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64) VLC playback OK ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
---------------- 3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4
# profile=high Pixels: qsv (yuv420 isn't available) Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us
-------------------- 4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Some progress: # profile=high Pixels: yuyv422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2 Rendered: FFStream::encode_frame: encode failed. file: /Videoklipp/MOV/hd01_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/MOV/hd01_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 1781 frames in 14.617 secs, 121.844 fps audio0 pad 128 0 (128) VLC playback OK ffprobe -hide_banner hd01_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hd01_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:01:11.28, start: 0.000000, bitrate: 2744 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 2377 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 16 channels, fltp, 378 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
----------------
2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
----------------
3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us
--------------------
4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuyv422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: FFStream::encode_frame: encode failed. file: /Videoklipp/MOV/hd01_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/MOV/hd01_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 1781 frames in 14.617 secs, 121.844 fps audio0 pad 128 0 (128)
VLC playback OK
ffprobe -hide_banner hd01_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hd01_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:01:11.28, start: 0.000000, bitrate: 2744 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 2377 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 16 channels, fltp, 378 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default) I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread. Both yuv422 and nv12 work. But why isn't also the usual yuv420p available for h264 and h265? Possibly also rename h265 to hevc as ffmpeg use?
---------------- 3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us
-------------------- 4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuyv422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: FFStream::encode_frame: encode failed. file: /Videoklipp/MOV/hd01_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/MOV/hd01_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 1781 frames in 14.617 secs, 121.844 fps audio0 pad 128 0 (128)
VLC playback OK
ffprobe -hide_banner hd01_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hd01_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:01:11.28, start: 0.000000, bitrate: 2744 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 2377 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 16 channels, fltp, 378 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
----------------
2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this? at least I can't see it in source https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format. can you also see if h264 works with nv12?
----------------
3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us
--------------------
4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuyv422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: FFStream::encode_frame: encode failed. file: /Videoklipp/MOV/hd01_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/MOV/hd01_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 1781 frames in 14.617 secs, 121.844 fps audio0 pad 128 0 (128)
VLC playback OK
ffprobe -hide_banner hd01_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hd01_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:01:11.28, start: 0.000000, bitrate: 2744 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 2377 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 16 channels, fltp, 378 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4 On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.' ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4 and from my own ffmpeg test ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4 [mpeg2video @ 0x5575e097b4c0] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x5575e0975e00] PES packet size mismatch [mpegts @ 0x5575e0975e00] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x5575e0975e00] Could not find codec parameters for stream 2 (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [mpegts @ 0x5575e0975e00] Could not find codec parameters for stream 3 (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'hdv09_04.m2t': Duration: 00:03:59.06, start: 2629.496000, bitrate: 26110 kb/s Program 100 Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn Side data: cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A Stream #0:1[0x814]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) File 'hdv09_04_h264_qsv.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help [libx264 @ 0x5575e097d5c0] using SAR=4/3 [libx264 @ 0x5575e097d5c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x5575e097d5c0] profile High, level 4.0, 4:2:0, 8-bit [libx264 @ 0x5575e097d5c0] 264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: 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=30 lookahead_threads=5 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=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'hdv09_04_h264_qsv.mp4': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.3.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.3.100 aac [mpegts @ 0x5575e0975e00] PES packet size mismatch0:03:51.80 bitrate=8956.8kbits/s dup=12 drop=0 speed=6.35x [mpegts @ 0x5575e0975e00] Packet corrupt (stream = 1, dts = 258142320). [mpeg2video @ 0x5575e09a6b80] ac-tex damaged at 10 61 [mpeg2video @ 0x5575e09a6b80] Warning MVs not available [mpeg2video @ 0x5575e09a6b80] concealing 630 DC, 630 AC, 630 MV errors in P frame [vist#0:0/mpeg2video @ 0x5575e097de80] [dec:mpeg2video @ 0x5575e0a8c0c0] corrupt decoded frame=0 speed=6.36x [out#0/mp4 @ 0x5575e09ad380] video:255836KiB audio:3774KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.068494% frame= 5977 fps=160 q=-1.0 Lsize= 259787KiB time=00:03:58.77 bitrate=8912.9kbits/s dup=14 drop=0 speed=6.37x [libx264 @ 0x5575e097d5c0] frame I:54 Avg QP:22.80 size:193221 [libx264 @ 0x5575e097d5c0] frame P:1658 Avg QP:25.06 size: 92898 [libx264 @ 0x5575e097d5c0] frame B:4265 Avg QP:27.85 size: 22864 [libx264 @ 0x5575e097d5c0] consecutive B-frames: 3.6% 2.4% 4.0% 89.9% [libx264 @ 0x5575e097d5c0] mb I I16..4: 4.9% 87.3% 7.7% [libx264 @ 0x5575e097d5c0] mb P I16..4: 1.2% 13.2% 1.0% P16..4: 41.6% 21.2% 13.9% 0.0% 0.0% skip: 7.8% [libx264 @ 0x5575e097d5c0] mb B I16..4: 0.2% 1.2% 0.1% B16..8: 45.7% 5.9% 1.8% direct: 7.2% skip:37.9% L0:43.2% L1:43.3% BI:13.5% [libx264 @ 0x5575e097d5c0] 8x8 transform intra:85.8% inter:80.8% [libx264 @ 0x5575e097d5c0] coded y,uvDC,uvAC intra: 79.9% 63.7% 20.4% inter: 33.1% 18.6% 1.6% [libx264 @ 0x5575e097d5c0] i16 v,h,dc,p: 16% 52% 15% 17% [libx264 @ 0x5575e097d5c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 16% 36% 4% 5% 5% 5% 5% 7% [libx264 @ 0x5575e097d5c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 57% 9% 3% 4% 4% 4% 3% 4% [libx264 @ 0x5575e097d5c0] i8c dc,h,v,p: 57% 19% 20% 4% [libx264 @ 0x5575e097d5c0] Weighted P-Frames: Y:15.3% UV:6.2% [libx264 @ 0x5575e097d5c0] ref P L0: 47.1% 15.9% 26.2% 9.9% 0.8% [libx264 @ 0x5575e097d5c0] ref B L0: 82.8% 14.6% 2.6% [libx264 @ 0x5575e097d5c0] ref B L1: 93.4% 6.6% [libx264 @ 0x5575e097d5c0] kb/s:8766.10 [aac @ 0x5575e09abd80] Qavg: 488.617
---------------- 3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us
-------------------- 4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuyv422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: FFStream::encode_frame: encode failed. file: /Videoklipp/MOV/hd01_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/MOV/hd01_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 1781 frames in 14.617 secs, 121.844 fps audio0 pad 128 0 (128)
VLC playback OK
ffprobe -hide_banner hd01_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hd01_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:01:11.28, start: 0.000000, bitrate: 2744 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 2377 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 16 channels, fltp, 378 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
Den 27.09.2024 17:55, skrev Terje J. Hanssen:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
[mpeg2video @ 0x5575e097b4c0] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x5575e0975e00] PES packet size mismatch [mpegts @ 0x5575e0975e00] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x5575e0975e00] Could not find codec parameters for stream 2 (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [mpegts @ 0x5575e0975e00] Could not find codec parameters for stream 3 (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'hdv09_04.m2t': Duration: 00:03:59.06, start: 2629.496000, bitrate: 26110 kb/s Program 100 Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn Side data: cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A Stream #0:1[0x814]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) File 'hdv09_04_h264_qsv.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help [libx264 @ 0x5575e097d5c0] using SAR=4/3 [libx264 @ 0x5575e097d5c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x5575e097d5c0] profile High, level 4.0, 4:2:0, 8-bit [libx264 @ 0x5575e097d5c0] 264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: 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=30 lookahead_threads=5 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=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'hdv09_04_h264_qsv.mp4': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.3.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.3.100 aac [mpegts @ 0x5575e0975e00] PES packet size mismatch0:03:51.80 bitrate=8956.8kbits/s dup=12 drop=0 speed=6.35x [mpegts @ 0x5575e0975e00] Packet corrupt (stream = 1, dts = 258142320). [mpeg2video @ 0x5575e09a6b80] ac-tex damaged at 10 61 [mpeg2video @ 0x5575e09a6b80] Warning MVs not available [mpeg2video @ 0x5575e09a6b80] concealing 630 DC, 630 AC, 630 MV errors in P frame [vist#0:0/mpeg2video @ 0x5575e097de80] [dec:mpeg2video @ 0x5575e0a8c0c0] corrupt decoded frame=0 speed=6.36x [out#0/mp4 @ 0x5575e09ad380] video:255836KiB audio:3774KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.068494% frame= 5977 fps=160 q=-1.0 Lsize= 259787KiB time=00:03:58.77 bitrate=8912.9kbits/s dup=14 drop=0 speed=6.37x [libx264 @ 0x5575e097d5c0] frame I:54 Avg QP:22.80 size:193221 [libx264 @ 0x5575e097d5c0] frame P:1658 Avg QP:25.06 size: 92898 [libx264 @ 0x5575e097d5c0] frame B:4265 Avg QP:27.85 size: 22864 [libx264 @ 0x5575e097d5c0] consecutive B-frames: 3.6% 2.4% 4.0% 89.9% [libx264 @ 0x5575e097d5c0] mb I I16..4: 4.9% 87.3% 7.7% [libx264 @ 0x5575e097d5c0] mb P I16..4: 1.2% 13.2% 1.0% P16..4: 41.6% 21.2% 13.9% 0.0% 0.0% skip: 7.8% [libx264 @ 0x5575e097d5c0] mb B I16..4: 0.2% 1.2% 0.1% B16..8: 45.7% 5.9% 1.8% direct: 7.2% skip:37.9% L0:43.2% L1:43.3% BI:13.5% [libx264 @ 0x5575e097d5c0] 8x8 transform intra:85.8% inter:80.8% [libx264 @ 0x5575e097d5c0] coded y,uvDC,uvAC intra: 79.9% 63.7% 20.4% inter: 33.1% 18.6% 1.6% [libx264 @ 0x5575e097d5c0] i16 v,h,dc,p: 16% 52% 15% 17% [libx264 @ 0x5575e097d5c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 16% 36% 4% 5% 5% 5% 5% 7% [libx264 @ 0x5575e097d5c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 57% 9% 3% 4% 4% 4% 3% 4% [libx264 @ 0x5575e097d5c0] i8c dc,h,v,p: 57% 19% 20% 4% [libx264 @ 0x5575e097d5c0] Weighted P-Frames: Y:15.3% UV:6.2% [libx264 @ 0x5575e097d5c0] ref P L0: 47.1% 15.9% 26.2% 9.9% 0.8% [libx264 @ 0x5575e097d5c0] ref B L0: 82.8% 14.6% 2.6% [libx264 @ 0x5575e097d5c0] ref B L1: 93.4% 6.6% [libx264 @ 0x5575e097d5c0] kb/s:8766.10 [aac @ 0x5575e09abd80] Qavg: 488.617
which resulted in ffprobe -hide_banner hdv09_04_h264_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h264_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf61.1.100 Duration: 00:03:59.08, start: 0.000000, bitrate: 8901 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1440x1080 [SAR 4:3 DAR 16:9], 8766 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc61.3.100 libx264 Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
---------------- 3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us
-------------------- 4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuyv422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: FFStream::encode_frame: encode failed. file: /Videoklipp/MOV/hd01_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/MOV/hd01_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 1781 frames in 14.617 secs, 121.844 fps audio0 pad 128 0 (128)
VLC playback OK
ffprobe -hide_banner hd01_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hd01_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:01:11.28, start: 0.000000, bitrate: 2744 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 2377 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 16 channels, fltp, 378 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
----------------
2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the hwupload filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format (hardware generally wants the nv12 layout, but most software functions use the yuv420p layout). The hwupload filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv. Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
[mpeg2video @ 0x5575e097b4c0] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x5575e0975e00] PES packet size mismatch [mpegts @ 0x5575e0975e00] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x5575e0975e00] Could not find codec parameters for stream 2 (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [mpegts @ 0x5575e0975e00] Could not find codec parameters for stream 3 (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'hdv09_04.m2t': Duration: 00:03:59.06, start: 2629.496000, bitrate: 26110 kb/s Program 100 Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn Side data: cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A Stream #0:1[0x814]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) File 'hdv09_04_h264_qsv.mp4' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help [libx264 @ 0x5575e097d5c0] using SAR=4/3 [libx264 @ 0x5575e097d5c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x5575e097d5c0] profile High, level 4.0, 4:2:0, 8-bit [libx264 @ 0x5575e097d5c0] 264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: 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=30 lookahead_threads=5 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=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'hdv09_04_h264_qsv.mp4': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.3.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.3.100 aac [mpegts @ 0x5575e0975e00] PES packet size mismatch0:03:51.80 bitrate=8956.8kbits/s dup=12 drop=0 speed=6.35x [mpegts @ 0x5575e0975e00] Packet corrupt (stream = 1, dts = 258142320). [mpeg2video @ 0x5575e09a6b80] ac-tex damaged at 10 61 [mpeg2video @ 0x5575e09a6b80] Warning MVs not available [mpeg2video @ 0x5575e09a6b80] concealing 630 DC, 630 AC, 630 MV errors in P frame [vist#0:0/mpeg2video @ 0x5575e097de80] [dec:mpeg2video @ 0x5575e0a8c0c0] corrupt decoded frame=0 speed=6.36x [out#0/mp4 @ 0x5575e09ad380] video:255836KiB audio:3774KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.068494% frame= 5977 fps=160 q=-1.0 Lsize= 259787KiB time=00:03:58.77 bitrate=8912.9kbits/s dup=14 drop=0 speed=6.37x [libx264 @ 0x5575e097d5c0] frame I:54 Avg QP:22.80 size:193221 [libx264 @ 0x5575e097d5c0] frame P:1658 Avg QP:25.06 size: 92898 [libx264 @ 0x5575e097d5c0] frame B:4265 Avg QP:27.85 size: 22864 [libx264 @ 0x5575e097d5c0] consecutive B-frames: 3.6% 2.4% 4.0% 89.9% [libx264 @ 0x5575e097d5c0] mb I I16..4: 4.9% 87.3% 7.7% [libx264 @ 0x5575e097d5c0] mb P I16..4: 1.2% 13.2% 1.0% P16..4: 41.6% 21.2% 13.9% 0.0% 0.0% skip: 7.8% [libx264 @ 0x5575e097d5c0] mb B I16..4: 0.2% 1.2% 0.1% B16..8: 45.7% 5.9% 1.8% direct: 7.2% skip:37.9% L0:43.2% L1:43.3% BI:13.5% [libx264 @ 0x5575e097d5c0] 8x8 transform intra:85.8% inter:80.8% [libx264 @ 0x5575e097d5c0] coded y,uvDC,uvAC intra: 79.9% 63.7% 20.4% inter: 33.1% 18.6% 1.6% [libx264 @ 0x5575e097d5c0] i16 v,h,dc,p: 16% 52% 15% 17% [libx264 @ 0x5575e097d5c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 16% 36% 4% 5% 5% 5% 5% 7% [libx264 @ 0x5575e097d5c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 57% 9% 3% 4% 4% 4% 3% 4% [libx264 @ 0x5575e097d5c0] i8c dc,h,v,p: 57% 19% 20% 4% [libx264 @ 0x5575e097d5c0] Weighted P-Frames: Y:15.3% UV:6.2% [libx264 @ 0x5575e097d5c0] ref P L0: 47.1% 15.9% 26.2% 9.9% 0.8% [libx264 @ 0x5575e097d5c0] ref B L0: 82.8% 14.6% 2.6% [libx264 @ 0x5575e097d5c0] ref B L1: 93.4% 6.6% [libx264 @ 0x5575e097d5c0] kb/s:8766.10 [aac @ 0x5575e09abd80] Qavg: 488.617
----------------
3a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_av1_qsv.mp4 File format: FFMPEG-mp4
Compression: av1_qsv.mp4 Pixels: qsv
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. -------------- 3b) Compression: av1_qsv.mp4 Pixels: p010le
[av1_qsv @ 0x7f1c302e7080] Current picture structure is unsupported [av1_qsv @ 0x7f1c302e7080] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. FFMPEG::open_encoder err: Function not implemented int FFMPEG::open_encoder(const char*, const char*): open failed av1_qsv:/Videoklipp/QSV/hdv09_04_av1_qsv.mp4 Render::render_single: Session finished. ----------------- 4a) Loaded hd01.mov Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f4b8d6f9ac0] [Eval @ 0x7f4b62ff66f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4b8d6f9ac0] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
I think you can try to comment out (with #) line with profile=high. in h265_qsv.mp4
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
You also probably can stick to yuv420p (if available) because qsv implies image already in hw-specifuc format and ffmpeg does not do this conversion for us
--------------------
4b) Compression: h265_qsv.mp4 Pixels: yuyv422
[hevc_qsv encoder @ 0x7f4ba4070f00] [Eval @ 0x7f4b5bff86f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f4ba4070f00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f4ba4070f00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/MOV/hd01_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuyv422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: FFStream::encode_frame: encode failed. file: /Videoklipp/MOV/hd01_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/MOV/hd01_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 1781 frames in 14.617 secs, 121.844 fps audio0 pad 128 0 (128)
VLC playback OK
ffprobe -hide_banner hd01_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hd01_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:01:11.28, start: 0.000000, bitrate: 2744 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 2377 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 16 channels, fltp, 378 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download? But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32) --------------------- What about this modified ffmpeg code line? ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t -pix_fmt p010le -c:v hevc_qsv -profile:v main10 hdv09_04_hevc_qsv.mp4 [mpeg2video @ 0x559aa0f2b740] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x559aa0f26080] PES packet size mismatch [mpegts @ 0x559aa0f26080] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x559aa0f26080] Could not find codec parameters for stream 2 (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [mpegts @ 0x559aa0f26080] Could not find codec parameters for stream 3 (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'hdv09_04.m2t': Duration: 00:03:59.06, start: 2629.496000, bitrate: 26110 kb/s Program 100 Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn Side data: cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A Stream #0:1[0x814]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_qsv)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 [hevc_qsv @ 0x559aa0f2d840] Using the constant quantization parameter (CQP) by default. Please use the global_quality option and other options for a quality-based mode or the b option and other options for a bitrate-based mode if the default is not the desired choice. Output #0, mp4, to 'hdv09_04_hevc_qsv.mp4': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: hevc (hev1 / 0x31766568), p010le(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.3.100 hevc_qsv Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.3.100 aac [mpegts @ 0x559aa0f26080] PES packet size mismatch0:03:49.92 bitrate=26241.8kbits/s dup=12 drop=0 speed= 23x [mpegts @ 0x559aa0f26080] Packet corrupt (stream = 1, dts = 258142320). [mpeg2video @ 0x559aa0f56fc0] ac-tex damaged at 10 61 [mpeg2video @ 0x559aa0f56fc0] Warning MVs not available [mpeg2video @ 0x559aa0f56fc0] concealing 630 DC, 630 AC, 630 MV errors in P frame [vist#0:0/mpeg2video @ 0x559aa0f2e100] [dec:mpeg2video @ 0x559aa103c340] corrupt decoded frame [out#0/mp4 @ 0x559aa0f5d600] video:756129KiB audio:3774KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.024395% frame= 5977 fps=575 q=-0.0 Lsize= 760088KiB time=00:03:58.77 bitrate=26077.3kbits/s dup=14 drop=0 speed= 23x [aac @ 0x559aa0f5c000] Qavg: 488.617 ffprobe -hide_banner hdv09_04_hevc_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_hevc_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:59.08, start: 0.000000, bitrate: 26044 kb/s Stream #0:0[0x1](und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 25908 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc61.3.100 hevc_qsv Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0] ---------------------------------------------------------------------- Else I've used ffmpeg to query the supported Qsv formats as follows: ffmpeg -hide_banner -h encoder=hevc_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le p012le yuyv422 y210le qsv bgra x2rgb10le vuyx xv30le -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V....... main10 2 E..V....... mainsp 3 E..V....... main 0 E..V....... ffmpeg -hide_banner -h encoder=h264_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 77 E..V....... ffmpeg -hide_banner -h encoder=av1_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V....... ffmpeg -hide_banner -h encoder=vp9_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le vuyx qsv xv30le -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) profile0 1 E..V....... profile1 2 E..V....... profile2 3 E..V....... profile3 4 E..V....... ffmpeg -hide_banner -h encoder=vp9_qsv | egrep 'Supported|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le vuyx qsv xv30le -------------- And also to compare actual pixel formats ffmpeg -hide_banner -pix_fmts | egrep 'yuv420p|p010le|yuv422p' ------- Pixel formats: I.... = Supported Input format for conversion .O... = Supported Output format for conversion ..H.. = Hardware accelerated format ...P. = Paletted format ....B = Bitstream format FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL BIT_DEPTHS ----- IO... yuv420p 3 12 8-8-8 IO... yuv422p 3 16 8-8-8 IO... yuv420p16le 3 24 16-16-16 IO... yuv420p16be 3 24 16-16-16 IO... yuv422p16le 3 32 16-16-16 IO... yuv422p16be 3 32 16-16-16 IO... yuv420p9be 3 13 9-9-9 IO... yuv420p9le 3 13 9-9-9 IO... yuv420p10be 3 15 10-10-10 IO... yuv420p10le 3 15 10-10-10 IO... yuv422p10be 3 20 10-10-10 IO... yuv422p10le 3 20 10-10-10 IO... yuv422p9be 3 18 9-9-9 IO... yuv422p9le 3 18 9-9-9 IO... yuv420p12be 3 18 12-12-12 IO... yuv420p12le 3 18 12-12-12 IO... yuv420p14be 3 21 14-14-14 IO... yuv420p14le 3 21 14-14-14 IO... yuv422p12be 3 24 12-12-12 IO... yuv422p12le 3 24 12-12-12 IO... yuv422p14be 3 28 14-14-14 IO... yuv422p14le 3 28 14-14-14 IO... p010le 3 15 10-10-10 ----------------------------- And as extracted from cuda - Understanding pixel format and profile when encoding 10-bit video in ffmpeg with nvenc - Super User https://superuser.com/questions/1614571/understanding-pixel-format-and-profi... Hardware HEVC encoder uses pixel formats p010le and p016le for 10-bit output where first one produces yuv 4:2:0 and the second one yuv 4:4:4.*Params explanation:* * |-pix_fmt p010le| converts 8bit input into 10bit; note that conversion is done by CPU so it makes the encoding slower but produces better quality video and in CRF also lower bitrate (smaller file). For CUDA decoder must be used with |-vf "hwdownload,format=nv12"| (or |-vf "hwdownload,format=p010le"| for 10 bit input video) to copy decoded frames from CUDA into CPU for conversion (NVDEC decoder sends frames into CPU automatically.) Specifying |-profile main10| is required to allow 10bit encoding but does not accually affect how the encoder encodes the video - encoder itself does not change the bit depth of the input! According to this reddit post <https://www.reddit.com/r/ffmpeg/comments/c1im2i/encode_4k_hdr_pixel_format/> by @Anton1699: *p010le is equivalent to yuv420p10le* (it's 10-bit video with 4:2:0 subsampling = 15-bit per pixel). I have yet to find a more authoritative source in documentation. |p010le| is supported by nvenc. The output log also indicates that this works. As a result, I put this up as a tentative answer. Sample command: |ffmpeg -i input.mkv -pix_fmt p010le -c:v hevc_nvenc -profile:v main10 -cq 21 out.mkv|
Den 27.09.2024 22:27, skrev Terje J. Hanssen:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu: > try this git patch, do not forgot to make > install again, or put profiles in > bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
What about this modified ffmpeg code line?
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t -pix_fmt p010le -c:v hevc_qsv -profile:v main10 hdv09_04_hevc_qsv.mp4 [mpeg2video @ 0x559aa0f2b740] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x559aa0f26080] PES packet size mismatch [mpegts @ 0x559aa0f26080] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x559aa0f26080] Could not find codec parameters for stream 2 (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [mpegts @ 0x559aa0f26080] Could not find codec parameters for stream 3 (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'hdv09_04.m2t': Duration: 00:03:59.06, start: 2629.496000, bitrate: 26110 kb/s Program 100 Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn Side data: cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A Stream #0:1[0x814]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_qsv)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 [hevc_qsv @ 0x559aa0f2d840] Using the constant quantization parameter (CQP) by default. Please use the global_quality option and other options for a quality-based mode or the b option and other options for a bitrate-based mode if the default is not the desired choice. Output #0, mp4, to 'hdv09_04_hevc_qsv.mp4': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: hevc (hev1 / 0x31766568), p010le(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.3.100 hevc_qsv Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.3.100 aac [mpegts @ 0x559aa0f26080] PES packet size mismatch0:03:49.92 bitrate=26241.8kbits/s dup=12 drop=0 speed= 23x [mpegts @ 0x559aa0f26080] Packet corrupt (stream = 1, dts = 258142320). [mpeg2video @ 0x559aa0f56fc0] ac-tex damaged at 10 61 [mpeg2video @ 0x559aa0f56fc0] Warning MVs not available [mpeg2video @ 0x559aa0f56fc0] concealing 630 DC, 630 AC, 630 MV errors in P frame [vist#0:0/mpeg2video @ 0x559aa0f2e100] [dec:mpeg2video @ 0x559aa103c340] corrupt decoded frame [out#0/mp4 @ 0x559aa0f5d600] video:756129KiB audio:3774KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.024395% frame= 5977 fps=575 q=-0.0 Lsize= 760088KiB time=00:03:58.77 bitrate=26077.3kbits/s dup=14 drop=0 speed= 23x [aac @ 0x559aa0f5c000] Qavg: 488.617
ffprobe -hide_banner hdv09_04_hevc_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_hevc_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:59.08, start: 0.000000, bitrate: 26044 kb/s Stream #0:0[0x1](und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 25908 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc61.3.100 hevc_qsv Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
----------------------------------------------------------------------
Else I've used ffmpeg to query the supported Qsv formats as follows:
ffmpeg -hide_banner -h encoder=hevc_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le p012le yuyv422 y210le qsv bgra x2rgb10le vuyx xv30le -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V....... main10 2 E..V....... mainsp 3 E..V....... main 0 E..V.......
ffmpeg -hide_banner -h encoder=h264_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 77 E..V.......
ffmpeg -hide_banner -h encoder=av1_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V.......
ffmpeg -hide_banner -h encoder=vp9_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le vuyx qsv xv30le -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) profile0 1 E..V....... profile1 2 E..V....... profile2 3 E..V....... profile3 4 E..V.......
ffmpeg -hide_banner -h encoder=vp9_qsv | egrep 'Supported|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le vuyx qsv xv30le
--------------
And also to compare actual pixel formats
ffmpeg -hide_banner -pix_fmts | egrep 'yuv420p|p010le|yuv422p' ------- Pixel formats: I.... = Supported Input format for conversion .O... = Supported Output format for conversion ..H.. = Hardware accelerated format ...P. = Paletted format ....B = Bitstream format FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL BIT_DEPTHS ----- IO... yuv420p 3 12 8-8-8
and forgot IO... nv12 3 12 8-8-8
IO... yuv422p 3 16 8-8-8 IO... yuv420p16le 3 24 16-16-16 IO... yuv420p16be 3 24 16-16-16 IO... yuv422p16le 3 32 16-16-16 IO... yuv422p16be 3 32 16-16-16 IO... yuv420p9be 3 13 9-9-9 IO... yuv420p9le 3 13 9-9-9 IO... yuv420p10be 3 15 10-10-10 IO... yuv420p10le 3 15 10-10-10 IO... yuv422p10be 3 20 10-10-10 IO... yuv422p10le 3 20 10-10-10 IO... yuv422p9be 3 18 9-9-9 IO... yuv422p9le 3 18 9-9-9 IO... yuv420p12be 3 18 12-12-12 IO... yuv420p12le 3 18 12-12-12 IO... yuv420p14be 3 21 14-14-14 IO... yuv420p14le 3 21 14-14-14 IO... yuv422p12be 3 24 12-12-12 IO... yuv422p12le 3 24 12-12-12 IO... yuv422p14be 3 28 14-14-14 IO... yuv422p14le 3 28 14-14-14 IO... p010le 3 15 10-10-10
-----------------------------
And as extracted from cuda - Understanding pixel format and profile when encoding 10-bit video in ffmpeg with nvenc - Super User https://superuser.com/questions/1614571/understanding-pixel-format-and-profi...
Hardware HEVC encoder uses pixel formats p010le and p016le for 10-bit output where first one produces yuv 4:2:0 and the second one yuv 4:4:4.*Params explanation:*
* |-pix_fmt p010le| converts 8bit input into 10bit; note that conversion is done by CPU so it makes the encoding slower but produces better quality video and in CRF also lower bitrate (smaller file). For CUDA decoder must be used with |-vf "hwdownload,format=nv12"| (or |-vf "hwdownload,format=p010le"| for 10 bit input video) to copy decoded frames from CUDA into CPU for conversion (NVDEC decoder sends frames into CPU automatically.) Specifying |-profile main10| is required to allow 10bit encoding but does not accually affect how the encoder encodes the video - encoder itself does not change the bit depth of the input!
According to this reddit post <https://www.reddit.com/r/ffmpeg/comments/c1im2i/encode_4k_hdr_pixel_format/> by @Anton1699:
*p010le is equivalent to yuv420p10le* (it's 10-bit video with 4:2:0 subsampling = 15-bit per pixel).
I have yet to find a more authoritative source in documentation.
|p010le| is supported by nvenc. The output log also indicates that this works. As a result, I put this up as a tentative answer. Sample command:
|ffmpeg -i input.mkv -pix_fmt p010le -c:v hevc_nvenc -profile:v main10 -cq 21 out.mkv|
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen < [email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]
:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu:
try this git patch, do not forgot to make install again, or put profiles in bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
----------------
2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the hwupload filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format (hardware generally wants the nv12 layout, but most software functions use the yuv420p layout). The hwupload filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not? I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now). Sorry about such extended debugging. Thanks for patience (over the years!)
What about this modified ffmpeg code line?
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t -pix_fmt p010le -c:v hevc_qsv -profile:v main10 hdv09_04_hevc_qsv.mp4 [mpeg2video @ 0x559aa0f2b740] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x559aa0f26080] PES packet size mismatch [mpegts @ 0x559aa0f26080] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x559aa0f26080] Could not find codec parameters for stream 2 (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [mpegts @ 0x559aa0f26080] Could not find codec parameters for stream 3 (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'hdv09_04.m2t': Duration: 00:03:59.06, start: 2629.496000, bitrate: 26110 kb/s Program 100 Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn Side data: cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 vbv_delay: N/A Stream #0:1[0x814]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_qsv)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 [hevc_qsv @ 0x559aa0f2d840] Using the constant quantization parameter (CQP) by default. Please use the global_quality option and other options for a quality-based mode or the b option and other options for a bitrate-based mode if the default is not the desired choice. Output #0, mp4, to 'hdv09_04_hevc_qsv.mp4': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: hevc (hev1 / 0x31766568), p010le(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.3.100 hevc_qsv Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.3.100 aac [mpegts @ 0x559aa0f26080] PES packet size mismatch0:03:49.92 bitrate=26241.8kbits/s dup=12 drop=0 speed= 23x [mpegts @ 0x559aa0f26080] Packet corrupt (stream = 1, dts = 258142320). [mpeg2video @ 0x559aa0f56fc0] ac-tex damaged at 10 61 [mpeg2video @ 0x559aa0f56fc0] Warning MVs not available [mpeg2video @ 0x559aa0f56fc0] concealing 630 DC, 630 AC, 630 MV errors in P frame [vist#0:0/mpeg2video @ 0x559aa0f2e100] [dec:mpeg2video @ 0x559aa103c340] corrupt decoded frame [out#0/mp4 @ 0x559aa0f5d600] video:756129KiB audio:3774KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.024395% frame= 5977 fps=575 q=-0.0 Lsize= 760088KiB time=00:03:58.77 bitrate=26077.3kbits/s dup=14 drop=0 speed= 23x [aac @ 0x559aa0f5c000] Qavg: 488.617
yeah, this sounds more like qsv accelerated encode
ffprobe -hide_banner hdv09_04_hevc_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_hevc_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:59.08, start: 0.000000, bitrate: 26044 kb/s Stream #0:0[0x1](und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 25908 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc61.3.100 hevc_qsv Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
----------------------------------------------------------------------
Else I've used ffmpeg to query the supported Qsv formats as follows:
ffmpeg -hide_banner -h encoder=hevc_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le p012le yuyv422 y210le qsv bgra x2rgb10le vuyx xv30le -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V....... main10 2 E..V....... mainsp 3 E..V....... main 0 E..V.......
you probably can play with p010 and profile=main10 for 10-bit encode but I am not sure if it will work.
ffmpeg -hide_banner -h encoder=h264_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 77 E..V.......
ffmpeg -hide_banner -h encoder=av1_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le qsv -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) main 1 E..V.......
ffmpeg -hide_banner -h encoder=vp9_qsv | egrep 'Supported|profile|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le vuyx qsv xv30le -profile <int> E..V....... (from 0 to INT_MAX) (default unknown) profile0 1 E..V....... profile1 2 E..V....... profile2 3 E..V....... profile3 4 E..V.......
ffmpeg -hide_banner -h encoder=vp9_qsv | egrep 'Supported|main' Supported hardware devices: qsv qsv qsv Supported pixel formats: nv12 p010le vuyx qsv xv30le
--------------
And also to compare actual pixel formats
ffmpeg -hide_banner -pix_fmts | egrep 'yuv420p|p010le|yuv422p' ------- Pixel formats: I.... = Supported Input format for conversion .O... = Supported Output format for conversion ..H.. = Hardware accelerated format ...P. = Paletted format ....B = Bitstream format FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL BIT_DEPTHS ----- IO... yuv420p 3 12 8-8-8 IO... yuv422p 3 16 8-8-8 IO... yuv420p16le 3 24 16-16-16 IO... yuv420p16be 3 24 16-16-16 IO... yuv422p16le 3 32 16-16-16 IO... yuv422p16be 3 32 16-16-16 IO... yuv420p9be 3 13 9-9-9 IO... yuv420p9le 3 13 9-9-9 IO... yuv420p10be 3 15 10-10-10 IO... yuv420p10le 3 15 10-10-10 IO... yuv422p10be 3 20 10-10-10 IO... yuv422p10le 3 20 10-10-10 IO... yuv422p9be 3 18 9-9-9 IO... yuv422p9le 3 18 9-9-9 IO... yuv420p12be 3 18 12-12-12 IO... yuv420p12le 3 18 12-12-12 IO... yuv420p14be 3 21 14-14-14 IO... yuv420p14le 3 21 14-14-14 IO... yuv422p12be 3 24 12-12-12 IO... yuv422p12le 3 24 12-12-12 IO... yuv422p14be 3 28 14-14-14 IO... yuv422p14le 3 28 14-14-14 IO... p010le 3 15 10-10-10
-----------------------------
And as extracted from cuda - Understanding pixel format and profile when encoding 10-bit video in ffmpeg with nvenc - Super User
https://superuser.com/questions/1614571/understanding-pixel-format-and-profi...
Hardware HEVC encoder uses pixel formats p010le and p016le for 10-bit output where first one produces yuv 4:2:0 and the second one yuv 4:4:4.*Params explanation:*
- -pix_fmt p010le converts 8bit input into 10bit; note that conversion is done by CPU so it makes the encoding slower but produces better quality video and in CRF also lower bitrate (smaller file). For CUDA decoder must be used with -vf "hwdownload,format=nv12" (or -vf "hwdownload,format=p010le" for 10 bit input video) to copy decoded frames from CUDA into CPU for conversion (NVDEC decoder sends frames into CPU automatically.) Specifying -profile main10 is required to allow 10bit encoding but does not accually affect how the encoder encodes the video - encoder itself does not change the bit depth of the input!
According to this reddit post <https://www.reddit.com/r/ffmpeg/comments/c1im2i/encode_4k_hdr_pixel_format/> by @Anton1699:
*p010le is equivalent to yuv420p10le* (it's 10-bit video with 4:2:0 subsampling = 15-bit per pixel).
I have yet to find a more authoritative source in documentation.
p010le is supported by nvenc. The output log also indicates that this works. As a result, I put this up as a tentative answer. Sample command:
ffmpeg -i input.mkv -pix_fmt p010le -c:v hevc_nvenc -profile:v main10 -cq 21 out.mkv
Den 28.09.2024 01:22, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 00:27, skrev Andrew Randrianasulu: > try this git patch, do not forgot to > make install again, or put profiles in > bin/ffmpeg/video folder manually.
# cd /home/cinelerra/cinelerra-5.1 # mv /home/terje/0001-Qsv-encoders-for-testing.patch .
# git am 0001-Qsv-encoders-for-testing.patch Applying: Qsv encoders for testing
make install > make_install.log 2&1
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not?
I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now).
Sorry about such extended debugging. Thanks for patience (over the years!)
I did a summary testing today with results before patching: 1) dv_movie.mpg (progressive) dv01_07.dv (interlaced) av1_qsv/vp9_qsv rendering works with nv12 and p010le h264_qsv rendering works with nv12 2) hdv09_04.m2t (interlaced) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile hdv_movie_0.mpg (progressive) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile 3) hd01.mov (interlaced) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile --------------------------- After adding the latest two patches and make install, 1) above doesn't work anymore. Tried also to comment out each of the two new options. Any idea why? I have not continued with 2) and 3) above so far.
Den 28.09.2024 17:35, skrev Terje J. Hanssen:
Den 28.09.2024 01:22, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu: > > > ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen > <[email protected]>: > > > > Den 25.09.2024 00:27, skrev Andrew > Randrianasulu: >> try this git patch, do not forgot to >> make install again, or put profiles in >> bin/ffmpeg/video folder manually. > > # cd /home/cinelerra/cinelerra-5.1 > # mv > /home/terje/0001-Qsv-encoders-for-testing.patch > . > > # git am 0001-Qsv-encoders-for-testing.patch > Applying: Qsv encoders for testing > > > make install > make_install.log 2&1 > > > > make install > make_install.log 2>&1 ? > Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not?
I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now).
Sorry about such extended debugging. Thanks for patience (over the years!)
I did a summary testing today with results before patching:
1) dv_movie.mpg (progressive) dv01_07.dv (interlaced)
av1_qsv/vp9_qsv rendering works with nv12 and p010le h264_qsv rendering works with nv12
2) hdv09_04.m2t (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
hdv_movie_0.mpg (progressive) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
3) hd01.mov (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
---------------------------
After adding the latest two patches and make install, 1) above doesn't work anymore. Tried also to comment out each of the two new options. Any idea why?
I have not continued with 2) and 3) above so far.
Add some Cingg output: FFMPEG::scan: codec open failed FFMPEG::scan:file=/Videoklipp/QSV/dv_movie_0.mpg audio0 pad 32 0 (32) int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv_movie_0_av1_qsv.mp4 Render::render_single: Session finished. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv_movie_0_av1_qsv.mp4 Render::render_single: Session finished. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv_movie_0_av1_qsv.mp4 Render::render_single: Session finished. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv_movie_0_av1_qsv.mp4 Render::render_single: Session finished. ^C** intr at 0x7f7b3ea8f25e in pid 102978, tid 102978 writing debug data to /tmp/cinelerra_102978.dmp lock_items: 19 lock_frees: 28 ^C localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 git://git.cinelerra-gg.org/goodguy/cinelerra.git (c) 2006-2019 Heroine Virtual Ltd. by Adam Williams 2007-2020 mods for Cinelerra-GG by W.P.Morrow aka goodguy 2003-2017 mods for Cinelerra-CV by CinelerraCV team 2015-2024 mods for Cinelerra-GG by Cinelerra-GG team Libav version: Lavc61.3.100 Cinelerra is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for Cinelerra. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv01_07_av1_qsv.mp4 Render::render_single: Session finished. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv01_07_av1_qsv.mp4 Render::render_single: Session finished. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv01_07_av1_qsv.mp4 Render::render_single: Session finished. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv01_07_av1_qsv.mp4 Render::render_single: Session finished. int FFMPEG::init_encoder(const char*): mismatch audio/video file format: /Videoklipp/QSV/dv01_07_av1_qsv.mp4 Render::render_single: Session finished. Total excess of backups: -50 Session time: 0:07:07 Cpu time: user: 0:00:07.647 sys: 0:00:04.063
сб, 28 сент. 2024 г., 18:35 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 01:22, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen < [email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]
:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu:
ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen <[email protected] >:
> > > Den 25.09.2024 00:27, skrev Andrew Randrianasulu: > > try this git patch, do not forgot to make install again, or put > profiles in bin/ffmpeg/video folder manually. > > > # cd /home/cinelerra/cinelerra-5.1 > # mv /home/terje/0001-Qsv-encoders-for-testing.patch . > > # git am 0001-Qsv-encoders-for-testing.patch > Applying: Qsv encoders for testing > > > make install > make_install.log 2&1 >
make install > make_install.log 2>&1 ?
Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
----------------
2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the hwupload filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format (hardware generally wants the nv12 layout, but most software functions use the yuv420p layout). The hwupload filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not?
I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now).
Sorry about such extended debugging. Thanks for patience (over the years!)
I did a summary testing today with results before patching:
1) dv_movie.mpg (progressive) dv01_07.dv (interlaced)
av1_qsv/vp9_qsv rendering works with nv12 and p010le h264_qsv rendering works with nv12
2) hdv09_04.m2t (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
hdv_movie_0.mpg (progressive) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
3) hd01.mov (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
---------------------------
After adding the latest two patches and make install, 1) above doesn't work anymore. Tried also to comment out each of the two new options. Any idea why?
no idea o.O does "git reset --hard git-hash-before-you-added-patches" && make install restore 1) ? normal ffmpeg renders all three input files with qsv encoders, right?
I have not continued with 2) and 3) above so far.
Den 28.09.2024 17:42, skrev Andrew Randrianasulu:
сб, 28 сент. 2024 г., 18:35 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 01:22, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected]>:
Den 25.09.2024 21:33, skrev Andrew Randrianasulu: > > > ср, 25 сент. 2024 г., 18:25 Terje J. > Hanssen <[email protected]>: > > > > Den 25.09.2024 00:27, skrev Andrew > Randrianasulu: >> try this git patch, do not forgot >> to make install again, or put >> profiles in bin/ffmpeg/video folder >> manually. > > # cd /home/cinelerra/cinelerra-5.1 > # mv > /home/terje/0001-Qsv-encoders-for-testing.patch > . > > # git am > 0001-Qsv-encoders-for-testing.patch > Applying: Qsv encoders for testing > > > make install > make_install.log 2&1 > > > > make install > make_install.log 2>&1 ? > Sorry. I should cleanup all ">" with Find & Replace in my note, and oversaw here should be two of them in this command ;(
Now make install went through without faults as I could see, but attach it by email again.
But unhappily, no success with testing Cingg Qsv Rendering. All attempts so far breaks with the output below:
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*):
---------- localhost:/home/cinelerra/cinelerra-5.1 # bin/cin Cinelerra Infinity - built: Sep 23 2024 10:31:07 ---------- 1) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 File format: FFMPEG-mp4 Compression: h264_qsv.mp4 Pixels: qsv
libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0 libva info: VA-API version 1.22.0 libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_21 libva info: va_openDriver() returns 0
FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 Render::render_single: Session finished. -------------- 2a) Loaded hdv09_04.m2t Render: Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 File format: FFMPEG-mp4
Compression: h265_qsv.mp4 Pixels: qsv
[hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- 2b) Compression: h265_qsv.mp4 Pixels: p010le
[hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] Undefined constant or missing '(' in 'high' [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value "high" [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to value high. FFMPEG::open_encoder err: Invalid argument int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not?
I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now).
Sorry about such extended debugging. Thanks for patience (over the years!)
I did a summary testing today with results before patching:
1) dv_movie.mpg (progressive) dv01_07.dv (interlaced)
av1_qsv/vp9_qsv rendering works with nv12 and p010le h264_qsv rendering works with nv12
2) hdv09_04.m2t (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
hdv_movie_0.mpg (progressive) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
3) hd01.mov (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
---------------------------
After adding the latest two patches and make install, 1) above doesn't work anymore. Tried also to comment out each of the two new options. Any idea why?
no idea o.O
To verify if my patch procedure was right (?) here is my procedure and output: # git am 0001-Add-nv12-as-def.-pixformat-for-qsv-profiles-clarify-.patch Applying: Add nv12 as def. pixformat for qsv profiles, clarify when it work .git/rebase-apply/patch:18: new blank line at EOF. + warning: 1 line adds whitespace errors. localhost:/home/cinelerra/cinelerra-5.1 # git am 0002-Modify-remaining-_qsv-orofiles-to-use-nv12-fix-typo-.patch Applying: Modify remaining _qsv orofiles to use nv12, fix typo in hevc_qsv # make install > make_install.log 2>&1 Attach make_install.log by email
does "git reset --hard git-hash-before-you-added-patches" && make install restore 1) ?
Could you explain or detqail this a bit more?
normal ffmpeg renders all three input files with qsv encoders, right?
I think so, but can try afterwards.
I have not continued with 2) and 3) above so far.
сб, 28 сент. 2024 г., 19:13 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 17:42, skrev Andrew Randrianasulu:
сб, 28 сент. 2024 г., 18:35 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 01:22, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen < [email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu:
чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen <[email protected] >:
> > > Den 25.09.2024 21:33, skrev Andrew Randrianasulu: > > > > ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen < > [email protected]>: > >> >> >> Den 25.09.2024 00:27, skrev Andrew Randrianasulu: >> >> try this git patch, do not forgot to make install again, or put >> profiles in bin/ffmpeg/video folder manually. >> >> >> # cd /home/cinelerra/cinelerra-5.1 >> # mv /home/terje/0001-Qsv-encoders-for-testing.patch . >> >> # git am 0001-Qsv-encoders-for-testing.patch >> Applying: Qsv encoders for testing >> >> >> make install > make_install.log 2&1 >> > > > make install > make_install.log 2>&1 ? > > Sorry. I should cleanup all ">" with Find & Replace in my note, and > oversaw here should be two of them in this command ;( > > Now make install went through without faults as I could see, but > attach it by email again. > > But unhappily, no success with testing Cingg Qsv Rendering. > All attempts so far breaks with the output below: > > FFMPEG::open_encoder err: Internal bug, should not have happened > int FFMPEG::open_encoder(const char*, const char*): > > ---------- > localhost:/home/cinelerra/cinelerra-5.1 # bin/cin > Cinelerra Infinity - built: Sep 23 2024 10:31:07 > ---------- > 1) > Loaded hdv09_04.m2t > Render: > Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 > File format: FFMPEG-mp4 > Compression: h264_qsv.mp4 > Pixels: qsv > > libva info: VA-API version 1.22.0 > libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so > libva info: Found init function __vaDriverInit_1_21 > libva info: va_openDriver() returns 0 > libva info: VA-API version 1.22.0 > libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so > libva info: Found init function __vaDriverInit_1_21 > libva info: va_openDriver() returns 0 > > FFMPEG::open_encoder err: Internal bug, should not have happened > int FFMPEG::open_encoder(const char*, const char*): > open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 > Render::render_single: Session finished. > -------------- > 2a) > Loaded hdv09_04.m2t > Render: > Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 > File format: FFMPEG-mp4 > > Compression: h265_qsv.mp4 > Pixels: qsv > > [hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] > Undefined constant or missing '(' in 'high' > [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value > "high" > [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to > value high. > FFMPEG::open_encoder err: Invalid argument > int FFMPEG::open_encoder(const char*, const char*): > open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 > Render::render_single: Session finished. >
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
---------------- > 2b) > Compression: h265_qsv.mp4 > Pixels: p010le > > [hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] > Undefined constant or missing '(' in 'high' > [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value > "high" > [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to > value high. > FFMPEG::open_encoder err: Invalid argument > int FFMPEG::open_encoder(const char*, const char*): > open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 > Render::render_single: Session finished. >
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the hwupload filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format (hardware generally wants the nv12 layout, but most software functions use the yuv420p layout). The hwupload filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not?
I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now).
Sorry about such extended debugging. Thanks for patience (over the years!)
I did a summary testing today with results before patching:
1) dv_movie.mpg (progressive) dv01_07.dv (interlaced)
av1_qsv/vp9_qsv rendering works with nv12 and p010le h264_qsv rendering works with nv12
2) hdv09_04.m2t (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
hdv_movie_0.mpg (progressive) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
3) hd01.mov (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
---------------------------
After adding the latest two patches and make install, 1) above doesn't work anymore. Tried also to comment out each of the two new options. Any idea why?
no idea o.O
To verify if my patch procedure was right (?) here is my procedure and output:
# git am 0001-Add-nv12-as-def.-pixformat-for-qsv-profiles-clarify-.patch Applying: Add nv12 as def. pixformat for qsv profiles, clarify when it work .git/rebase-apply/patch:18: new blank line at EOF. + warning: 1 line adds whitespace errors. localhost:/home/cinelerra/cinelerra-5.1
# git am 0002-Modify-remaining-_qsv-orofiles-to-use-nv12-fix-typo-.patch Applying: Modify remaining _qsv orofiles to use nv12, fix typo in hevc_qsv
# make install > make_install.log 2>&1
Attach make_install.log by email
does "git reset --hard git-hash-before-you-added-patches" && make install restore 1) ?
Could you explain or detqail this a bit more?
use git log, it will show long commit hash (bunch of numbers and letters). Note commit hash for commit just adding qsv profiles, two commits below from top. try select it fully or first 8 (?) characters into clipboard execute "git reset --hard "insert from clipboard" verify with git log that two new commits are gone. make install again
normal ffmpeg renders all three input files with qsv encoders, right?
I think so, but can try afterwards.
there is another set of settings to try with av1 encode: https://forum.level1techs.com/t/ffmpeg-av1-encoding-using-intel-arc-gpu-tips...
I have not continued with 2) and 3) above so far.
Den 28.09.2024 18:19, skrev Andrew Randrianasulu:
сб, 28 сент. 2024 г., 19:13 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 17:42, skrev Andrew Randrianasulu:
сб, 28 сент. 2024 г., 18:35 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 01:22, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]>:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen <[email protected]> wrote:
Den 25.09.2024 23:22, skrev Andrew Randrianasulu: > > > чт, 26 сент. 2024 г., 00:16 Terje J. > Hanssen <[email protected]>: > > > > Den 25.09.2024 21:33, skrev Andrew > Randrianasulu: >> >> >> ср, 25 сент. 2024 г., 18:25 Terje >> J. Hanssen <[email protected]>: >> >> >> >> Den 25.09.2024 00:27, skrev >> Andrew Randrianasulu: >>> try this git patch, do not >>> forgot to make install again, >>> or put profiles in >>> bin/ffmpeg/video folder manually. >> >> # cd /home/cinelerra/cinelerra-5.1 >> # mv >> /home/terje/0001-Qsv-encoders-for-testing.patch >> . >> >> # git am >> 0001-Qsv-encoders-for-testing.patch >> Applying: Qsv encoders for testing >> >> >> make install > make_install.log 2&1 >> >> >> >> make install > make_install.log 2>&1 ? >> > Sorry. I should cleanup all ">" with > Find & Replace in my note, and > oversaw here should be two of them > in this command ;( > > Now make install went through > without faults as I could see, but > attach it by email again. > > But unhappily, no success with > testing Cingg Qsv Rendering. > All attempts so far breaks with the > output below: > > FFMPEG::open_encoder err: > Internal bug, should not have > happened > int FFMPEG::open_encoder(const > char*, const char*): > > ---------- > localhost:/home/cinelerra/cinelerra-5.1 > # bin/cin > Cinelerra Infinity - built: Sep 23 > 2024 10:31:07 > ---------- > 1) > Loaded hdv09_04.m2t > Render: > Output to file: > /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 > File format: FFMPEG-mp4 > Compression: h264_qsv.mp4 > Pixels: qsv > > libva info: VA-API version 1.22.0 > libva info: Trying to open > /usr/lib64/dri/iHD_drv_video.so > libva info: Found init function > __vaDriverInit_1_21 > libva info: va_openDriver() returns 0 > libva info: VA-API version 1.22.0 > libva info: Trying to open > /usr/lib64/dri/iHD_drv_video.so > libva info: Found init function > __vaDriverInit_1_21 > libva info: va_openDriver() returns 0 > > FFMPEG::open_encoder err: Internal > bug, should not have happened > int FFMPEG::open_encoder(const > char*, const char*): > open failed > h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 > Render::render_single: Session finished. > -------------- > 2a) > Loaded hdv09_04.m2t > Render: > Output to file: > /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 > File format: FFMPEG-mp4 > > Compression: h265_qsv.mp4 > Pixels: qsv > > [hevc_qsv encoder @ 0x7f44e0d0bd80] > [Eval @ 0x7f44e57eb6f0] Undefined > constant or missing '(' in 'high' > [hevc_qsv encoder @ 0x7f44e0d0bd80] > Unable to parse option value "high" > [hevc_qsv encoder @ 0x7f44e0d0bd80] > Error setting option profile to > value high. > FFMPEG::open_encoder err: Invalid > argument > int FFMPEG::open_encoder(const > char*, const char*): > open failed > hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 > Render::render_single: Session finished. >
# profile=high Pixels: qsv (yuv420 isn't available)
Didn't render: FFMPEG::open_encoder err: Internal bug, should not have happened int FFMPEG::open_encoder(const char*, const char*): open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 Render::render_single: Session finished.
> ---------------- > 2b) > Compression: h265_qsv.mp4 > Pixels: p010le > > [hevc_qsv encoder @ 0x7f93dcdb3c00] > [Eval @ 0x7f93cbff06f0] Undefined > constant or missing '(' in 'high' > [hevc_qsv encoder @ 0x7f93dcdb3c00] > Unable to parse option value "high" > [hevc_qsv encoder @ 0x7f93dcdb3c00] > Error setting option profile to > value high. > FFMPEG::open_encoder err: Invalid > argument > int FFMPEG::open_encoder(const > char*, const char*): > open failed > hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 > Render::render_single: Session finished. >
Some progress:
# profile=high Pixels: yuvy422 (yuv420 isn't available) Settings>Appearance: BT.709/MPEG2
Rendered: Render::render_single: Session finished. ** rendered 5972 frames in 33.999 secs, 175.652 fps audio0 pad 64 0 (64)
VLC playback OK
ffprobe -hide_banner hdv09_04_h265_qsv.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf61.1.100 Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0]
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the |hwupload| filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a |format| filter immediately before to get the input into the right format (hardware generally wants the |nv12| layout, but most software functions use the |yuv420p| layout). The |hwupload| filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not?
I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now).
Sorry about such extended debugging. Thanks for patience (over the years!)
I did a summary testing today with results before patching:
1) dv_movie.mpg (progressive) dv01_07.dv (interlaced)
av1_qsv/vp9_qsv rendering works with nv12 and p010le h264_qsv rendering works with nv12
2) hdv09_04.m2t (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
hdv_movie_0.mpg (progressive) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
3) hd01.mov (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
---------------------------
After adding the latest two patches and make install, 1) above doesn't work anymore. Tried also to comment out each of the two new options. Any idea why?
no idea o.O
To verify if my patch procedure was right (?) here is my procedure and output:
# git am 0001-Add-nv12-as-def.-pixformat-for-qsv-profiles-clarify-.patch Applying: Add nv12 as def. pixformat for qsv profiles, clarify when it work .git/rebase-apply/patch:18: new blank line at EOF. + warning: 1 line adds whitespace errors. localhost:/home/cinelerra/cinelerra-5.1
# git am 0002-Modify-remaining-_qsv-orofiles-to-use-nv12-fix-typo-.patch Applying: Modify remaining _qsv orofiles to use nv12, fix typo in hevc_qsv
# make install > make_install.log 2>&1
Attach make_install.log by email
does "git reset --hard git-hash-before-you-added-patches" && make install restore 1) ?
Could you explain or detqail this a bit more?
use git log, it will show long commit hash (bunch of numbers and letters). Note commit hash for commit just adding qsv profiles, two commits below from top.
try select it fully or first 8 (?) characters into clipboard
execute "git reset --hard "insert from clipboard"
verify with git log that two new commits are gone.
make install again
As I am quite unfamiliar and uncomfortable with this stuff, this might be over my head. Maybe I better reconstruct the previous install instead? I succeeded to still get the most robust method to work h265_qsv rendering works with nv12 and p010le and #profile high So I wonder if something may have happened with h264/av1/vp9-qsv with default nv12 some new options, because they worked in 1) before patching.
normal ffmpeg renders all three input files with qsv encoders, right?
I think so, but can try afterwards.
there is another set of settings to try with av1 encode:
https://forum.level1techs.com/t/ffmpeg-av1-encoding-using-intel-arc-gpu-tips...
I have not continued with 2) and 3) above so far.
сб, 28 сент. 2024 г., 23:07 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 18:19, skrev Andrew Randrianasulu:
сб, 28 сент. 2024 г., 19:13 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 17:42, skrev Andrew Randrianasulu:
сб, 28 сент. 2024 г., 18:35 Terje J. Hanssen <[email protected]>:
Den 28.09.2024 01:22, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 23:27 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 19:45, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 18:55 Terje J. Hanssen <[email protected]>:
Den 27.09.2024 12:44, skrev Andrew Randrianasulu:
пт, 27 сент. 2024 г., 12:40 Terje J. Hanssen <[email protected]
:
Den 26.09.2024 01:18, skrev Andrew Randrianasulu:
On Thu, Sep 26, 2024 at 2:06 AM Terje J. Hanssen < [email protected]> wrote:
> > > Den 25.09.2024 23:22, skrev Andrew Randrianasulu: > > > > чт, 26 сент. 2024 г., 00:16 Terje J. Hanssen < > [email protected]>: > >> >> >> Den 25.09.2024 21:33, skrev Andrew Randrianasulu: >> >> >> >> ср, 25 сент. 2024 г., 18:25 Terje J. Hanssen < >> [email protected]>: >> >>> >>> >>> Den 25.09.2024 00:27, skrev Andrew Randrianasulu: >>> >>> try this git patch, do not forgot to make install again, or put >>> profiles in bin/ffmpeg/video folder manually. >>> >>> >>> # cd /home/cinelerra/cinelerra-5.1 >>> # mv /home/terje/0001-Qsv-encoders-for-testing.patch . >>> >>> # git am 0001-Qsv-encoders-for-testing.patch >>> Applying: Qsv encoders for testing >>> >>> >>> make install > make_install.log 2&1 >>> >> >> >> make install > make_install.log 2>&1 ? >> >> Sorry. I should cleanup all ">" with Find & Replace in my note, and >> oversaw here should be two of them in this command ;( >> >> Now make install went through without faults as I could see, but >> attach it by email again. >> >> But unhappily, no success with testing Cingg Qsv Rendering. >> All attempts so far breaks with the output below: >> >> FFMPEG::open_encoder err: Internal bug, should not have happened >> int FFMPEG::open_encoder(const char*, const char*): >> >> ---------- >> localhost:/home/cinelerra/cinelerra-5.1 # bin/cin >> Cinelerra Infinity - built: Sep 23 2024 10:31:07 >> ---------- >> 1) >> Loaded hdv09_04.m2t >> Render: >> Output to file: /Videoklipp/QSV/hdv09_04_h264_qsv.mp4 >> File format: FFMPEG-mp4 >> Compression: h264_qsv.mp4 >> Pixels: qsv >> >> libva info: VA-API version 1.22.0 >> libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so >> libva info: Found init function __vaDriverInit_1_21 >> libva info: va_openDriver() returns 0 >> libva info: VA-API version 1.22.0 >> libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so >> libva info: Found init function __vaDriverInit_1_21 >> libva info: va_openDriver() returns 0 >> >> FFMPEG::open_encoder err: Internal bug, should not have happened >> int FFMPEG::open_encoder(const char*, const char*): >> open failed h264_qsv:/Videoklipp/QSV/hdv09_04_h264_qsv.mp4 >> Render::render_single: Session finished. >> -------------- >> 2a) >> Loaded hdv09_04.m2t >> Render: >> Output to file: /Videoklipp/QSV/hdv09_04_h265_qsv.mp4 >> File format: FFMPEG-mp4 >> >> Compression: h265_qsv.mp4 >> Pixels: qsv >> >> [hevc_qsv encoder @ 0x7f44e0d0bd80] [Eval @ 0x7f44e57eb6f0] >> Undefined constant or missing '(' in 'high' >> [hevc_qsv encoder @ 0x7f44e0d0bd80] Unable to parse option value >> "high" >> [hevc_qsv encoder @ 0x7f44e0d0bd80] Error setting option profile to >> value high. >> FFMPEG::open_encoder err: Invalid argument >> int FFMPEG::open_encoder(const char*, const char*): >> open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 >> Render::render_single: Session finished. >> > > # profile=high > Pixels: qsv (yuv420 isn't available) > > Didn't render: > FFMPEG::open_encoder err: Internal bug, should not have happened > int FFMPEG::open_encoder(const char*, const char*): > open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 > Render::render_single: Session finished. > > > > ---------------- >> 2b) >> Compression: h265_qsv.mp4 >> Pixels: p010le >> >> [hevc_qsv encoder @ 0x7f93dcdb3c00] [Eval @ 0x7f93cbff06f0] >> Undefined constant or missing '(' in 'high' >> [hevc_qsv encoder @ 0x7f93dcdb3c00] Unable to parse option value >> "high" >> [hevc_qsv encoder @ 0x7f93dcdb3c00] Error setting option profile to >> value high. >> FFMPEG::open_encoder err: Invalid argument >> int FFMPEG::open_encoder(const char*, const char*): >> open failed hevc_qsv:/Videoklipp/QSV/hdv09_04_h265_qsv.mp4 >> Render::render_single: Session finished. >> > > Some progress: > > # profile=high > Pixels: yuvy422 (yuv420 isn't available) > Settings>Appearance: BT.709/MPEG2 > > Rendered: > Render::render_single: Session finished. > ** rendered 5972 frames in 33.999 secs, 175.652 fps > audio0 pad 64 0 (64) > > VLC playback OK > > ffprobe -hide_banner hdv09_04_h265_qsv.mp4 > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdv09_04_h265_qsv.mp4': > Metadata: > major_brand : isom > minor_version : 512 > compatible_brands: isomiso2mp41 > encoder : Lavf61.1.100 > Duration: 00:03:58.88, start: 0.000000, bitrate: 3359 kb/s > Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), > yuv422p(tv, bt709/unknown/unknown, top coded first (swapped)), 1440x1080 > [SAR 4:3 DAR 16:9], 3223 kb/s, 25 fps, 25 tbr, 12800 tbn (default) > Metadata: > handler_name : VideoHandler > vendor_id : [0][0][0][0] > Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 > Hz, stereo, fltp, 129 kb/s (default) > Metadata: > handler_name : SoundHandler > vendor_id : [0][0][0][0] > >
ah, so it need tv range .. try also with Pixels nv12 (worked for me on mediacodec)
Not really., Also the default at first startup, appearance BT.601-PAL/MJPEG, worked, and then ffprobe output Stream #0:0[0x1](und): Video: hevc (Rext) (hev1 / 0x31766568), yuv422p(pc, bt470bg/unknown/unknown, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], 3248 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
I just changed it to BT.701/MPEG which is for HD video, and I also remembed you also suggested this in a previous thread.
Both yuv422 and nv12 work.
But why isn't also the usual yuv420p available for h264 and h265?
not sure, may be qsv library does not support this?
at least I can't see it in source
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/qsvenc_hevc.c...
Possibly also rename h265 to hevc as ffmpeg use?
ok, I'll rename it and add nv12 as default pix format.
can you also see if h264 works with nv12?
No, h264 doesn't work with nv12, neither with # profile=high
I've extracted three ffmpeg QSV code lines below with qsv and yuv420p used from https://trac.ffmpeg.org/wiki/Hardware/QuickSync#FullExamples
ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p output.yuv ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -vf hwdownload,format=nv12 -pix_fmt yuv420p -f sdl - ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -i input.yuv -vf hwupload=extra_hw_frames=64,format=qsv -c:v h264_qsv -b:v 5M output.mp4
On the other hand the following VAAPI section and code lines from 'The encoders only accept input as VAAPI surfaces. If the input is in normal memory, it will need to be uploaded before giving the frames to the encoder - in the ffmpeg utility, the hwupload filter can be used for this. It will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format (hardware generally wants the nv12 layout, but most software functions use the yuv420p layout). The hwupload filter also requires a device to upload to, which needs to be defined before the filter graph is created.'
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4
and from my own ffmpeg test
ffmpeg -hide_banner -hwaccel_output_format qsv -i hdv09_04.m2t hdv09_04_h264_qsv.mp4
note that this line uses *software* x264 encoder, not qsv.
Yeah, I was confused by the "-hwaccel_output_format qsv" See below for another attempt
Does av1_qsv/vp9_qsv works? Can you also try with progressive (not interlaced) video?
Sorry, none of av1_qsv nor vp9_qsv pixel formats work (interlaced hdv input) I was looking for a progressive video to download?
you can try to add deinterlacing filter in cingg? Do not forgot to set format- > interlacing to progressive.
But I tested "h284_qsv/nv12/profile high" rendering wiht SD-DV file (interlaced) and it worked
FFStream::encode_frame: encode failed. file: /Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Resource temporarily unavailable FFStream::flush failed :file:/Videoklipp/QSV/dv01_07_h264_qsv.mp4 err: Operation not permitted Render::render_single: Session finished. ** rendered 2832 frames in 5.592 secs, 506.438 fps audio0 pad 32 0 (32)
---------------------
so, h264/5 qsv in cingg works, but vp9/av1 not?
I'll add two more silly patches as attachment, they hopefully correct hevc/h264 profiles and add remark about how they only usable with ext. ffmpeg (for now).
Sorry about such extended debugging. Thanks for patience (over the years!)
I did a summary testing today with results before patching:
1) dv_movie.mpg (progressive) dv01_07.dv (interlaced)
av1_qsv/vp9_qsv rendering works with nv12 and p010le h264_qsv rendering works with nv12
2) hdv09_04.m2t (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
hdv_movie_0.mpg (progressive) av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
3) hd01.mov (interlaced)
av1_qsv/vp9_qsv nv12/p010le error ... h264_qsv nv12 error ... hevc_qsv nv12/p010le does render #high profile
---------------------------
After adding the latest two patches and make install, 1) above doesn't work anymore. Tried also to comment out each of the two new options. Any idea why?
no idea o.O
To verify if my patch procedure was right (?) here is my procedure and output:
# git am 0001-Add-nv12-as-def.-pixformat-for-qsv-profiles-clarify-.patch Applying: Add nv12 as def. pixformat for qsv profiles, clarify when it work .git/rebase-apply/patch:18: new blank line at EOF. + warning: 1 line adds whitespace errors. localhost:/home/cinelerra/cinelerra-5.1
# git am 0002-Modify-remaining-_qsv-orofiles-to-use-nv12-fix-typo-.patch Applying: Modify remaining _qsv orofiles to use nv12, fix typo in hevc_qsv
# make install > make_install.log 2>&1
Attach make_install.log by email
does "git reset --hard git-hash-before-you-added-patches" && make install restore 1) ?
Could you explain or detqail this a bit more?
use git log, it will show long commit hash (bunch of numbers and letters). Note commit hash for commit just adding qsv profiles, two commits below from top.
try select it fully or first 8 (?) characters into clipboard
execute "git reset --hard "insert from clipboard"
verify with git log that two new commits are gone.
make install again
As I am quite unfamiliar and uncomfortable with this stuff, this might be over my head. Maybe I better reconstruct the previous install instead?
I succeeded to still get the most robust method to work h265_qsv rendering works with nv12 and p010le and #profile high
So I wonder if something may have happened with h264/av1/vp9-qsv with default nv12 some new options, because they worked in 1) before patching.
sure, you can just edit those profile files manually, either in bin/ffmpeg or in ffmpeg/ you can comment out cin_pix_format line and select "pixels" manually. Also, you can try to set bitrate to some value, like 1000k , by butting b=1000k in gui profile editor. I am honestly very surprised why only hevc works reliably. I thought if something set up wrong hevc will be first to fail. But we have what we have: yet another mystery in sw/hw land!
normal ffmpeg renders all three input files with qsv encoders, right?
I think so, but can try afterwards.
there is another set of settings to try with av1 encode:
https://forum.level1techs.com/t/ffmpeg-av1-encoding-using-intel-arc-gpu-tips...
I have not continued with 2) and 3) above so far.
вт, 24 сент. 2024 г., 23:20 Andrew Randrianasulu <[email protected]>:
got answer from ffmpeg devs
https://ffmpeg.org//pipermail/ffmpeg-devel/2024-September/333906.html
tried to add this line to bin/ffmpeg/decode.opts on termux remap_video_decoder hevc=hevc_mediacodec it seems to work, but automatic fallback to sw decoding does not work, so you can try to remap normal h264/hevc/av1/vp9 to qsv codecs if linked with suitable (system) ffmpeg, but how well it will work depends on hw/driver. I also created mediacodec encoders profiles for hevcand h264 - they seems to work now on ffmpeg 6.1.2. see attached git am patch mpeg2_hdv is stray one you probably do not need - was experimenting with parameters, but without real HDV camera it a bit pointless (camera's decoder tend to be much less forgiving than sw decoder)
participants (2)
-
Andrew Randrianasulu -
Terje J. Hanssen