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

DirectPlay Doesnt work. Transcoding does #93

Open
Renderer6060 opened this issue Mar 27, 2024 · 7 comments
Open

DirectPlay Doesnt work. Transcoding does #93

Renderer6060 opened this issue Mar 27, 2024 · 7 comments

Comments

@Renderer6060
Copy link

Renderer6060 commented Mar 27, 2024

I have a really weird issue.

Got this set up and working in browser and using the native web player in the jellyfin app. In the admin dashboard I can see these streams are transcoding. They playback and work without much juddering.

However, anything that can direct play

Jellyfin Windows App
Jellyfin for WebOS
Jellyfin Android app when set to the integrated player (ExoPlayer)

When i try and start these streams they endlessly buffer before giving a stream error and exiting.

WebOS also won't load the guide that works fine in the browser

Error log

03-27 15:16:53.005 +00:00] [INF] User policy for "user". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2024-03-27 15:16:53.005 +00:00] [INF] StreamBuilder.BuildVideoItem( Profile="Jellyfin Android", Path="http://172.20.13.1:8096/LiveTv/LiveStreamFiles/773058b9-e49a-41d3-bbfb-cfb3c9dee58b/stream.ts", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectPlay, TranscodeReason=0 ) "media:/videos/ac7a3264-aa87-7938-8137-f8d85c745f86/stream.mpegts?MediaSourceId=577&Static=true&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=-1&api_key=<token>&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_577"
[2024-03-27 15:16:53.139 +00:00] [INF] Adding playback tracker : c4e9f2968a96a872d16efb59fe524f5c9e62b440df738501-d16efb59fe524f5c9e62b440df738501-ac7a3264aa8779388137f8d85c745f86
[2024-03-27 15:16:53.139 +00:00] [INF] PlaybackTracker : Adding Start Event : 03/27/2024 15:16:53
[2024-03-27 15:16:53.140 +00:00] [INF] Creating StartPlaybackTimer Task
[2024-03-27 15:16:53.140 +00:00] [INF] StartPlaybackTimer : Entered
[2024-03-27 15:16:54.973 +00:00] [INF] StartPlaybackTimer : session Not Found
[2024-03-27 15:16:54.973 +00:00] [INF] StartPlaybackTimer : Exited
[2024-03-27 15:17:07.852 +00:00] [INF] WS "10.15.20.115" closed
[2024-03-27 15:17:10.040 +00:00] [WRN] Slow HTTP Response from "http://jellyfin.server.com/videos/ac7a3264-aa87-7938-8137-f8d85c745f86/stream.mpegts?DeviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjkuMSAod2luZG93cy14ODZfNjQgMTApfDE3MTE1NTI1MzQ5NTU1&MediaSourceId=577&Static=true&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=-1&PlaySessionId=4fc898e9d518481b829e49e1445bbe66&api_key=e5a914d9b5284bda98d7c22e47379949&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_577&allowVideoStreamCopy=false&allowAudioStreamCopy=false" to "10.15.25.34" in 0:01:19.2179617 with Status Code 200
[2024-03-27 15:17:10.238 +00:00] [INF] WS "10.15.20.115" request
[2024-03-27 15:17:13.142 +00:00] [INF] session.RemoteEndPoint : "10.15.25.35"
[2024-03-27 15:17:13.142 +00:00] [INF] StartPlaybackTimer : event_playing_id     = "ac7a3264aa8779388137f8d85c745f86"
[2024-03-27 15:17:13.142 +00:00] [INF] StartPlaybackTimer : event_user_id        = "d16efb59fe524f5c9e62b440df738501"
[2024-03-27 15:17:13.142 +00:00] [INF] StartPlaybackTimer : event_user_id_int    = 4
[2024-03-27 15:17:13.142 +00:00] [INF] StartPlaybackTimer : session_playing_id   = "ac7a3264aa8779388137f8d85c745f86"
[2024-03-27 15:17:13.143 +00:00] [INF] StartPlaybackTimer : session_user_id      = "d16efb59fe524f5c9e62b440df738501"
[2024-03-27 15:17:13.143 +00:00] [INF] StartPlaybackTimer : play_method          = "DirectPlay"
[2024-03-27 15:17:13.143 +00:00] [INF] StartPlaybackTimer : e.ClientName         = "Jellyfin Android"
[2024-03-27 15:17:13.143 +00:00] [INF] StartPlaybackTimer : e.DeviceName         = "device"
[2024-03-27 15:17:13.143 +00:00] [INF] StartPlaybackTimer : ItemName             = "Sky Sports Main Event HD"
[2024-03-27 15:17:13.144 +00:00] [INF] StartPlaybackTimer : ItemId               = "ac7a3264aa8779388137f8d85c745f86"
[2024-03-27 15:17:13.144 +00:00] [INF] StartPlaybackTimer : ItemType             = "TvChannel"
[2024-03-27 15:17:13.144 +00:00] [INF] StartPlaybackTimer : All matches, playback registered
[2024-03-27 15:17:13.144 +00:00] [INF] Playback tracker found, adding playback info : "c4e9f2968a96a872d16efb59fe524f5c9e62b440df738501-d16efb59fe524f5c9e62b440df738501-ac7a3264aa8779388137f8d85c745f86"
[2024-03-27 15:17:13.144 +00:00] [INF] Saving playback tracking activity in DB
[2024-03-27 15:17:13.147 +00:00] [INF] StartPlaybackTimer : Exited
@Renderer6060 Renderer6060 changed the title DirsctPlay Doesnt work. Transcoding does DirectPlay Doesnt work. Transcoding does Mar 27, 2024
@Kevinjil
Copy link
Owner

