jellyfin / jellyfin

The Free Software Media System
https://jellyfin.org
GNU General Public License v2.0
33.84k stars 3.1k forks source link

Jellyfin continues executing FFmpeg and requesting video data when someone closes the tab inmediately before the video shows #12241

Closed mcrerick closed 2 months ago

mcrerick commented 3 months ago

Please describe your bug

Hi everybody!

Reproduction Steps

  1. Open a live tv transmition
  2. Close the browser or the tab inmediately before the video plays.
  3. Jellyfin keep requesting data of the original server, it could being requeting data and remuxing by days if you dont restart the jellyfin-server. Sin título

Jellyfin Version

10.9.0

if other:

10.9.7 (last stable version)

Environment

- OS: tried at Windows and Linux, same behavior
- Virtualization: no
- Clients: 1
- Browser: tried at firefox, chrome, same behavior
- FFmpeg Version:
- Playback Method: Remuxing, 
- Hardware Acceleration: no
- Plugins: fresh installation
- Reverse Proxy: no

Jellyfin logs

NORMAL PROCEDURE waiting until the video shows and then close the tab.
Jellyfin.LiveTv.LiveTvMediaSourceProvider: Opening channel stream from "Emby", external channel Id: "m3u_f37cfee6d8e08bd04f02369c95c16d9e9ce907a28542f45b27169c6b56fe31b5"
[2024-07-08 11:42:06.760 -05:00] [INF] [9] Jellyfin.LiveTv.DefaultLiveTvService: Streaming Channel "m3u_f37cfee6d8e08bd04f02369c95c16d9e9ce907a28542f45b27169c6b56fe31b5"
[2024-07-08 11:42:06.763 -05:00] [INF] [9] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Opening "SharedHttpStream" Live stream from "http://172.16.0.13/12.ts"
[2024-07-08 11:42:06.828 -05:00] [INF] [16] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Beginning "SharedHttpStream" stream to "C:\ProgramData\Jellyfin\Server\cache\transcodes\1a1441c27ce14497b742c61e1ad72ad6.ts"
[2024-07-08 11:42:06.832 -05:00] [INF] [9] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Live stream opened after 68.6112ms
[2024-07-08 11:42:06.833 -05:00] [INF] [9] Jellyfin.LiveTv.DefaultLiveTvService: Returning mediasource streamId "9ce907a28542f45b27169c6b56fe31b5", mediaSource.Id "9ce907a28542f45b27169c6b56fe31b5", mediaSource.LiveStreamId null
[2024-07-08 11:42:06.843 -05:00] [INF] [18] Emby.Server.Implementations.Library.MediaSourceManager: Live tv media info probe took "0.0069105" seconds
[2024-07-08 11:42:06.851 -05:00] [INF] [18] Emby.Server.Implementations.Library.MediaSourceManager: Live stream opened: MediaSourceInfo { Protocol: Http, Id: "9ce907a28542f45b27169c6b56fe31b5", Path: "http://192.168.90.105:8096/LiveTv/LiveStreamFiles/1a1441c27ce14497b742c61e1ad72ad6/stream.ts", EncoderPath: null, EncoderProtocol: null, Type: Default, Container: "ts", Size: null, Name: null, IsRemote: False, ETag: null, RunTimeTicks: null, ReadAtNativeFramerate: False, IgnoreDts: True, IgnoreIndex: False, GenPtsInput: False, SupportsTranscoding: True, SupportsDirectStream: True, SupportsDirectPlay: True, IsInfiniteStream: True, RequiresOpening: True, OpenToken: null, RequiresClosing: True, LiveStreamId: "e2329f4997b378e64ccf8fa396deb76e_af999c25a00715699361240d4c6c7a53_9ce907a28542f45b27169c6b56fe31b5", BufferMs: null, RequiresLooping: False, SupportsProbing: True, VideoType: null, IsoType: null, Video3DFormat: null, MediaStreams: [MediaStream { Codec: "h264", CodecTag: null, Language: null, ColorRange: "tv", ColorSpace: "bt470bg", ColorTransfer: "bt709", ColorPrimaries: "bt470bg", DvVersionMajor: null, DvVersionMinor: null, DvProfile: null, DvLevel: null, RpuPresentFlag: null, ElPresentFlag: null, BlPresentFlag: null, DvBlSignalCompatibilityId: null, Comment: null, TimeBase: "1/90000", CodecTimeBase: null, Title: null, VideoRange: SDR, VideoRangeType: SDR, VideoDoViTitle: null, AudioSpatialFormat: None, LocalizedUndefined: null, LocalizedDefault: null, LocalizedForced: null, LocalizedExternal: null, LocalizedHearingImpaired: null, DisplayTitle: "720p H264 SDR", NalLengthSize: "0", IsInterlaced: False, IsAVC: null, ChannelLayout: null, BitRate: 8000000, BitDepth: 8, RefFrames: 1, PacketLength: null, Channels: null, SampleRate: null, IsDefault: False, IsForced: False, IsHearingImpaired: False, Height: 720, Width: 1280, AverageFrameRate: 30, RealFrameRate: 29.97003, Profile: "Baseline", Type: Video, AspectRatio: "16:9", Index: -1, Score: null, IsExternal: False, DeliveryMethod: null, DeliveryUrl: null, IsExternalUrl: null, IsTextSubtitleStream: False, SupportsExternalStream: False, Path: null, PixelFormat: "yuv420p", Level: 31, IsAnamorphic: False }, MediaStream { Codec: "aac", CodecTag: null, Language: null, 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/90000", CodecTimeBase: null, Title: null, VideoRange: Unknown, VideoRangeType: Unknown, VideoDoViTitle: null, AudioSpatialFormat: None, LocalizedUndefined: null, LocalizedDefault: null, LocalizedForced: null, LocalizedExternal: null, LocalizedHearingImpaired: null, DisplayTitle: "AAC - Stereo", NalLengthSize: null, IsInterlaced: False, IsAVC: False, ChannelLayout: "stereo", BitRate: 128298, 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: "LC", Type: Audio, 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 }], MediaAttachments: [], Formats: [], Bitrate: 8128298, Timestamp: null, RequiredHttpHeaders: [("User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36")], TranscodingUrl: null, TranscodingSubProtocol: http, TranscodingContainer: null, AnalyzeDurationMs: 3000, TranscodeReasons: 0, DefaultAudioStreamIndex: null, DefaultSubtitleStreamIndex: null, VideoStream: MediaStream { Codec: "h264", CodecTag: null, Language: null, ColorRange: "tv", ColorSpace: "bt470bg", ColorTransfer: "bt709", ColorPrimaries: "bt470bg", DvVersionMajor: null, DvVersionMinor: null, DvProfile: null, DvLevel: null, RpuPresentFlag: null, ElPresentFlag: null, BlPresentFlag: null, DvBlSignalCompatibilityId: null, Comment: null, TimeBase: "1/90000", CodecTimeBase: null, Title: null, VideoRange: SDR, VideoRangeType: SDR, VideoDoViTitle: null, AudioSpatialFormat: None, LocalizedUndefined: null, LocalizedDefault: null, LocalizedForced: null, LocalizedExternal: null, LocalizedHearingImpaired: null, DisplayTitle: "720p H264 SDR", NalLengthSize: "0", IsInterlaced: False, IsAVC: null, ChannelLayout: null, BitRate: 8000000, BitDepth: 8, RefFrames: 1, PacketLength: null, Channels: null, SampleRate: null, IsDefault: False, IsForced: False, IsHearingImpaired: False, Height: 720, Width: 1280, AverageFrameRate: 30, RealFrameRate: 29.97003, Profile: "Baseline", Type: Video, AspectRatio: "16:9", Index: -1, Score: null, IsExternal: False, DeliveryMethod: null, DeliveryUrl: null, IsExternalUrl: null, IsTextSubtitleStream: False, SupportsExternalStream: False, Path: null, PixelFormat: "yuv420p", Level: 31, IsAnamorphic: False } }
[2024-07-08 11:42:06.933 -05:00] [INF] [18] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "admin". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
[2024-07-08 11:42:07.258 -05:00] [INF] [9] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-07-08 11:42:07.265 -05:00] [INF] [9] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "ffmpeg" "-analyzeduration 3000000 -probesize 1G -user_agent \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36\" -fflags +igndts+genpts -f mpegts  -i \"http://192.168.90.105:8096/LiveTv/LiveStreamFiles/1a1441c27ce14497b742c61e1ad72ad6/stream.ts\" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 copy -start_at_zero -flags -global_header -codec:a:0 copy -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_base_url \"hls/be2971357bc00d7b209f2fd5c5ae94a5/\" -hls_segment_filename \"C:\ProgramData\Jellyfin\Server\cache\transcodes\be2971357bc00d7b209f2fd5c5ae94a5%d.ts\" -hls_playlist_type event -hls_list_size 0 -y \"C:\ProgramData\Jellyfin\Server\cache\transcodes\be2971357bc00d7b209f2fd5c5ae94a5.m3u8\""
[2024-07-08 11:42:12.422 -05:00] [INF] [9] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for "C:\ProgramData\Jellyfin\Server\cache\transcodes\be2971357bc00d7b209f2fd5c5ae94a5.m3u8"
[2024-07-08 11:42:12.532 -05:00] [INF] [9] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[2024-07-08 11:42:12.534 -05:00] [INF] [9] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: Deleting partial stream file(s) "C:\ProgramData\Jellyfin\Server\cache\transcodes\be2971357bc00d7b209f2fd5c5ae94a5.m3u8"
[2024-07-08 11:42:14.050 -05:00] [INF] [8] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Jellyfin Web" "10.9.7" playing "America TV". Stopped at "2270" ms
[2024-07-08 11:42:14.053 -05:00] [INF] [8] Emby.Server.Implementations.Library.MediaSourceManager: Live stream "9ce907a28542f45b27169c6b56fe31b5" consumer count is now 0
[2024-07-08 11:42:14.055 -05:00] [INF] [8] Emby.Server.Implementations.Library.MediaSourceManager: Closing live stream "e2329f4997b378e64ccf8fa396deb76e_af999c25a00715699361240d4c6c7a53_9ce907a28542f45b27169c6b56fe31b5"
[2024-07-08 11:42:14.056 -05:00] [INF] [8] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Closing "SharedHttpStream"
[2024-07-08 11:42:14.058 -05:00] [INF] [9] Emby.Server.Implementations.Library.MediaSourceManager: Live stream "e2329f4997b378e64ccf8fa396deb76e_af999c25a00715699361240d4c6c7a53_9ce907a28542f45b27169c6b56fe31b5" closed successfully
[2024-07-08 11:42:14.058 -05:00] [INF] [14] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Copying of "SharedHttpStream" to "C:\ProgramData\Jellyfin\Server\cache\transcodes\1a1441c27ce14497b742c61e1ad72ad6.ts" was canceled
[2024-07-08 11:42:14.062 -05:00] [INF] [14] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Deleting temp file "C:\ProgramData\Jellyfin\Server\cache\transcodes\1a1441c27ce14497b742c61e1ad72ad6.ts"

WHEN YOU CLOSES TAB INMEDIATELY BEFORE VIDEO PLAYS.
[2024-07-08 11:43:48.747 -05:00] [INF] [22] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Opening "SharedHttpStream" Live stream from "http://172.16.0.13/12.ts"
[2024-07-08 11:43:48.806 -05:00] [INF] [23] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Beginning "SharedHttpStream" stream to "C:\ProgramData\Jellyfin\Server\cache\transcodes\d7c6a9ee5373463088b687f2349f7135.ts"
[2024-07-08 11:43:48.813 -05:00] [INF] [22] Jellyfin.LiveTv.TunerHosts.M3UTunerHost: Live stream opened after 66.5971ms
[2024-07-08 11:43:48.814 -05:00] [INF] [22] Jellyfin.LiveTv.DefaultLiveTvService: Returning mediasource streamId "9ce907a28542f45b27169c6b56fe31b5", mediaSource.Id "9ce907a28542f45b27169c6b56fe31b5", mediaSource.LiveStreamId null
[2024-07-08 11:43:48.816 -05:00] [INF] [20] Emby.Server.Implementations.Library.MediaSourceManager: Live tv media info probe took "0.0002821" seconds
[2024-07-08 11:43:48.818 -05:00] [INF] [20] Emby.Server.Implementations.Library.MediaSourceManager: Live stream opened: MediaSourceInfo { Protocol: Http, Id: "9ce907a28542f45b27169c6b56fe31b5", Path: "http://192.168.90.105:8096/LiveTv/LiveStreamFiles/d7c6a9ee5373463088b687f2349f7135/stream.ts", EncoderPath: null, EncoderProtocol: null, Type: Default, Container: "ts", Size: null, Name: null, IsRemote: False, ETag: null, RunTimeTicks: null, ReadAtNativeFramerate: False, IgnoreDts: True, IgnoreIndex: False, GenPtsInput: False, SupportsTranscoding: True, SupportsDirectStream: True, SupportsDirectPlay: True, IsInfiniteStream: True, RequiresOpening: True, OpenToken: null, RequiresClosing: True, LiveStreamId: "e2329f4997b378e64ccf8fa396deb76e_af999c25a00715699361240d4c6c7a53_9ce907a28542f45b27169c6b56fe31b5", BufferMs: null, RequiresLooping: False, SupportsProbing: True, VideoType: null, IsoType: null, Video3DFormat: null, MediaStreams: [MediaStream { Codec: "h264", CodecTag: null, Language: null, ColorRange: "tv", ColorSpace: "bt470bg", ColorTransfer: "bt709", ColorPrimaries: "bt470bg", DvVersionMajor: null, DvVersionMinor: null, DvProfile: null, DvLevel: null, RpuPresentFlag: null, ElPresentFlag: null, BlPresentFlag: null, DvBlSignalCompatibilityId: null, Comment: null, TimeBase: "1/90000", CodecTimeBase: null, Title: null, VideoRange: SDR, VideoRangeType: SDR, VideoDoViTitle: null, AudioSpatialFormat: None, LocalizedUndefined: null, LocalizedDefault: null, LocalizedForced: null, LocalizedExternal: null, LocalizedHearingImpaired: null, DisplayTitle: "720p H264 SDR", NalLengthSize: "0", IsInterlaced: False, IsAVC: null, ChannelLayout: null, BitRate: 8000000, BitDepth: 8, RefFrames: 1, PacketLength: null, Channels: null, SampleRate: null, IsDefault: False, IsForced: False, IsHearingImpaired: False, Height: 720, Width: 1280, AverageFrameRate: 30, RealFrameRate: 29.97003, Profile: "Baseline", Type: Video, AspectRatio: "16:9", Index: -1, Score: null, IsExternal: False, DeliveryMethod: null, DeliveryUrl: null, IsExternalUrl: null, IsTextSubtitleStream: False, SupportsExternalStream: False, Path: null, PixelFormat: "yuv420p", Level: 31, IsAnamorphic: False }, MediaStream { Codec: "aac", CodecTag: null, Language: null, 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/90000", CodecTimeBase: null, Title: null, VideoRange: Unknown, VideoRangeType: Unknown, VideoDoViTitle: null, AudioSpatialFormat: None, LocalizedUndefined: null, LocalizedDefault: null, LocalizedForced: null, LocalizedExternal: null, LocalizedHearingImpaired: null, DisplayTitle: "AAC - Stereo", NalLengthSize: null, IsInterlaced: False, IsAVC: False, ChannelLayout: "stereo", BitRate: 128298, 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: "LC", Type: Audio, 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 }], MediaAttachments: [], Formats: [], Bitrate: 8128298, Timestamp: null, RequiredHttpHeaders: [("User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36")], TranscodingUrl: null, TranscodingSubProtocol: http, TranscodingContainer: null, AnalyzeDurationMs: 3000, TranscodeReasons: 0, DefaultAudioStreamIndex: null, DefaultSubtitleStreamIndex: null, VideoStream: MediaStream { Codec: "h264", CodecTag: null, Language: null, ColorRange: "tv", ColorSpace: "bt470bg", ColorTransfer: "bt709", ColorPrimaries: "bt470bg", DvVersionMajor: null, DvVersionMinor: null, DvProfile: null, DvLevel: null, RpuPresentFlag: null, ElPresentFlag: null, BlPresentFlag: null, DvBlSignalCompatibilityId: null, Comment: null, TimeBase: "1/90000", CodecTimeBase: null, Title: null, VideoRange: SDR, VideoRangeType: SDR, VideoDoViTitle: null, AudioSpatialFormat: None, LocalizedUndefined: null, LocalizedDefault: null, LocalizedForced: null, LocalizedExternal: null, LocalizedHearingImpaired: null, DisplayTitle: "720p H264 SDR", NalLengthSize: "0", IsInterlaced: False, IsAVC: null, ChannelLayout: null, BitRate: 8000000, BitDepth: 8, RefFrames: 1, PacketLength: null, Channels: null, SampleRate: null, IsDefault: False, IsForced: False, IsHearingImpaired: False, Height: 720, Width: 1280, AverageFrameRate: 30, RealFrameRate: 29.97003, Profile: "Baseline", Type: Video, AspectRatio: "16:9", Index: -1, Score: null, IsExternal: False, DeliveryMethod: null, DeliveryUrl: null, IsExternalUrl: null, IsTextSubtitleStream: False, SupportsExternalStream: False, Path: null, PixelFormat: "yuv420p", Level: 31, IsAnamorphic: False } }
[2024-07-08 11:43:48.898 -05:00] [INF] [20] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "admin". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
[2024-07-08 11:43:49.110 -05:00] [INF] [22] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "127.0.0.1" closed

AND NO MORE. NO "consumer count is now 0" NO Closing live stream NO Closing "SharedHttpStream" NO "Copying of "SharedHttpStream" to "C:\ProgramData\Jellyfin\Server\cache\transcodes\1a1441c27ce14497b742c61e1ad72ad6.ts" was canceled" NO Deleting temp file.

FFmpeg logs

No response

Please attach any browser or client logs here

all normal

Please attach any screenshots here

No response

Code of Conduct

jellyfin-bot commented 3 months ago

Hi, it seems like your issue report has the following item(s) that need to be addressed:

This is an automated message, currently under testing. Please file an issue here if you encounter any problems.

mcrerick commented 3 months ago

UPDATE: I realized that this issue also occurs with the LG TV app. If you open a live transmission and immediately power off the TV, Jellyfin continues to requesting video data from the source.

admfptv commented 2 months ago

SI! lo acabo de probar y si pasa eso. que pena, un niño podria crashear el servidor

cvium commented 2 months ago

Please stop adding useless noise to the issue title. Thanks.

soytupadre2 commented 2 months ago

I attempted to replicate this on my server, and it crashed unexpectedly due to extremely high network traffic. I'll test to see if the same issue occurs when streaming video files instead. LOL what a issue!

tokiohotel2 commented 2 months ago

Yes, it's true. It happens currently. I just did it. I also tried it in Emby, but it doesn't happen there. It seems to have been patched a long time ago.

felix920506 commented 2 months ago

Duplicate #10982