Closed maulonobile closed 4 years ago
Currently, Proxy > Use Hardware Encoder only supports HEVC. See https://forum.shotcut.org/t/proxy-editing/18517
In my testing there is little-to-no advantage to using H.264 hardware encoder for proxy generation. The speed and energy saving is usually not better, while the file size is larger and quality much worse. Does your computer support hevc_qsv
?
No, my cpu does not support hevc_qsv.
Forcing hevc_qsv:
ffmpeg version n4.3.1-18-g6d886b6 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 5.5.0 (GCC) configuration: --prefix=/root/shotcut/shotcut/Shotcut --disable-static --disable-doc --enable-gpl --enable-version3 --enable-shared --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libopus --enable-libmfx --cross-prefix=x86_64-w64-mingw32.shared- --arch=x86_64 --target-os=mingw32 --pkg-config=pkg-config libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100[h264 @ 0000000000cab580] Reinit context to 1920x1088, pix_fmt: yuv420p Input #0, matroska,webm, from 'D:/Screencast_OBS/2020-10-08_13-50-46.mkv': Metadata: ENCODER : Lavf58.29.100 Duration: 00:11:50.13, start:0.000000, bitrate:3274 kb/s Stream #0:0: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709, progressive, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 1k tbn, 60 tbc (default) Metadata: DURATION : 00:11:50.133000000 Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default) Metadata: title : Track1 DURATION : 00:11:50.080000000 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_qsv)) Stream #0:1 -> #0:1 (aac (native) -> ac3 (native)) Press [q] to stop, [?] for help [h264 @ 000000000254c5c0] Reinit context to 1920x1088, pix_fmt: yuv420p [graph_1_in_0_1 @ 0000000002894e00] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3 [Parsed_scale_1 @ 0000000002a15f40] w:-2 h:540 flags:'bicubic' interl:0 [graph 0 input from stream 0:0 @ 0000000002a6c1c0]w:1920 h:1080 pixfmt:yuv420p tb:1/1000 fr:30/1 sar:1/1Incompatible pixel format 'yuv420p' for codec 'hevc_qsv', auto-selecting format 'nv12'[Parsed_scale_1 @ 0000000002a15f40] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:960 h:540 fmt:nv12 sar:1/1 flags:0x4 [hevc_qsv @ 0000000002a6c540] Initialized an internal MFX session using hardware accelerated implementation [hevc_qsv @ 0000000002a6c540] Using the constant quantization parameter (CQP) ratecontrol method [hevc_qsv @ 0000000002a6c540] Selected ratecontrol mode is unsupported [hevc_qsv @ 0000000002a6c540] Low power mode is unsupported [hevc_qsv @ 0000000002a6c540] Current frame rate is unsupported [hevc_qsv @ 0000000002a6c540] Current picture structure is unsupported [hevc_qsv @ 0000000002a6c540] Current resolution is unsupported [hevc_qsv @ 0000000002a6c540] Current pixel format is unsupported [hevc_qsv @ 0000000002a6c540] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters. Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height [AVIOContext @ 0000000000caedc0] Statistics: 0 seeks, 0 writeouts [AVIOContext @ 000000000246c040] Statistics: 531092 bytes read, 0 seeks Conversion failed! Failed with exit code 1
on my system, It's true files are larger 3x than normal but QSV encoder is almost speeder 4x than h264 standard. :) Anyway, thank you so much!
OK, I will accept it as a bug that you enabled hardware encoder but it did not use it.
Shotcut 20.09.27 on my Windows 10 Home 1909 does not use QSV encoder creating proxy videos. Export video is ok. My cpu Intel G3258 with Intel HD graphics.
This is FFMPEG output proxying a video:
ffmpeg version n4.3.1-18-g6d886b6 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 5.5.0 (GCC) configuration: --prefix=/root/shotcut/shotcut/Shotcut --disable-static --disable-doc --enable-gpl --enable-version3 --enable-shared --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libopus --enable-libmfx --cross-prefix=x86_64-w64-mingw32.shared- --arch=x86_64 --target-os=mingw32 --pkg-config=pkg-config libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, matroska,webm, from 'C:/Users/mauri/Desktop/ffmpeg/Quale tra queste fotocamere preferisci-ViE2eYPpudg.webm': Metadata: ENCODER : Lavf58.39.101 Duration: 00:03:08.76, start: -0.007000, bitrate: 1052 kb/s Stream #0:0(eng): Video: vp9 (Profile 0), 1 reference frame, yuv420p(tv, bt709), 1280x720, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn, 1k tbc (default) Metadata: DURATION : 00:03:08.733000000 Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp, delay 312 (default) Metadata: DURATION : 00:03:08.761000000 Stream mapping: Stream #0:0 -> #0:0 (vp9 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (opus (native) -> ac3 (native)) Press [q] to stop, [?] for help [graph_1_in_0_1 @ 000000000276ae00] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3 [Parsed_scale_1 @ 0000000003312700] w:-2 h:540 flags:'bicubic' interl:0 [graph 0 input from stream 0:0 @ 0000000003312bc0] w:1280 h:720 pixfmt:yuv420p tb:1/1000 fr:30/1 sar:1/1 [Parsed_scale_1 @ 0000000003312700] w:1280 h:720 fmt:yuv420p sar:1/1 -> w:960 h:540 fmt:yuv420p sar:1/1 flags:0x4 [libx264 @ 000000000014cd00] using SAR=1/1 [libx264 @ 000000000014cd00] using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 [libx264 @ 000000000014cd00] profile High, level 3.1, 4:2:0, 8-bit [libx264 @ 000000000014cd00] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=1 keyint_min=1 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'D:/Screencast_OBS/Proxy/9b0910a58cb256802b283022ec6aea09.pending.mp4': Metadata: encoder : Lavf58.45.100 Stream #0:0(eng): Video: h264 (libx264), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709), 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default) Metadata: DURATION : 00:03:08.733000000 encoder : Lavc58.91.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, delay 256, 256 kb/s (default) Metadata: DURATION : 00:03:08.761000000 encoder : Lavc58.91.100 ac3