In the logs, the stream path starts with http://172.20.13.1:8096:

[2024-03-27 15:16:53.005 +00:00] [INF] StreamBuilder.BuildVideoItem( Profile="Jellyfin Android", Path="http://172.20.13.1:8096/LiveTv/LiveStreamFiles/773058b9-e49a-41d3-bbfb-cfb3c9dee58b/stream.ts", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectPlay, TranscodeReason=0 ) "media:/videos/ac7a3264-aa87-7938-8137-f8d85c745f86/stream.mpegts?MediaSourceId=577&Static=true&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=-1&api_key=<token>&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_577"

Some HTTP traffic seems to target http://jellyfin.server.com:

[2024-03-27 15:17:10.040 +00:00] [WRN] Slow HTTP Response from "http://jellyfin.server.com/videos/ac7a3264-aa87-7938-8137-f8d85c745f86/stream.mpegts?DeviceId=SmVsbHlmaW5NZWRpYVBsYXllciAxLjkuMSAod2luZG93cy14ODZfNjQgMTApfDE3MTE1NTI1MzQ5NTU1&MediaSourceId=577&Static=true&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=-1&PlaySessionId=4fc898e9d518481b829e49e1445bbe66&api_key=e5a914d9b5284bda98d7c22e47379949&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_577&allowVideoStreamCopy=false&allowAudioStreamCopy=false" to "10.15.25.34" in 0:01:19.2179617 with Status Code 200

Is this address and port reachable from the client? If not, configure your Jellyfin networking correctly in the Admin Dashboard under Advanced > Networking > Firewall and Proxy Settings > Published Server URIs.
For example:

all=http://jellyfin.server.com

@Renderer6060
Copy link
Author

Renderer6060 commented Mar 28, 2024 via email

@Kevinjil
Copy link
Owner

Configure it with all=https://.... if your reverse proxy uses SSL.

@Renderer6060
Copy link
Author

Renderer6060 commented Mar 28, 2024

changed that - error now shows same but with the https:// path

