Jellyfin Forum
SOLVED: QSV Transcoding not working - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: QSV Transcoding not working (/t-solved-qsv-transcoding-not-working--6452)



QSV Transcoding not working - podonnell - 2024-06-10

I was getting 100% CPU utilization as I have an older CPU/GPU in my media server (GTX 570 & i7-4790k), so I turned on QSV hardware decoding. Now, a device that would previously play media is unable to play anything at all. Checking my logs, for each time I try to play media on that device, a ffmpeg.transcode log entry is created. On my other devices that work, I get a ffmpeg.directstream entry instead, with no issues. I have tried about 5 titles and they each led to the same error.

That said, I am trying to have my devices do direct play and not require transcoding. They each support HDR, Dolby Vision, and 4k. I have not confirmed if the audio formats are all supported, but would that be as heavy of a transcode? Nevertheless, this one device is creating a transcode, but others are not. My problematic TV is a Hisense 55U6HSKU Google 4k TV.

I'm on version 10.9.0

- OS: Windows 10
- Clients: Jellyfin App for Android TV
- FFmpeg Version: ffmpeg version 6.0.1-Jellyfin
- Playback Method: Have attempted all player options including getting MX Player and choosing 'external player'
- Hardware Acceleration: QSV
- GPU Model: GeForce 570
- Networking: Playing over LAN to TV

Relevant Jellyfin logs:

[2024-06-09 22:51:37.215 -04:00] [ERR] [51] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/c9a75433-d62a-e5b0-dde1-1eb73b5ce769/hls1/main/0.ts".
MediaBrowser.Common.FfmpegException: FFmpeg exited with code 1
  at MediaBrowser.MediaEncoding.Transcoding.TranscodeManager.StartFfMpeg(StreamState state, String outputPath, String commandLineArguments, Guid userId, TranscodingJobType transcodingJobType, CancellationTokenSource cancellationTokenSource, String workingDirectory)
  at Jellyfin.Api.Controllers.DynamicHlsController.GetDynamicSegment(StreamingRequestDto streamingRequest, Int32 segmentId)
  at Jellyfin.Api.Controllers.DynamicHlsController.GetHlsVideoSegment(Guid itemId, String playlistId, Int32 segmentId, String container, Int64 runtimeTicks, Int64 actualSegmentLengthTicks, Nullable1 static, String params, String tag, String deviceProfileId, String playSessionId, String segmentContainer, Nullable1 segmentLength, Nullable1 minSegments, String mediaSourceId, String deviceId, String audioCodec, Nullable1 enableAutoStreamCopy, Nullable1 allowVideoStreamCopy, Nullable1 allowAudioStreamCopy, Nullable1 breakOnNonKeyFrames, Nullable1 audioSampleRate, Nullable1 maxAudioBitDepth, Nullable1 audioBitRate, Nullable1 audioChannels, Nullable1 maxAudioChannels, String profile, String level, Nullable1 framerate, Nullable1 maxFramerate, Nullable1 copyTimestamps, Nullable1 startTimeTicks, Nullable1 width, Nullable1 height, Nullable1 maxWidth, Nullable1 maxHeight, Nullable1 videoBitRate, Nullable1 subtitleStreamIndex, Nullable1 subtitleMethod, Nullable1 maxRefFrames, Nullable1 maxVideoBitDepth, Nullable1 requireAvc, Nullable1 deInterlace, Nullable1 requireNonAnamorphic, Nullable1 transcodingMaxAudioChannels, Nullable1 cpuCoreLimit, String liveStreamId, Nullable1 enableMpegtsM2TsMode, String videoCodec, String subtitleCodec, String transcodeReasons, Nullable1 audioStreamIndex, Nullable1 videoStreamIndex, Nullable1 context, Dictionary`2 streamOptions)


Relevant ffmpeg logs, truncated a bit:

ffmpeg -analyzeduration 200M -probesize 1G -init_hw_device d3d11va=dx11:,vendor=0x8086 -init_hw_device qsv=qs@dx11 -filter_hw_device qs -noautorotate -i file:"S:\video.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_qsv -preset veryfast -look_ahead 0 -b:v 17453235 -maxrate 17453235 -bufsize 34906470 -g:v:0 72 -keyint_min:v:0 72 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,1920)/2)*2:trunc(ow/a/2)*2,format=nv12" -codec:a:0 libfdk_aac -ac 2 -ab 256000 -af "volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "C:\Jellyfin\Data\cache\transcodes\cf2c12d6aaae96562081366167262d73%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "C:\Jellyfin\Data\cache\transcodes\cf2c12d6aaae96562081366167262d73.m3u8"


ffmpeg version 6.0.1-Jellyfin Copyright © 2000-2023 the FFmpeg developers
  built with gcc 13-win32 (GCC)
  configuration: --prefix=/opt/ffmpeg --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=Jellyfin --disable-ffplay --disable-debug --disable-doc --disable-sdl2 --disable-ptx-compression --disable-w32threads --enable-pthreads --enable-shared --enable-lto --enable-gpl --enable-version3 --enable-schannel --enable-iconv --enable-libxml2 --enable-zlib --enable-lzma --enable-gmp --enable-chromaprint --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libwebp --enable-libvpx --enable-libzimg --enable-libx264 --enable-libx265 --enable-libsvtav1 --enable-libdav1d --enable-libfdk-aac --enable-opencl --enable-dxva2 --enable-d3d11va --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec    60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter    9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample  4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[AVHWDeviceContext @ 00000234a6bbab40] Using device 8086:0412 (Intel® HD Graphics 4600).
[AVHWDeviceContext @ 00000234a6c89bc0] Error creating a MFX session: -9.
Device creation failed: -1313558101.
Failed to set value 'qsv=qs@dx11' for option 'init_hw_device': Unknown error occurred
Error parsing global options: Unknown error occurred


RE: QSV Transcoding not working - TheDreadPirate - 2024-06-10

Try VAAPI instead of QSV. I'm not sure if Intel deprecated support for that CPU in their drivers.


RE: QSV Transcoding not working - podonnell - 2024-06-11

(2024-06-10, 10:16 PM)TheDreadPirate Wrote: Try VAAPI instead of QSV.  I'm not sure if Intel deprecated support for that CPU in their drivers.

Thanks, trying this now. Any other settings I should consider changing while making this adjustment?

[Image: image.png]


RE: QSV Transcoding not working - podonnell - 2024-06-11

VAAPI worked!

What is the best way to tell -why- something requires a transcode? And any idea if an audio transcode is as heavy as a video transcode?

I did end up getting some stuttering and ended up finding out that my TV's Ethernet is capped at 100 Mbps, while the WiFi in the TV is at 300 Mbps. That was quite the discovery.
Switching to WiFi allows me to hit the 120 Mbps that Jellyfin was streaming to the TV at, and I believe my stuttering is done.

I'd still love to eliminate transcoding entirely so if someone knows the answer to either of my above questions, that'd be great. I'll otherwise mark this as complete in a few days.


RE: QSV Transcoding not working - TheDreadPirate - 2024-06-11

There USED to be a log message called "TranscodeReason" but that doesn't appear to exist anymore. In our web based clients, if you click on the gear in the bottom right and click playback info it will show you the reason it transcoded.