Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choppy playback of interlaced content with QSV accelerated transcoding #427

Closed
5 tasks done
xarblu opened this issue Aug 1, 2024 · 8 comments
Closed
5 tasks done
Labels
bug Something isn't working

Comments

@xarblu
Copy link

xarblu commented Aug 1, 2024

This issue respects the following points:

  • This is a bug, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found here.
  • This issue is not already reported on GitHub (I've searched it).
  • I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue.
  • I agree to follow Jellyfin's Code of Conduct.
  • This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.

Description of the bug

When QSV is chosen as hardware acceleration (de- & encoder) the produced video stream is "choppy" (looks like low fps)

Reproduction steps

  1. Select QSV as the hardware acceleration mode
  2. Uncheck "Prefer OS native DXVA or VA-API hardware decoders"
  3. Play an interlaced video (should be decoded by QSV decoder)

What is the current bug behavior?

The video playback stutters/has low fps.

What is the expected correct behavior?

Should play back smooth.

Jellyfin Server version

10.9.8+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.9.8

Environment

- OS: Gentoo Linux
- Linux Kernel: 6.9.10-gentoo-dist
- Virtualization: none
- Clients: Web
- Browser: Firefox
- FFmpeg Version: 6.0.1-Jellyfin (6.0.1.8)
- Playback Method: Transcoding
- Hardware Acceleration: QSV
- GPU Model: Intel Arc 380
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage:

Jellyfin logs

[2024-08-02 01:12:45.409 +02:00] [INF] [41] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/bin/ffmpeg" "-analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel qsv -hwaccel_output_format qsv -c:v h264_qsv -noautorotate -canvas_size 1920x1080 -i file:\"/mnt/Fileserver/Media/Jellyfin Testing/S08E01 Deep Breath.mkv\" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:0 -codec:v:0 av1_qsv -preset veryfast -b:v 33783054 -maxrate 33783054 -bufsize 67566108 -g:v:0 75 -keyint_min:v:0 75 -filter_complex \"[0:4]scale=-1:1080:fast_bilinear,scale,crop,pad=max(1920\,iw):max(1080\,ih):(ow-iw)/2:(oh-ih)/2:black@0,crop=1920:1080,format=bgra,hwupload=derive_device=qsv:extra_hw_frames=64[sub];[0:0]setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,deinterlace_qsv=mode=2,scale_qsv=format=nv12[main];[main][sub]overlay_qsv=eof_action=pass:repeatlast=0:w=1920:h=1080\" -start_at_zero -codec:a:0 libfdk_aac -ac 2 -vbr:a 5 -af \"volume=2\" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename \"6ccd9254bc6d803fbafcee4f65368864-1.mp4\" -start_number 0 -hls_segment_filename \"/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f65368864%d.mp4\" -hls_playlist_type vod -hls_list_size 0 -y \"/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f65368864.m3u8\""

FFmpeg logs

{"Protocol":0,"Id":"570f005bb50a409cf8e72794128dca08","Path":"/mnt/Fileserver/Media/Jellyfin Testing/S08E01 Deep Breath.mkv","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mkv","Size":19381203214,"Name":"S08E01 Deep Breath","IsRemote":false,"ETag":"380ab038a33f38c5baaf6bd41f9f5aff","RunTimeTicks":45895680000,"ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"OpenToken":null,"RequiresClosing":false,"LiveStreamId":null,"BufferMs":null,"RequiresLooping":false,"SupportsProbing":true,"VideoType":0,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"h264","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":null,"VideoRange":1,"VideoRangeType":1,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"1080i H264 SDR","NalLengthSize":"4","IsInterlaced":true,"IsAVC":true,"ChannelLayout":null,"BitRate":33783054,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":1080,"Width":1920,"AverageFrameRate":25,"RealFrameRate":25,"Profile":"High","Type":1,"AspectRatio":"16:9","Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":41,"IsAnamorphic":false},{"Codec":"dts","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":"Surround 5.1","VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Default","LocalizedForced":null,"LocalizedExternal":"External","LocalizedHearingImpaired":null,"DisplayTitle":"Surround 5.1 - English - DTS-HD MA - Default","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"5.1","BitRate":2201942,"BitDepth":16,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":"DTS-HD MA","Type":0,"AspectRatio":null,"Index":1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"dts","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":"Surround 5.1","VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Default","LocalizedForced":null,"LocalizedExternal":"External","LocalizedHearingImpaired":null,"DisplayTitle":"Surround 5.1 - English - DTS","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"5.1","BitRate":1536000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":"DTS","Type":0,"AspectRatio":null,"Index":2,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"ac3","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":"Stereo","VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Default","LocalizedForced":null,"LocalizedExternal":"External","LocalizedHearingImpaired":null,"DisplayTitle":"Stereo - English - Dolby Digital","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"stereo","BitRate":192000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":2,"SampleRate":48000,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":3,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"PGSSUB","CodecTag":null,"Language":"eng","ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":"Undefined","LocalizedDefault":"Default","LocalizedForced":"Forced","LocalizedExternal":"External","LocalizedHearingImpaired":"Hearing Impaired","DisplayTitle":"English - PGSSUB","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":null,"BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":1080,"Width":1920,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":2,"AspectRatio":null,"Index":4,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":37712996,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":0,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/bin/ffmpeg -analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel qsv -hwaccel_output_format qsv -c:v h264_qsv -noautorotate -canvas_size 1920x1080 -i file:"/mnt/Fileserver/Media/Jellyfin Testing/S08E01 Deep Breath.mkv" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:0 -codec:v:0 av1_qsv -preset veryfast -b:v 33783054 -maxrate 33783054 -bufsize 67566108 -g:v:0 75 -keyint_min:v:0 75 -filter_complex "[0:4]scale=-1:1080:fast_bilinear,scale,crop,pad=max(1920\,iw):max(1080\,ih):(ow-iw)/2:(oh-ih)/2:black@0,crop=1920:1080,format=bgra,hwupload=derive_device=qsv:extra_hw_frames=64[sub];[0:0]setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,deinterlace_qsv=mode=2,scale_qsv=format=nv12[main];[main][sub]overlay_qsv=eof_action=pass:repeatlast=0:w=1920:h=1080" -start_at_zero -codec:a:0 libfdk_aac -ac 2 -vbr:a 5 -af "volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "6ccd9254bc6d803fbafcee4f65368864-1.mp4" -start_number 0 -hls_segment_filename "/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f65368864%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f65368864.m3u8"


ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Gentoo 13.3.1_p20240614 p17)
  configuration: --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --nm=x86_64-pc-linux-gnu-nm --strip=x86_64-pc-linux-gnu-strip --ranlib=x86_64-pc-linux-gnu-ranlib --pkg-config=x86_64-pc-linux-gnu-pkg-config --optflags='-march=native -O2 -pipe' --enable-avfilter --disable-stripping --disable-optimizations --disable-libcelt --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --enable-pic --cpu=host --prefix=/usr/lib/jellyfin-ffmpeg --libdir=/usr/lib/jellyfin-ffmpeg/lib64 --shlibdir=/usr/lib/jellyfin-ffmpeg/lib64 --enable-rpath --extra-version=Jellyfin --disable-devices --disable-doc --disable-ffplay --disable-ptx-compression --disable-autodetect --enable-shared --disable-static --disable-runtime-cpudetect --enable-gpl --enable-version3 --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --enable-opencl --enable-libvpl --enable-vaapi --enable-libshaderc --enable-libplacebo --enable-vulkan
  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
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib64/va/drivers/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/va/drivers/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
Input #0, matroska,webm, from 'file:/mnt/Fileserver/Media/Jellyfin Testing/S08E01 Deep Breath.mkv':
  Metadata:
    title           : S08E01 Deep Breath
    encoder         : libmakemkv v1.17.7 (1.3.10/1.5.2) x86_64-pc-linux-gnu
    creation_time   : 2024-07-30T16:30:17.000000Z
  Duration: 01:16:29.57, start: 0.000000, bitrate: 33783 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 396.920000
      Metadata:
        title           : Chapter 01
    Chapter #0:1: start 396.920000, end 706.600000
      Metadata:
        title           : Chapter 02
    Chapter #0:2: start 706.600000, end 1055.040000
      Metadata:
        title           : Chapter 03
    Chapter #0:3: start 1055.040000, end 1437.200000
      Metadata:
        title           : Chapter 04
    Chapter #0:4: start 1437.200000, end 1970.320000
      Metadata:
        title           : Chapter 05
    Chapter #0:5: start 1970.320000, end 2421.840000
      Metadata:
        title           : Chapter 06
    Chapter #0:6: start 2421.840000, end 2933.680000
      Metadata:
        title           : Chapter 07
    Chapter #0:7: start 2933.680000, end 3393.200000
      Metadata:
        title           : Chapter 08
    Chapter #0:8: start 3393.200000, end 3561.440000
      Metadata:
        title           : Chapter 09
    Chapter #0:9: start 3561.440000, end 4010.880000
      Metadata:
        title           : Chapter 10
    Chapter #0:10: start 4010.880000, end 4523.880000
      Metadata:
        title           : Chapter 11
    Chapter #0:11: start 4523.880000, end 4589.568000
      Metadata:
        title           : Chapter 12
  Stream #0:0(eng): Video: h264 (High), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn
    Metadata:
      BPS-eng         : 29833638
      DURATION-eng    : 01:16:29.560000000
      NUMBER_OF_FRAMES-eng: 114739
      NUMBER_OF_BYTES-eng: 17115408981
      SOURCE_ID-eng   : 001011
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.7 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-07-30 16:30:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s16p (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 2201942
      DURATION-eng    : 01:16:29.568000000
      NUMBER_OF_FRAMES-eng: 430272
      NUMBER_OF_BYTES-eng: 1263245528
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.7 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-07-30 16:30:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 1509000
      DURATION-eng    : 01:16:29.568000000
      NUMBER_OF_FRAMES-eng: 430272
      NUMBER_OF_BYTES-eng: 865707264
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.7 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-07-30 16:30:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:3(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : Stereo
      BPS-eng         : 192000
      DURATION-eng    : 01:16:29.568000000
      NUMBER_OF_FRAMES-eng: 143424
      NUMBER_OF_BYTES-eng: 110149632
      SOURCE_ID-eng   : 001101
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.7 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-07-30 16:30:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:4(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Metadata:
      BPS-eng         : 41791
      DURATION-eng    : 01:15:49.340000000
      NUMBER_OF_FRAMES-eng: 2236
      NUMBER_OF_BYTES-eng: 23765542
      SOURCE_ID-eng   : 001200
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.7 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-07-30 16:30:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
Stream mapping:
  Stream #0:0 (h264_qsv) -> setparams:default (graph 0)
  Stream #0:4 (pgssub) -> scale:default (graph 0)
  overlay_qsv:default (graph 0) -> Stream #0:0 (av1_qsv)
  Stream #0:1 -> #0:1 (dts (dca) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[libfdk_aac @ 0x55a35e6a3680] Note, the VBR setting is unsupported and only works with some parameter combinations
[matroska,webm @ 0x55a35e3e6b80] sub2video: using 1920x1080 canvas
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f65368864-1.mp4' for writing
Output #0, hls, to '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f65368864.m3u8':
  Metadata:
    encoder         : Lavf60.3.100
  Stream #0:0: Video: av1, qsv(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 33783 kb/s, 50 fps, 12800 tbn
    Metadata:
      encoder         : Lavc60.3.100 av1_qsv
  Stream #0:1: Audio: aac, 48000 Hz, stereo, s16 (default)
    Metadata:
      encoder         : Lavc60.3.100 libfdk_aac
frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed=   0x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688640.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 144336 is out of range
frame=  258 fps=0.0 q=-0.0 size=N/A time=00:00:05.26 bitrate=N/A dup=132 drop=0 speed=8.94x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688641.mp4' for writing
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688642.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 432072 is out of range
frame=  526 fps=482 q=-0.0 size=N/A time=00:00:10.62 bitrate=N/A dup=266 drop=0 speed=9.74x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688643.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 576480 is out of range
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688644.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 720864 is out of range
frame=  770 fps=484 q=-0.0 size=N/A time=00:00:15.53 bitrate=N/A dup=388 drop=0 speed=9.76x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688645.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 864216 is out of range
frame=  994 fps=475 q=-0.0 size=N/A time=00:00:20.01 bitrate=N/A dup=500 drop=0 speed=9.57x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688646.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 1008624 is out of range
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688647.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 1152984 is out of range
frame= 1247 fps=481 q=-0.0 size=N/A time=00:00:25.06 bitrate=N/A dup=626 drop=0 speed=9.67x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688648.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 1296384 is out of range
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f653688649.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 1440720 is out of range
frame= 1514 fps=489 q=-0.0 size=N/A time=00:00:30.37 bitrate=N/A dup=760 drop=0 speed=9.82x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886410.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 1584072 is out of range
frame= 1779 fps=495 q=-0.0 size=N/A time=00:00:35.71 bitrate=N/A dup=892 drop=0 speed=9.93x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886411.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 1728480 is out of range
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886412.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 1872816 is out of range
[vost#0:0/av1_qsv @ 0x55a35e550ec0] More than 1000 frames duplicated
frame= 2070 fps=505 q=-0.0 size=N/A time=00:00:41.49 bitrate=N/A dup=1038 drop=0 speed=10.1x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886413.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 2016240 is out of range
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886414.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 2160624 is out of range
frame= 2332 fps=507 q=-0.0 size=N/A time=00:00:46.80 bitrate=N/A dup=1170 drop=0 speed=10.2x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886415.mp4' for writing
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886416.mp4' for writing
frame= 2602 fps=511 q=-0.0 size=N/A time=00:00:52.13 bitrate=N/A dup=1304 drop=0 speed=10.2x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886417.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 2592768 is out of range
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886418.mp4' for writing
frame= 2862 fps=511 q=-0.0 size=N/A time=00:00:57.32 bitrate=N/A dup=1434 drop=0 speed=10.2x    
[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886419.mp4' for writing
[mp4 @ 0x55a361bfb480] Packet duration: -16 / dts: 2880480 is out of range
frame= 3130 fps=512 q=-0.0 size=N/A time=00:01:02.74 bitrate=N/A dup=1568 drop=0 speed=10.3x    

[q] command received. Exiting.

[hls @ 0x55a35e550600] Opening '/var/lib/jellyfin/transcodes/6ccd9254bc6d803fbafcee4f6536886420.mp4' for writing
frame= 3142 fps=511 q=-0.0 Lsize=N/A time=00:01:02.88 bitrate=N/A dup=1570 drop=0 speed=10.2x    
video:198719kB audio:1491kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

For testing I copied the FFmpeg command and had it write to a .mkv, then findings being:

  • with deinterlace_qsv=mode=2: output with double fps, progressive frames, stuttering
  • without deinterlace_qsv: output of same fps, also progressive frames, no stuttering

I'm no expert on the QSV stack but could it be possible that deinterlace_qsv=mode=2 isn't necessary here and deinterlacing is already covered by codec_qsv decoding?

@xarblu xarblu added the bug Something isn't working label Aug 1, 2024
@xarblu xarblu changed the title Choppy playback of deinterlaced content with QSV accelerated transcoding Choppy playback of interlaced content with QSV accelerated transcoding Aug 1, 2024
@nyanmisaka
Copy link
Member

@xarblu Do you have a sample clip that can reproduce the problem?

@xarblu
Copy link
Author

xarblu commented Aug 6, 2024

@xarblu Do you have a sample clip that can reproduce the problem?

test_interlaced.mp4

This clip reliably reproduces the issue for me. If you want I can also provide a screen recording to show what it looks like.

@nyanmisaka nyanmisaka transferred this issue from jellyfin/jellyfin Aug 6, 2024
@nyanmisaka
Copy link
Member

This seems to be an issue in ffmpeg6, can you upgrade to jellyfin 10.9.9 and try out the ffmpeg7 we are working on?

@xarblu
Copy link
Author

xarblu commented Aug 6, 2024

FFmpeg7 seems to fix this issue, thanks!

Should this be closed then or does it depend on the ffmpeg7 PR?

@nyanmisaka
Copy link
Member

FFmpeg7 seems to fix this issue, thanks!

Should this be closed then or does it depend on the ffmpeg7 PR?

You can keep this open until jellyfin-ffmpeg7 is released.

@xxzandy
Copy link

xxzandy commented Aug 7, 2024

Not directly the issue, but in July Intel devs finally enabled advanced hw-deinterlace(ADI) in iHD (intel-media-driver). It had forever been enabled in the i965 intel-vaapi-driver and the quality was excellent. Now the iHD is no more limited to BOB, but can also do Motion Adaptive (MADI) and Motion Compensated (MCDI) in hardware.
The relevant commit: intel/media-driver@8017d9c . Ffmpeg should already be able to handle this, as it was enabled long ago in the old vaapi-driver. Howver, AFAIK vpp_qsv only has "MFX_DEINTERLACING_ADVANCED" but still better than BOB. I hope to see this eventually also in Jellyfin... (dreaming of a fully GPU transcode pipeline without memcopies).

@nyanmisaka
Copy link
Member

Not directly the issue, but in July Intel devs finally enabled advanced hw-deinterlace(ADI) in iHD (intel-media-driver). It had forever been enabled in the i965 intel-vaapi-driver and the quality was excellent. Now the iHD is no more limited to BOB, but can also do Motion Adaptive (MADI) and Motion Compensated (MCDI) in hardware. The relevant commit: intel/media-driver@8017d9c . Ffmpeg should already be able to handle this, as it was enabled long ago in the old vaapi-driver. Howver, AFAIK vpp_qsv only has "MFX_DEINTERLACING_ADVANCED" but still better than BOB. I hope to see this eventually also in Jellyfin... (dreaming of a fully GPU transcode pipeline without memcopies).

This is a limitation caused by the mis-alignment between iHD driver and VA-API interface definition, not sure why they delayed it for so long. We just need to update iHD and VPL runtime to 24.3.1+ in our next release. As for the zero-copy pipeline, we have supported it for years.

@nyanmisaka
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Closed/Done
Archived in project
Development

No branches or pull requests

3 participants