jellyfin / jellyfin

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

[Issue]: Request to /Videos gives 200 OK but empty response on IPTV playback attempt #10168

Closed jhays closed 10 months ago

jhays commented 1 year ago

Please describe your bug

I am working on the LiveTV implementation in the Swiftfin client. I am running into some issues with playback from my IPTV source. In my configuration, I have some local HLS channels created by ErsatzTV, and some remote IPTV channels from a service I am subscribed to. They are combined with Steve and exposed to jellyfin via m3u.

I've found a scenario where playback attempts in Swiftfin with the VLCKit based player and the Force Direct Play flag turned ON results in failure to play any video when I select one of my IPTV channels. ErsatzTV channels seem to work just fine, though.

When I dug into it, I found that when the Swiftfin client sends a request to /Video/{id}/stream..., in the ErsatzTV case where it works, I get a response with a content type of application/x-mpegurl, and the body looks like the start of an HLS stream.

But in the case where playback fails, with my IPTV channels, the request to /Video/{id}/stream...results in a 200 OK, yet the content type says text/html; charset=utf-8, but the body is totally empty. Content-Length is 0.

It seems like something went wrong, and playback can't start for that channel. Yet the response said 200 OK.

This same IPTV channel plays fine in the Jellyfin browser interface. Or I can take the direct URL and open it with VLC.

Jellyfin Version

10.8.z

if other:

No response

Environment

- OS: Ubuntu running jellyfin server, 
- Linux Kernel:
- Virtualization:
- Clients: Swiftfin, tvOS
- Browser:
- FFmpeg Version:
- Playback Method: direct
- Hardware Acceleration: none
- GPU Model:
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage:

Jellyfin logs

Logs from the successful playback of an ErsatzTV channel:
[2023-08-29 18:00:18.691 -05:00] [INF] User policy for "admin". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2023-08-29 18:00:18.691 -05:00] [INF] StreamBuilder.BuildVideoItem( Profile="Anonymous Profile", Path="http://x.x.x.x:34400/stream/3bfede0c0d211dea7d0666234e827215", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=ContainerNotSupported, VideoCodecNotSupported, AudioCodecNotSupported ) "media:/videos/c7b6670c-2534-39dc-bee4-d446962841b9/master.m3u8?MediaSourceId=dc6c556b35da5960abe5178220d40328&VideoCodec=hevc,h264&AudioCodec=aac,mp3,ac3,eac3,flac,opus&AudioStreamIndex=-1&VideoBitrate=359360000&AudioBitrate=640000&api_key=<token>&TranscodingMaxAudioChannels=6&RequireAvc=false&SegmentContainer=mp4&MinSegments=2&BreakOnNonKeyFrames=True&TranscodeReasons=ContainerNotSupported,%20VideoCodecNotSupported,%20AudioCodecNotSupported"
[2023-08-29 18:00:22.970 -05:00] [INF] Defined LAN addresses : "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:00:22.970 -05:00] [INF] Defined LAN exclusions : "[]"
[2023-08-29 18:00:22.970 -05:00] [INF] Using LAN addresses: "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:00:25.123 -05:00] [INF] Defined LAN addresses : "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:00:25.123 -05:00] [INF] Defined LAN exclusions : "[]"
[2023-08-29 18:00:25.123 -05:00] [INF] Using LAN addresses: "[10.0.0.0/8,172.16.0.0/12,x.x..0.0/16]"
[2023-08-29 18:00:55.322 -05:00] [WRN] Slow HTTP Response from "http://x.x.x.x:8096/Videos/c7b6670c253439dcbee4d446962841b9/stream?static=true&playSessionId=5de332dbea454e11adc56a5889d57ef2&mediaSourceId=dc6c556b35da5960abe5178220d40328" to "x.x..1.43" in 0:00:04.4322555 with Status Code 200
[2023-08-29 18:00:57.916 -05:00] [INF] Defined LAN addresses : "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:00:57.916 -05:00] [INF] Defined LAN exclusions : "[]"
[2023-08-29 18:00:57.916 -05:00] [INF] Using LAN addresses: "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:01:50.754 -05:00] [INF] Defined LAN addresses : "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:01:50.754 -05:00] [INF] Defined LAN exclusions : "[]"
[2023-08-29 18:01:50.754 -05:00] [INF] Using LAN addresses: "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:01:50.878 -05:00] [INF] WS "x.x.1.43" closed
[2023-08-29 18:01:51.219 -05:00] [INF] WS "x.x.1.43" request

