CESNET / UltraGrid

UltraGrid low-latency audio and video network transmission system
http://www.ultragrid.cz
Other
499 stars 53 forks source link

QSV encoder don't work W11 i5-8350U #281

Closed MatejVik closed 1 year ago

MatejVik commented 1 year ago

Hallo and Happy New Year,

I'm trying to run uv with qsv encoder and decoder, but it always end task without any failure, or warning.

./uv -t testcard -c libavcodec:encoder=h264_qsv:subsampling=420:bitrate=10M -d gl --param force-lavd-decoder=h264_qsv

when I use encoder libx264 / libx265 and decoder h264_qsv / h265_qsv it works so great.

There is a terminal after run with qsv encoder

PS C:\UG18> ./uv -t testcard -c libavcodec:encoder=h264_qsv:subsampling=420:bitrate=10M -d gl --param force-lavd-decoder=h264_qsv
UltraGrid 1.8 (tags/v1.8 rev 38c3c19 built Dec  9 2022 14:47:01)

Display device   : gl
Capture device   : testcard
Audio capture    : none
Audio playback   : none
MTU              : 9000 B
Video compression: libavcodec:encoder=h264_qsv:subsampling=420:bitrate=10M
Audio codec      : PCM
Network protocol : UltraGrid RTP
Audio FEC        : none
Video FEC        : none

GL setup: fullscreen: OFF, deinterlace: OFF
[GL] OpenGL 2.0 is supported...
[GL] Buffer depth - R: 10b, G: 10b, B: 10b
[testcard] capture set to 1920x1080 @50.00i, codec UYVY, bpc 8, pattern: bars, audio off
Control socket listening on port 61085
Setting GL size 512x512 (512x512).
[lavc] Using codec: H.264, encoder: h264_qsv
[lavc] Setting bitrate to 10000.0 kbps.
PS C:\UG18>   

and here is libavcodec help, qsv encoders are listed:

./uv -c libavcodec:help
UltraGrid 1.8 (tags/v1.8 rev 38c3c19 built Dec  9 2022 14:47:01)

Control socket listening on port 60952
Libavcodec encoder usage:
        -c libavcodec[:codec=<codec_name>|:encoder=<encoder>][:bitrate=<bits_per_sec>|:bpp=<bits_per_pixel>][:crf=<crf>|:cqp=<cqp>][q=<q>][:subsampling=<subsampling>][:gop=<gop>][:[disable_]intra_refresh][:threads=<threads>][:slices=<slices>][:<lavc_opt>=<val>]*

where
        <encoder> specifies encoder (eg. nvenc or libx264 for H.264)
        <codec_name> may be specified codec name (default MJPEG), supported codecs:
                H.264 - available (encoders: libx264 libx264rgb h264_amf h264_mf h264_nvenc h264_qsv nvenc nvenc_h264, decoders: h264 h264_qsv h264_cuvid)
                H.265 - available (encoders: libx265 nvenc_hevc hevc_amf hevc_mf hevc_nvenc hevc_qsv, decoders: hevc hevc_qsv hevc_cuvid)
                MJPEG - available (encoders: mjpeg mjpeg_qsv, decoders: mjpeg mjpeg_cuvid mjpeg_qsv)
                VP8 - available (encoders: libvpx, decoders: vp8 libvpx vp8_cuvid vp8_qsv)                VP9 - available (encoders: libvpx-vp9 vp9_qsv, decoders: vp9 libvpx-vp9 vp9_cuvid vp9_qsv)
                J2K - available (encoders: jpeg2000 libopenjpeg, decoders: jpeg2000 libopenjpeg)
                HFYU - available (encoders: huffyuv, decoders: huffyuv)
                FFV1 - available (encoders: ffv1, decoders: ffv1)
                AV1 - available (encoders: libaom-av1 librav1e libsvtav1, decoders: libdav1d libaom-av1 av1 av1_cuvid av1_qsv)
                PRORES - available (encoders: prores prores_aw prores_ks, decoders: prores)
        [disable_]intra_refresh - (do not) use Periodic Intra Refresh (H.264/H.265)
        <bits_per_sec> specifies requested bitrate
                        0 means codec default (same as when parameter omitted)
        <bits_per_pixel> specifies requested bitrate using compressed bits per pixel
                        bitrate = frame width * frame height * bits_per_pixel * fps
        <cqp> use constant QP value
        <crf> specifies CRF factor (only for libx264/libx265)
        <q> quality (qmin, qmax) - range usually from 0 (best) to 50-100 (worst)
        <subsampling> may be one of 444, 422, or 420, default 420 for progresive, 422 for interlaced
        <threads> can be "no", or "<number>[F][S][n]" where 'F'/'S' indicate if frame/slice thr. should be used, both can be used (default slice), 'n' means none;
                  use a comma to add also number of conversion threads (eg. "0S,8"), default: number of logical cores
        <slices> number of slices to use (default: 32)
        <gop> specifies GOP size
        <lavc_opt> arbitrary option to be passed directly to libavcodec (eg. preset=veryfast), eventual colons must be backslash-escaped (eg. for x264opts)

