jellyfin / jellyfin-webos

WebOS Client for Jellyfin
https://jellyfin.org
Mozilla Public License 2.0
652 stars 68 forks source link

LiveTV mpegts playback broken in 10.8.0_alpha1 #61

Open exalented opened 3 years ago

exalented commented 3 years ago

This does not happen with jellyfin-web and ungoogled-chromium. I have an LG 65NANO90UNA on WebOS 5.2.3-25211. The only way I can play livetv mpegts streams is to turn off 'prefer fMP4-HLS Media Container'. When I turn it off in playback, jellyfin 10.8.0_alpha1 (tagged docker image) transcodes to WebOS 5 because of 'ContainerBitrateExceedsLimit'.

Playback Info
  Player:Html Video Player
  Play method:Transcoding
  Protocol:http
  Stream type:Video

Video Info
  Video resolution:1280x720

Transcoding Info
  Video codec:H264
  Audio codec:AAC (direct)
  Audio channels:2
  Bitrate:8.1 Mbps
  Transcoding framerate:61 fps
  Reason for transcoding: ContainerBitrateExceedsLimit

Original Media Info
  Container:mpegts
  Bitrate:8.1 Mbps
  Video codec:H264 High
  Video range:SDR
  Audio codec:AAC LC
  Audio bitrate:96 kbps
  Audio channels:2
  Audio sample rate:48000 Hz

The web browser on the tv does not need 'prefer fMP4-HLS Media Container', but still transcodes in the same manner. Is this intended behavior?

anthonylavado commented 2 years ago

Is this still happening with alpha5?

What happens if you try the "Force transcoding of Live TV" option in the user settings?

I seem to remember seeing that the fMP4 option really only helped Safari anyway...

exalented commented 2 years ago

fMP4

In some cases it's prevented or permitted Direct Play of certain media.

Alpha5

These alphas have been behaving differently and live tv playback being successful is sort of a hit or miss, so this is why I haven't updated this issue.

Force transcoding of Live TV

In alpha 5 this does not allow playback. I still get an infinite spinner across many different platforms using the web client. So really this issue now belongs in https://github.com/jellyfin/jellyfin-web or https://github.com/jellyfin/jellyfin/issues/4783, but once upon a time this aspect of the server wasn't as broken.

exalented commented 2 years ago

This is what shows in the server log for the alpha5 docker image:

Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: DeviceProfile { Name: null, Id: null, Identification: null, FriendlyName: null, Manufacturer: null, ManufacturerUrl: null, ModelName: null, ModelDescription: null, ModelNumber: null, ModelUrl: null, SerialNumber: null, ....
Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL "POST" "/Items/eb12942f9a11f96d336a49fba3108d0b/PlaybackInfo".
System.NullReferenceException: Object reference not set to an instance of an object.
   at MediaBrowser.Model.Dlna.StreamBuilder.IsEligibleForDirectPlay(MediaSourceInfo item, Int64 maxBitrate, MediaStream subtitleStream, MediaStream audioStream, VideoOptions options, PlayMethod playMethod)
   at MediaBrowser.Model.Dlna.StreamBuilder.BuildVideoItem(MediaSourceInfo item, VideoOptions options)
   at MediaBrowser.Model.Dlna.StreamBuilder.BuildVideoItem(VideoOptions options)
   at Jellyfin.Api.Helpers.MediaInfoHelper.SetDeviceSpecificData(BaseItem item, MediaSourceInfo mediaSource, DeviceProfile profile, AuthorizationInfo auth, Nullable`1 maxBitrate, Int64 startTimeTicks, String mediaSourceId, Nullable`1 audioStreamIndex, Nullable`1 subtitleStreamIndex, Nullable`1 maxAudioChannels, String playSessionId, Guid userId, Boolean enableDirectPlay, Boolean enableDirectStream, Boolean enableTranscoding, Boolean allowVideoStreamCopy, Boolean allowAudioStreamCopy, IPAddress ipAddress)
   at Jellyfin.Api.Controllers.MediaInfoController.GetPostedPlaybackInfo(Guid itemId, Nullable`1 userId, Nullable`1 maxStreamingBitrate, Nullable`1 startTimeTicks, Nullable`1 audioStreamIndex, Nullable`1 subtitleStreamIndex, Nullable`1 maxAudioChannels, String mediaSourceId, String liveStreamId, Nullable`1 autoOpenLiveStream, Nullable`1 enableDirectPlay, Nullable`1 enableDirectStream, Nullable`1 enableTranscoding, Nullable`1 allowVideoStreamCopy, Nullable`1 allowAudioStreamCopy, PlaybackInfoDto playbackInfoDto)
   at lambda_method632(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.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)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
...

Edit: resolved with 20220130.2-unstable

Fyb3roptik commented 2 years ago

Using the latest build on webOS 4.x I am playing livetv no issues right now. Would love to confirm it is working again on your device with the latest build

exalented commented 2 years ago

Server is 20220316.5-unstable

No, it no longer seems to be working with the latest build above. EDIT: To be specific the tvheadend plugin no longer seems to be communicating with my tvheadend instance when I press play. The same stream works with an m3u list setup in the internal jellyfin config. The more I track this bug the more I see compatibility swapping between the tvheadend plugin and jellyfin internal playlist.

Fyb3roptik commented 2 years ago

It is working fine with my xteve. I have not used tvheadend

exalented commented 2 years ago

Perhaps this issue should be moved to https://github.com/jellyfin/jellyfin-plugin-tvheadend ?

Fyb3roptik commented 2 years ago

More than likely