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

green lines occurs when enabling hardware encoding acceleration #5535

Closed
54601 opened this issue Mar 15, 2021 · 4 comments
Closed

green lines occurs when enabling hardware encoding acceleration #5535

54601 opened this issue Mar 15, 2021 · 4 comments
Labels
bug Something isn't working confirmed This issue has been reviewed and confirmed

Comments

@54601
Copy link

54601 commented Mar 15, 2021

Describe the bug

When enabling hardware acceleration through QSV, media were covered with green lines evenly and both the cpu and gpu load is about 40-50%. Disabling hardware acceleration solved the green lines, but the cpu burden is still high and can’t play smoothly.
I have mistakingly installed jellyfin as a service, but I then uninstalled it and reinstalled it normally. I checked my cpu(g4600), which is QSV compatible. And I checked ffmpeg in jellyfin’s folder, which is the same version I saw recommended somewhere in another issue. I then updated my gpu driver, updated my system and installed mediaSDK as well as C++ package as recommended elsewhere. Finally I rebooted the system and restarted jellyfin. But none of the above attempts solved the problem.

System (please complete the following information):

  • OS: win10
  • Virtualization: none
  • Clients: both browser and IOS client
  • Browser: edge
  • Jellyfin Version: 10.7.0
  • Playback: Transcode
  • Installed Plugins: none
  • Reverse Proxy: none
  • Base URL: none
  • Networking: have no idea what that is
  • Storage: SMB

To Reproduce

  1. Enabling hardware acceleration and set it via QSV
  2. Play some rmvb video
  3. See error, while the cpu load is high when play any type of video

Expected behavior

To enable the hardware acceleration

Logs

I don’t see an error report, but I can get the ffmpeg report.

/videos/6eed3fd0-8290-a8ed-915c-1113bcd20b42/hls1/main/185.ts