Use '-c libavcodec:encoder=<enc>:help' to display encoder specific options, works on decoders as well (also use keyword "encoder").

Libavcodec version (linked): Lavc58.134.100
Libswscale supported: yes
Exit
alatteri commented 1 year ago

I've never gotten QSV to work, but I use Linux. You can also try --param use-hw-accel instead

MartinPulec commented 1 year ago

I'm trying to run uv with qsv encoder and decoder, but it always end task without any failure, or warning.

./uv -t testcard -c libavcodec:encoder=h264_qsv:subsampling=420:bitrate=10M -d gl --param force-lavd-decoder=h264_qsv

when I use encoder libx264 / libx265 and decoder h264_qsv / h265_qsv it works so great.

So to simplify that, the QuickSync encoder doesn't work, so minimal not-working example is:

uv -t testcard -c libavcodec:encoder=h264_qsv

right? I've tried with i7-8750H, which has Intel UHD 630 (compared to i5-8350U's 620) and it worked for me (both encoder and decoder). But I've tested with Win 10, I may try to retry with W11 if I get it there.

MartinPulec commented 1 year ago

Okay, my fault. I've realized where the problem perhaps lies. There was a small error that has been already fixed by d3dbe09. It is already include in our continous development builds. That's perhaps why it worked for me flawlessly because I've tested with the current version.

The fix will be released in next bugfix release 1.8.1.

(Just FYI, I've also retested the continuous build in W11 and it works but it is quite clear from the above.)

MatejVik commented 1 year ago

Hi Martin, thank u so much, continous build works greatfully with qsv encoder an decoder too. There is one question is a continous dev build safe for show?

M.

st 4. 1. 2023 v 12:17 odesílatel Martin Pulec @.***> napsal:

Okay, my fault. I've realized where the problem perhaps lies. There was a small error that has been already fixed by d3dbe09 https://github.com/CESNET/UltraGrid/commit/d3dbe090f4a9a9cbb715eaf4129144e251bc07cd. It is already include in our continous development builds https://github.com/CESNET/UltraGrid/releases/tag/continuous. That's perhaps why it worked for me flawlessly because I've tested with the current version.

The fix will be released in next bugfix release 1.8.1.

(Just FYI, I've also retested the continuous build in W11 and it works but it is quite clear from the above.)

— Reply to this email directly, view it on GitHub https://github.com/CESNET/UltraGrid/issues/281#issuecomment-1370796702, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5AT3KDSVGUEWKFJVVGRIKTWQVL4NANCNFSM6AAAAAATNPYAKM . You are receiving this because you authored the thread.Message ID: @.***>

alatteri commented 1 year ago

We run continuous Linux build in production.

MartinPulec commented 1 year ago

There is one question is a continuous dev build safe for show?

I'd say so. The continuous channel is not supposed to be unstable. On the other hand, it is true that new bugs may occur (in contrary to the stable channel). But vast majority of them doesn't have any impact on running stability and are rather dispatched during initialization (just like the bug reported by you).