[2024-03-28 21:25:07.449 +00:00] [INF] User policy for "user". EnablePlaybackRemuxing: False EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2024-03-28 21:25:07.449 +00:00] [INF] RemoteClientBitrateLimit: 3000000, RemoteIp: "172.20.15.2", IsInLocalNetwork: False
[2024-03-28 21:25:07.451 +00:00] [INF] StreamBuilder.BuildVideoItem( Profile="Jellyfin Android", Path="https://jellyfin.server.com/LiveTv/LiveStreamFiles/8dd6e88f-e477-42c9-9cfb-450d16a1bde8/stream.ts", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=DirectPlay, TranscodeReason=0 ) "media:/videos/ac7a3264-aa87-7938-8137-f8d85c745f86/stream.mpegts?MediaSourceId=577&Static=true&VideoCodec=h264&AudioCodec=aac&AudioStreamIndex=-1&api_key=<token>&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_577"
[2024-03-28 21:25:08.271 +00:00] [INF] Adding playback tracker : c4e9f2968a96a872d16efb59fe524f5c9e62b440df738501-d16efb59fe524f5c9e62b440df738501-ac7a3264aa8779388137f8d85c745f86
[2024-03-28 21:25:08.272 +00:00] [INF] PlaybackTracker : Adding Start Event : 03/28/2024 21:25:08
[2024-03-28 21:25:08.272 +00:00] [INF] Creating StartPlaybackTimer Task
[2024-03-28 21:25:08.272 +00:00] [INF] StartPlaybackTimer : Entered
[2024-03-28 21:25:08.499 +00:00] [INF] Restream for channel "577" was not opened.
[2024-03-28 21:25:08.500 +00:00] [INF] Starting restream for channel "577".
[2024-03-28 21:25:08.501 +00:00] [INF] Opening restream 1 for channel "577".
[2024-03-28 21:25:09.653 +00:00] [WRN] Slow HTTP Response from "http://jellyfin.server.com/LiveTv/LiveStreamFiles/8dd6e88f-e477-42c9-9cfb-450d16a1bde8/stream.ts" to "172.20.15.2" in 0:00:01.153753 with Status Code 200
[2024-03-28 21:25:28.276 +00:00] [INF] session.RemoteEndPoint : "172.20.15.2"
[2024-03-28 21:25:28.276 +00:00] [INF] StartPlaybackTimer : event_playing_id     = "ac7a3264aa8779388137f8d85c745f86"
[2024-03-28 21:25:28.277 +00:00] [INF] StartPlaybackTimer : event_user_id        = "d16efb59fe524f5c9e62b440df738501"
[2024-03-28 21:25:28.277 +00:00] [INF] StartPlaybackTimer : event_user_id_int    = 4
[2024-03-28 21:25:28.278 +00:00] [INF] StartPlaybackTimer : session_playing_id   = "ac7a3264aa8779388137f8d85c745f86"
[2024-03-28 21:25:28.278 +00:00] [INF] StartPlaybackTimer : session_user_id      = "d16efb59fe524f5c9e62b440df738501"
[2024-03-28 21:25:28.278 +00:00] [INF] StartPlaybackTimer : play_method          = "DirectPlay"
[2024-03-28 21:25:28.279 +00:00] [INF] StartPlaybackTimer : e.ClientName         = "Jellyfin Android"
[2024-03-28 21:25:28.279 +00:00] [INF] StartPlaybackTimer : e.DeviceName         = "DEVICE"
[2024-03-28 21:25:28.279 +00:00] [INF] StartPlaybackTimer : ItemName             = "Sky Sports Main Event HD"
[2024-03-28 21:25:28.280 +00:00] [INF] StartPlaybackTimer : ItemId               = "ac7a3264aa8779388137f8d85c745f86"
[2024-03-28 21:25:28.280 +00:00] [INF] StartPlaybackTimer : ItemType             = "TvChannel"
[2024-03-28 21:25:28.281 +00:00] [INF] StartPlaybackTimer : All matches, playback registered
[2024-03-28 21:25:28.281 +00:00] [INF] Playback tracker found, adding playback info : "c4e9f2968a96a872d16efb59fe524f5c9e62b440df738501-d16efb59fe524f5c9e62b440df738501-ac7a3264aa8779388137f8d85c745f86"
[2024-03-28 21:25:28.281 +00:00] [INF] Saving playback tracking activity in DB
[2024-03-28 21:25:28.284 +00:00] [INF] StartPlaybackTimer : Exited