Logs for the failure playback an IPTV channel: 

[2023-08-29 18:03:01.546 -05:00] [INF] User policy for "admin". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2023-08-29 18:03:01.546 -05:00] [INF] StreamBuilder.BuildVideoItem( Profile="Anonymous Profile", Path="http://x.x.x.x:34400/stream/42cd40eaf990b3c5ec354033b4f0d6d0", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=ContainerNotSupported, VideoCodecNotSupported, AudioCodecNotSupported ) "media:/videos/436ad0a3-da14-f50d-5899-4b35566e0e87/master.m3u8?MediaSourceId=c2354f8648d85b88e2679d19d3097e80&VideoCodec=hevc,h264&AudioCodec=aac,mp3,ac3,eac3,flac,opus&AudioStreamIndex=-1&VideoBitrate=359360000&AudioBitrate=640000&api_key=<token>&TranscodingMaxAudioChannels=6&RequireAvc=false&SegmentContainer=mp4&MinSegments=2&BreakOnNonKeyFrames=True&TranscodeReasons=ContainerNotSupported,%20VideoCodecNotSupported,%20AudioCodecNotSupported"
[2023-08-29 18:03:23.713 -05:00] [INF] Defined LAN addresses : "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:03:23.713 -05:00] [INF] Defined LAN exclusions : "[]"
[2023-08-29 18:03:23.713 -05:00] [INF] Using LAN addresses: "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:03:25.865 -05:00] [INF] Defined LAN addresses : "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:03:25.865 -05:00] [INF] Defined LAN exclusions : "[]"
[2023-08-29 18:03:25.865 -05:00] [INF] Using LAN addresses: "[10.0.0.0/8,172.16.0.0/12,x.x.0.0/16]"
[2023-08-29 18:03:38.419 -05:00] [INF] WS "x.x.1.43" closed
[2023-08-29 18:03:38.687 -05:00] [INF] WS "x.x.1.43" request

FFmpeg logs

No response

Please attach any browser or client logs here

the request / response to /Videos/{id}/stream

In the working case, with an ErsatzTV channel: http://x.x.x.x:8096/Videos/c7b6670c253439dcbee4d446962841b9/stream?static=true&playSessionId=8cc936cdd2a34935bf444a546d481096&mediaSourceId=dc6c556b35da5960abe5178220d40328

HTTP/1.1 200 OK Content-Length: 123 Content-Type: application/x-mpegurl Date: Tue, 29 Aug 2023 23:00:55 GMT Server: Kestrel Accept-Ranges: none X-Response-Time-ms: 4432

Response:

EXTM3U

EXT-X-VERSION:3

EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=10000000

http://x.x.x.x:8409/iptv/session/1/hls.m3u8

And in the failure / error case, an IPTV channel. The response is 200 OK, but empty, and the client can't start playback: http://x.x.x.x:8096/Videos/436ad0a3da14f50d58994b35566e0e87/stream?static=true&playSessionId=3315fd6e8ac14a6c994ea9446bb19eb6&mediaSourceId=c2354f8648d85b88e2679d19d3097e80

HTTP/1.1 200 OK Content-Length: 0 Content-Type: text/html; charset=utf-8 Date: Tue, 29 Aug 2023 23:03:01 GMT Server: Kestrel Accept-Ranges: none X-Response-Time-ms: 393

Response:

Please attach any screenshots here

No response

Code of Conduct

jellyfin-bot commented 11 months ago

This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.

If you have any questions you can use one of several ways to contact us.

jellyfin-bot commented 10 months ago

This issue was closed due to inactivity.