{"Protocol":0,"Id":"6eed3fd08290a8ed915c1113bcd20b42","Path":"\\zhangningjia\Multimedia\\u7535\u89C6\u5267\YM YPM\[\u662F,\u5927\u81E3].Yes,Minister.S01 E01-03\[\u662F,.\u5927\u81E3].Yes,Minister.S01E01.rmvb","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"rm","Size":119632008,"Name":"[\u662F,.\u5927\u81E3].Yes,Minister.S01E01","IsRemote":false,"ETag":"afdd21e0f228013af545981ab8af137b","RunTimeTicks":17127019520,"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":"cook","CodecTag":"cook","Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":"1/44100","Title":null,"VideoRange":null,"localizedUndefined":null,"localizedDefault":null,"localizedForced":null,"DisplayTitle":"COOK - Stereo","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"stereo","BitRate":44100,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":2,"SampleRate":44100,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":0,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null},{"Codec":"rv40","CodecTag":"RV40","Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"Comment":null,"TimeBase":"1/1000","CodecTimeBase":"1/25","Title":null,"VideoRange":"SDR","localizedUndefined":null,"localizedDefault":null,"localizedForced":null,"DisplayTitle":"SD RV40 SDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":506115,"BitDepth":null,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":368,"Width":480,"AverageFrameRate":25,"RealFrameRate":25,"Profile":null,"Type":1,"AspectRatio":"4:3","Index":1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":-99,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":558798,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":null,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

C:\Program Files\Jellyfin\Server\ffmpeg.exe -ss 00:09:15.000 -noaccurate_seek -init_hw_device qsv=hw -filter_hw_device hw -i file:"\zhangningjia\Multimedia\鐢佃鍓YM YPM[鏄�,澶ц嚕].Yes,Minister.S01 E01-03[鏄�,.澶ц嚕].Yes,Minister.S01E01.rmvb" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:1 -map 0:0 -map -0:s -codec:v:0 h264_qsv -preset 7 -look_ahead 0 -b:v 3163220 -maxrate 3163220 -bufsize 6326440 -profile:v:0 high -level 41 -g:v:0 75 -keyint_min:v:0 75 -sc_threshold:v:0 0 -vf "vpp_qsv=format=nv12" -start_at_zero -vsync -1 -codec:a:0 aac -ac 2 -ab 384000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 185 -hls_segment_filename "C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b.m3u8"

ffmpeg version n4.3.1-Jellyfin Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
configuration: --disable-static --enable-shared --cc='ccache gcc' --cxx='ccache g++' --extra-version=Jellyfin --disable-ffplay --disable-debug --enable-gpl --enable-version3 --enable-bzlib --enable-iconv --enable-lzma --enable-zlib --enable-sdl2 --enable-fontconfig --enable-gmp --enable-libass --enable-libzimg --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-opencl --enable-dxva2 --enable-d3d11va --enable-amf --enable-libmfx --enable-cuda --enable-cuda-llvm --disable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-nvdec --enable-ffnvcodec --enable-gnutls
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
[rm @ 000001fa90490680] Invalid stream index 2 for index at pos 119632006
Input #0, rm, from 'file:\zhangningjia\Multimedia\鐢佃鍓YM YPM[鏄�,澶ц嚕].Yes,Minister.S01 E01-03[鏄�,.澶ц嚕].Yes,Minister.S01E01.rmvb':
Metadata:
title : Yes.Minister.S01E01.Open_Government.(DVD).[sharethefiles.com]
author : PLX_锟斤拷锟杰碉拷锟� 锟斤拷锟斤拷
copyright : www.ragbear.com(C)2007
ASMRuleBook : #($Bandwidth >= 0),Stream0Bandwidth = 44100, Stream1Bandwidth = 505900;
Audiences : Easy RealMedia Tool's Audience;
audioMode : music
Creation Date : 10/3/2007 1:05:18
Description : This File is Created by Easy RealMedia Tools@!
Email : rick@redcheek.net
Generated By : Easy RealMedia Tools V1.8x
HomeWeb : http://redcheek.net
Keywords :
Modification Date: 10/3/2007 1:05:18
videoMode : sharp
Duration: 00:28:32.70, start: 0.000000, bitrate: 558 kb/s
Stream #0:0: Audio: cook (cook / 0x6B6F6F63), 44100 Hz, stereo, fltp, 44 kb/s
Stream #0:1: Video: rv40 (RV40 / 0x30345652), yuv420p, 480x368, 506 kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc
Stream mapping:
Stream #0:1 -> #0:0 (rv40 (native) -> h264 (h264_qsv))
Stream #0:0 -> #0:1 (cook (native) -> aac (native))
Press [q] to stop, [?] for help
[rv40 @ 000001fa904fbfc0] Invalid decoder state: B-frame without reference data.
[rv40 @ 000001fa904b91c0] Context scratch buffers could not be allocated due to unknown size.
[rv40 @ 000001fa904b91c0] Invalid decoder state: B-frame without reference data.
[rv40 @ 000001fa9514fe40] Context scratch buffers could not be allocated due to unknown size.
[rv40 @ 000001fa9514fe40] Invalid decoder state: B-frame without reference data.
[rv40 @ 000001fa95192800] Context scratch buffers could not be allocated due to unknown size.
Error while decoding stream #0:1: Invalid data found when processing input
Last message repeated 2 times
Output #0, hls, to 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b.m3u8':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (h264_qsv), nv12(progressive), 480x368, q=-1--1, 3163 kb/s, 25 fps, 90k tbn, 25 tbc
Metadata:
encoder : Lavc58.91.100 h264_qsv
Side data:
cpb: bitrate max/min/avg: 3163220/0/3163220 buffer size: 6326440 vbv_delay: N/A
Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 384 kb/s
Metadata:
encoder : Lavc58.91.100 aac
frame= 81 fps=0.0 q=5.0 size=N/A time=00:09:15.04 bitrate=N/A speed=1.11e+03x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b185.ts' for writing
frame= 164 fps=164 q=14.0 size=N/A time=00:09:18.36 bitrate=N/A speed= 557x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b186.ts' for writing
frame= 212 fps=141 q=13.0 size=N/A time=00:09:20.83 bitrate=N/A speed= 373x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b187.ts' for writing
frame= 304 fps=152 q=14.0 size=N/A time=00:09:23.96 bitrate=N/A speed= 281x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b188.ts' for writing
frame= 348 fps=139 q=12.0 size=N/A time=00:09:26.38 bitrate=N/A speed= 226x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b189.ts' for writing
frame= 445 fps=148 q=13.0 size=N/A time=00:09:29.60 bitrate=N/A dup=5 drop=0 speed= 189x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b190.ts' for writing
frame= 522 fps=149 q=13.0 size=N/A time=00:09:32.68 bitrate=N/A dup=5 drop=0 speed= 163x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b191.ts' for writing
frame= 585 fps=146 q=12.0 size=N/A time=00:09:35.33 bitrate=N/A dup=5 drop=0 speed= 143x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b192.ts' for writing
frame= 677 fps=150 q=13.0 size=N/A time=00:09:38.88 bitrate=N/A dup=5 drop=0 speed= 128x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b193.ts' for writing
frame= 749 fps=149 q=13.0 size=N/A time=00:09:41.76 bitrate=N/A dup=5 drop=0 speed= 116x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b194.ts' for writing
frame= 817 fps=148 q=14.0 size=N/A time=00:09:44.48 bitrate=N/A dup=5 drop=0 speed= 106x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b195.ts' for writing
frame= 909 fps=151 q=14.0 size=N/A time=00:09:48.16 bitrate=N/A dup=5 drop=0 speed=97.8x
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b196.ts' for writing
[hls @ 000001fa904773c0] Opening 'C:\ProgramData\Jellyfin\Server\transcodes\21bec549cf94b012ac1f9f7b62f48a4b197.ts' for writing
frame= 909 fps=147 q=18.0 Lsize=N/A time=00:09:48.44 bitrate=N/A dup=5 drop=0 speed=95.1x
video:14293kB audio:1130kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[aac @ 000001fa9051ae00] Qavg: 65281.746

Screenshots

N/A
Additional context

@54601 54601 added the bug Something isn't working label Mar 15, 2021
@icedterminal
Copy link

What you're seeing isn't Jellyfin's fault. It most cases it is the media. Whether it be a poor encode or the format type.

As an example, I experienced a green line issue many years ago. Though not with a RMVB file type. In my case some XVID AVI videos. I had all four encoders to try: AMD AMF, Intel QSV, Nvidia NVENC and CPU. In this case, QSV was the only one to have any problem. I converted one of the videos to H264 MP4 using ffmpeg and replaced the XVID AVI version. No green lines. I came to the conclusion it was the fault QSV and the media type. QSV didn't like it. In these scenarios, you should either use ffmpeg to convert the media to h264/h265 or use a different hardware accelerator. A CPU transcode will generally use a lot a resources. This is normal.

@54601
Copy link
Author

54601 commented Mar 15, 2021

What you're seeing isn't Jellyfin's fault. It most cases it is the media. Whether it be a poor encode or the format type.

As an example, I experienced a green line issue many years ago. Though not with a RMVB file type. In my case some XVID AVI videos. I had all four encoders to try: AMD AMF, Intel QSV, Nvidia NVENC and CPU. In this case, QSV was the only one to have any problem. I converted one of the videos to H264 MP4 using ffmpeg and replaced the XVID AVI version. No green lines. I came to the conclusion it was the fault QSV and the media type. QSV didn't like it. In these scenarios, you should either use ffmpeg to convert the media to h264/h265 or use a different hardware accelerator. A CPU transcode will generally use a lot a resources. This is normal.

Thx a lot! I will try it at home!

@cvium
Copy link
Member

cvium commented Mar 15, 2021

#5534

@stale
Copy link

stale bot commented Jul 14, 2021

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.
If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or nightlies, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.
This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

@stale stale bot added the stale Stale and will be closed if no activity occurs label Jul 14, 2021
@cvium cvium added the confirmed This issue has been reviewed and confirmed label Jul 14, 2021
@stale stale bot removed the stale Stale and will be closed if no activity occurs label Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed This issue has been reviewed and confirmed
Projects
None yet
Development

No branches or pull requests

4 participants