not sure if it helps, but direct play for normal media files hosted on my fileserver has always worked

Also, if it was networking, wouldnt the same issue happen when transcoding files?

UPDATE:

Changing the advanced networking broke transcoded streams as well

Update 2

I disabled the all=https://jellyfin.server.com in order to get transcoded playback to work again.

Thought i would add the logs from a stream that works - the only difference is its being transcoded now as im using the browser on the same device that wont work above

[2024-03-28 22:15:36.985 +00:00] [INF] User policy for "User". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2024-03-28 22:15:36.985 +00:00] [INF] RemoteClientBitrateLimit: 3000000, RemoteIp: "IP", IsInLocalNetwork: False
[2024-03-28 22:15:36.985 +00:00] [INF] StreamBuilder.BuildVideoItem( Profile="Anonymous Profile", Path="http://172.20.13.1:8096/LiveTv/LiveStreamFiles/4ea947cc-a48f-416a-80b4-150998be36c1/stream.ts", AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=ContainerNotSupported ) "media:/videos/89aa8535-4065-d522-b29d-f9c893cb1ede/master.m3u8?MediaSourceId=141&VideoCodec=h264,h264&AudioCodec=aac&AudioStreamIndex=-1&VideoBitrate=139807969&AudioBitrate=192031&AudioSampleRate=48000&MaxFramerate=25&api_key=<token>&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_141&TranscodingMaxAudioChannels=6&RequireAvc=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-level=51&h264-videobitdepth=8&h264-profile=high&h264-audiochannels=2&aac-profile=lc&h264-rangetype=SDR&h264-deinterlace=true&TranscodeReasons=ContainerNotSupported"
[2024-03-28 22:15:37.482 +00:00] [INF] Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-03-28 22:15:37.483 +00:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 3000000 -fflags +genpts  -i \"http://10.20.20.100:8096/LiveTv/LiveStreamFiles/4ea947cc-a48f-416a-80b4-150998be36c1/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/fe9d652d3546608b76e90025ef556801/\" -hls_segment_filename \"/var/lib/jellyfin/transcodes/fe9d652d3546608b76e90025ef556801%d.ts\" -hls_playlist_type event -hls_list_size 0 -y \"/var/lib/jellyfin/transcodes/fe9d652d3546608b76e90025ef556801.m3u8\""
[2024-03-28 22:15:37.527 +00:00] [INF] Restream for channel "141" was not opened.
[2024-03-28 22:15:37.527 +00:00] [INF] Starting restream for channel "141".
[2024-03-28 22:15:37.527 +00:00] [INF] Opening restream 1 for channel "141".
[2024-03-28 22:15:38.525 +00:00] [WRN] Slow HTTP Response from "https://jellyfin.server.com/videos/89aa8535-4065-d522-b29d-f9c893cb1ede/live.m3u8?DeviceId=TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMjQuMHwxNzExNjYwOTY1NTAx&MediaSourceId=141&VideoCodec=h264,h264&AudioCodec=aac&AudioStreamIndex=-1&VideoBitrate=139807969&AudioBitrate=192031&AudioSampleRate=48000&MaxFramerate=25&PlaySessionId=4d953667534f4a7bb94508c934d3b028&api_key=5ebde63f76ab46f093c97f6c401c01d3&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_141&TranscodingMaxAudioChannels=6&RequireAvc=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-level=51&h264-videobitdepth=8&h264-profile=high&h264-audiochannels=2&aac-profile=lc&h264-rangetype=SDR&h264-deinterlace=true&TranscodeReasons=ContainerNotSupported" to "streaming.device.ip" in 0:00:01.0444167 with Status Code 200
[2024-03-28 22:15:39.046 +00:00] [INF] Adding playback tracker : TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMjQuMHwxNzExNjYwOTY1NTAx-10c9401928764310aff54885836676bd-89aa85354065d522b29df9c893cb1ede
[2024-03-28 22:15:39.046 +00:00] [INF] PlaybackTracker : Adding Start Event : 03/28/2024 22:15:39
[2024-03-28 22:15:39.046 +00:00] [INF] Creating StartPlaybackTimer Task
[2024-03-28 22:15:39.046 +00:00] [INF] StartPlaybackTimer : Entered
[2024-03-28 22:15:39.543 +00:00] [INF] Processing playback tracker : "TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMjQuMHwxNzExNjYwOTY1NTAx-10c9401928764310aff54885836676bd-89aa85354065d522b29df9c893cb1ede"
[2024-03-28 22:15:51.144 +00:00] [WRN] Slow HTTP Response from "http://server.ip:8096/LiveTv/LiveStreamFiles/060e5fd7-fd53-4682-886d-d9398509f3c4/stream.ts" to "streaming device ip" in 0:00:30.0282788 with Status Code 200
[2024-03-28 22:15:51.148 +00:00] [ERR] FFmpeg exited with code 1
[2024-03-28 22:15:51.225 +00:00] [INF] Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-03-28 22:15:51.227 +00:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 3000000 -init_hw_device vaapi=va:/dev/dri/renderD128,driver=i965 -filter_hw_device va -autorotate 0 -i \"http://streamingdevice.ip.address:8096/LiveTv/LiveStreamFiles/060e5fd7-fd53-4682-886d-d9398509f3c4/stream.ts\" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 h264_vaapi -rc_mode CBR -b:v 5000000 -maxrate 5000000 -bufsize 10000000 -force_key_frames:0 \"expr:gte(t,n_forced*3)\" -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,yadif=0:-1:0,scale=trunc(min(max(iw\,ih*a)\,min(720\,576*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(720/a\,576))/2)*2,format=nv12,hwupload_vaapi\" -flags -global_header -codec:a:0 libfdk_aac -ac 2 -ab 256000 -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/96f90000a7d3e02a7413e3c985d0ef8b/\" -hls_segment_filename \"/var/lib/jellyfin/transcodes/96f90000a7d3e02a7413e3c985d0ef8b%d.ts\" -hls_playlist_type event -hls_list_size 0 -y \"/var/lib/jellyfin/transcodes/96f90000a7d3e02a7413e3c985d0ef8b.m3u8\""
[2024-03-28 22:15:51.227 +00:00] [ERR] Error processing request. URL "GET" "/videos/ba3f8a4f-be4a-0195-f2ea-467231747b91/live.m3u8".
MediaBrowser.Common.FfmpegException: FFmpeg exited with code 1
at Jellyfin.Api.Helpers.TranscodingJobHelper.StartFfMpeg(StreamState state, String outputPath, String commandLineArguments, HttpRequest request, TranscodingJobType transcodingJobType, CancellationTokenSource cancellationTokenSource, String workingDirectory)
   at Jellyfin.Api.Controllers.DynamicHlsController.GetLiveHlsStream(Guid itemId, String container, Nullable`1 static, String params, String tag, String deviceProfileId, String playSessionId, String segmentContainer, Nullable`1 segmentLength, Nullable`1 minSegments, String mediaSourceId, String deviceId, String audioCodec, Nullable`1 enableAutoStreamCopy, Nullable`1 allowVideoStreamCopy, Nullable`1 allowAudioStreamCopy, Nullable`1 breakOnNonKeyFrames, Nullable`1 audioSampleRate, Nullable`1 maxAudioBitDepth, Nullable`1 audioBitRate, Nullable`1 audioChannels, Nullable`1 maxAudioChannels, String profile, String level, Nullable`1 framerate, Nullable`1 maxFramerate, Nullable`1 copyTimestamps, Nullable`1 startTimeTicks, Nullable`1 width, Nullable`1 height, Nullable`1 videoBitRate, Nullable`1 subtitleStreamIndex, Nullable`1 subtitleMethod, Nullable`1 maxRefFrames, Nullable`1 maxVideoBitDepth, Nullable`1 requireAvc, Nullable`1 deInterlace, Nullable`1 requireNonAnamorphic, Nullable`1 transcodingMaxAudioChannels, Nullable`1 cpuCoreLimit, String liveStreamId, Nullable`1 enableMpegtsM2TsMode, String videoCodec, String subtitleCodec, String transcodeReasons, Nullable`1 audioStreamIndex, Nullable`1 videoStreamIndex, Nullable`1 context, Dictionary`2 streamOptions, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 enableSubtitlesInManifest)
   at lambda_method1235(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
[2024-03-28 22:15:51.234 +00:00] [WRN] Slow HTTP Response from "https://jellyfin.server.com/videos/ba3f8a4f-be4a-0195-f2ea-467231747b91/live.m3u8?DeviceId=TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMjQuMHwxNzExNjYwOTY1NTAx&MediaSourceId=328&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=-1&VideoBitrate=139616000&AudioBitrate=384000&MaxFramerate=25&PlaySessionId=fd10e63ecc4c487daa49a601cb1cdeb5&api_key=5ebde63f76ab46f093c97f6c401c01d3&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_ee8461408bd99accf028baca3558e074_328&TranscodingMaxAudioChannels=6&RequireAvc=false&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&mpeg2video-level=8&mpeg2video-videobitdepth=8&mpeg2video-profile=main&TranscodeReasons=ContainerNotSupported,%20VideoCodecNotSupported,%20AudioCodecNotSupported" to "10.15.20.115" in 0:01:22.8184248 with Status Code 500
[2024-03-28 22:15:51.270 +00:00] [INF] Restream for channel "328" was not opened.
[2024-03-28 22:15:51.270 +00:00] [INF] Starting restream for channel "328".
[2024-03-28 22:15:51.271 +00:00] [INF] Opening restream 5 for channel "328".
[2024-03-28 22:15:51.439 +00:00] [INF] Restream for channel "328" finished with state RanToCompletion
[2024-03-28 22:15:59.044 +00:00] [INF] session.RemoteEndPoint : "streaming.device.ip"
[2024-03-28 22:15:59.045 +00:00] [INF] StartPlaybackTimer : event_playing_id     = "89aa85354065d522b29df9c893cb1ede"
[2024-03-28 22:15:59.046 +00:00] [INF] StartPlaybackTimer : event_user_id        = "10c9401928764310aff54885836676bd"
[2024-03-28 22:15:59.046 +00:00] [INF] StartPlaybackTimer : event_user_id_int    = 1
[2024-03-28 22:15:59.046 +00:00] [INF] StartPlaybackTimer : session_playing_id   = "89aa85354065d522b29df9c893cb1ede"
[2024-03-28 22:15:59.046 +00:00] [INF] StartPlaybackTimer : session_user_id      = "10c9401928764310aff54885836676bd"
[2024-03-28 22:15:59.047 +00:00] [INF] StartPlaybackTimer : play_method          = "Transcode (v:h264 a:aac)"
[2024-03-28 22:15:59.047 +00:00] [INF] StartPlaybackTimer : e.ClientName         = "Jellyfin Web"
[2024-03-28 22:15:59.047 +00:00] [INF] StartPlaybackTimer : e.DeviceName         = "Firefox"
[2024-03-28 22:15:59.047 +00:00] [INF] StartPlaybackTimer : ItemName             = "BBC Three FHD (7pm)"
[2024-03-28 22:15:59.050 +00:00] [INF] StartPlaybackTimer : ItemId               = "89aa85354065d522b29df9c893cb1ede"
[2024-03-28 22:15:59.050 +00:00] [INF] StartPlaybackTimer : ItemType             = "TvChannel"
[2024-03-28 22:15:59.050 +00:00] [INF] StartPlaybackTimer : All matches, playback registered
[2024-03-28 22:15:59.050 +00:00] [INF] Playback tracker found, adding playback info : "TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMjQuMHwxNzExNjYwOTY1NTAx-10c9401928764310aff54885836676bd-89aa85354065d522b29df9c893cb1ede"
[2024-03-28 22:15:59.050 +00:00] [INF] Saving playback tracking activity in DB
[2024-03-28 22:15:59.052 +00:00] [INF] StartPlaybackTimer : Exited
[2024-03-28 22:15:59.927 +00:00] [INF] Processing playback tracker : "TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMjQuMHwxNzExNjYwOTY1NTAx-10c9401928764310aff54885836676bd-89aa85354065d522b29df9c893cb1ede"
[2024-03-28 22:16:05.216 +00:00] [INF] Restream for channel "328" finished with state RanToCompletion
[2024-03-28 22:16:19.956 +00:00] [INF] Processing playback tracker : "TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0OyBydjoxMjQuMCkgR2Vja28vMjAxMDAxMDEgRmlyZWZveC8xMjQuMHwxNzExNjYwOTY1NTAx-10c9401928764310aff54885836676bd-89aa85354065d522b29df9c893cb1ede"
[2024-03-28 22:16:21.285 +00:00] [WRN] Slow HTTP Response from "http://server.ip:8096/LiveTv/LiveStreamFiles/060e5fd7-fd53-4682-886d-d9398509f3c4/stream.ts" to "streaming.device.ip" in 0:00:30.0142629 with Status Code 200
[2024-03-28 22:16:21.288 +00:00] [ERR] FFmpeg exited with code 1
[2024-03-28 22:16:21.373 +00:00] [INF] Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-03-28 22:16:21.375 +00:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 3000000 -init_hw_device vaapi=va:/dev/dri/renderD128,driver=i965 -filter_hw_device va -autorotate 0 -i \"http://10.20.20.100:8096/LiveTv/LiveStreamFiles/060e5fd7-fd53-4682-886d-d9398509f3c4/stream.ts\" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 h264_vaapi -rc_mode CBR -b:v 5000000 -maxrate 5000000 -bufsize 10000000 -force_key_frames:0 \"expr:gte(t,n_forced*3)\" -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,yadif=0:-1:0,scale=trunc(min(max(iw\,ih*a)\,min(720\,576*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(720/a\,576))/2)*2,format=nv12,hwupload_vaapi\" -flags -global_header -codec:a:0 libfdk_aac -ac 2 -ab 256000 -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/96f90000a7d3e02a7413e3c985d0ef8b/\" -hls_segment_filename \"/var/lib/jellyfin/transcodes/96f90000a7d3e02a7413e3c985d0ef8b%d.ts\" -hls_playlist_type event -hls_list_size 0 -y \"/var/lib/jellyfin/transcodes/96f90000a7d3e02a7413e3c985d0ef8b.m3u8\""
[2024-03-28 22:16:21.374 +00:00] [ERR] Error processing request. URL "GET" "/videos/ba3f8a4f-be4a-0195-f2ea-467231747b91/live.m3u8".
MediaBrowser.Common.FfmpegException: FFmpeg exited with code 1
   at Jellyfin.Api.Helpers.TranscodingJobHelper.StartFfMpeg(StreamState state, String outputPath, String commandLineArguments, HttpRequest request, TranscodingJobType transcodingJobType, CancellationTokenSource cancellationTokenSource, String workingDirectory)
   at Jellyfin.Api.Controllers.DynamicHlsController.GetLiveHlsStream(Guid itemId, String container, Nullable`1 static, String params, String tag, String deviceProfileId, String playSessionId, String segmentContainer, Nullable`1 segmentLength, Nullable`1 minSegments, String mediaSourceId, String deviceId, String audioCodec, Nullable`1 enableAutoStreamCopy, Nullable`1 allowVideoStreamCopy, Nullable`1 allowAudioStreamCopy, Nullable`1 breakOnNonKeyFrames, Nullable`1 audioSampleRate, Nullable`1 maxAudioBitDepth, Nullable`1 audioBitRate, Nullable`1 audioChannels, Nullable`1 maxAudioChannels, String profile, String level, Nullable`1 framerate, Nullable`1 maxFramerate, Nullable`1 copyTimestamps, Nullable`1 startTimeTicks, Nullable`1 width, Nullable`1 height, Nullable`1 videoBitRate, Nullable`1 subtitleStreamIndex, Nullable`1 subtitleMethod, Nullable`1 maxRefFrames, Nullable`1 maxVideoBitDepth, Nullable`1 requireAvc, Nullable`1 deInterlace, Nullable`1 requireNonAnamorphic, Nullable`1 transcodingMaxAudioChannels, Nullable`1 cpuCoreLimit, String liveStreamId, Nullable`1 enableMpegtsM2TsMode, String videoCodec, String subtitleCodec, String transcodeReasons, Nullable`1 audioStreamIndex, Nullable`1 videoStreamIndex, Nullable`1 context, Dictionary`2 streamOptions, Nullable`1 maxWidth, Nullable`1 maxHeight, Nullable`1 enableSubtitlesInManifest)

most of these logs are about the ffmpeg transcode itself, but nevertheless - playback is flawless and works without issue but only when iptv is transcoded - this is baffling to me. No other files on the server do this, and the fact it works on the same device when watched through a browser is so weird. Sadly I cant use this as a workaround for devices like smart TV's

@Kevinjil
Copy link
Owner

Some observations:

  1. The change of all=https:// did fix your networking, as now the restream is actually opened using direct play:
[2024-03-28 21:25:08.501 +00:00] [INF] Opening restream 1 for channel "577".
  1. Your ffmpeg on the server probably can't reach itself using the all=https://, so somewhere is still something tricky going on in your networking setup.
  2. I don't use any of the clients you mentioned, but the Android (non-TV) client falsely assumes that all HTTP playback is HLS: https://github.com/jellyfin/jellyfin-android/blob/19dc465fb0b0eac6d1ad84f6eebdf75f3343ffaf/app/src/main/java/org/jellyfin/mobile/player/queue/QueueManager.kt#L221
    This appears to be an app bug, possibly also in the Windows and WebOS clients.

@Kevinjil
Copy link
Owner

Related issue: jellyfin/jellyfin-android#1277

@Renderer6060
Copy link
Author

Some observations:

1. The change of `all=https://` did fix your networking, as now the restream is actually opened using direct play:
[2024-03-28 21:25:08.501 +00:00] [INF] Opening restream 1 for channel "577".
2. Your ffmpeg on the server probably can't reach itself using the `all=https://`, so somewhere is still something tricky going on in your networking setup.

3. I don't use any of the clients you mentioned, but the Android (non-TV) client falsely assumes that all HTTP playback is `HLS`: https://github.com/jellyfin/jellyfin-android/blob/19dc465fb0b0eac6d1ad84f6eebdf75f3343ffaf/app/src/main/java/org/jellyfin/mobile/player/queue/QueueManager.kt#L221
   This appears to be an app bug, possibly also in the Windows and WebOS clients.

Ah, interesting, I didnt spot that, good to know. If the playback not starting for directplay was FFMPEG related, any reason that the Networking change also broke transcoded streams?

The jellyfin host can ping and resolve jellyfin.server.com so im guessing its ffmpeg having the https specifically causing the issue.

For Clarity, the issue is also present on Jellyfin for WebOS (The LG Homebrew channels installation)

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants