jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.68k stars 457 forks source link

Live TV: Transcoding MPEG2 when it can be direct streamed/remux #2568

Closed Splinter7914 closed 1 year ago

Splinter7914 commented 1 year ago

Describe the bug

When playing Live TV via Jellyfin it ends up getting transcoded. Same channel on plex plays via direct stream.

If i changed the video player to libVLC and disabled video transcoding for the user then the video played via direct stream.

If i disabled both audio and video transcoding for the user and libVLC as the player then it would remux.

So wanted to check if the client needs to be updated so that it can direct stream/remux Live TV vs transcode it.

The channel I am playing is using MPEG2

Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_qsv))
  Stream #0:1 -> #0:1 (copy)

Logs

09:21:14] [INF] [8] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for amoney. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[09:21:14] [INF] [8] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile=AndroidTV-ExoPlayer, Path=http://192.168.1.125, AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=DirectPlayError ) media:/videos/cda10c0a-8b5c-5372-5d0b-b3aa3716cb2f/master.m3u8?MediaSourceId=native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5&VideoCodec=hevc,h264&AudioCodec=AC3&AudioStreamIndex=-1&VideoBitrate=99552000&AudioBitrate=448000&api_key=<token>&RequireAvc=false&SegmentContainer=ts&BreakOnNonKeyFrames=False&h264-profile=high,main,baseline,constrainedbaseline&h264-level=52&h264-maxrefframes=4&aac-audiochannels=8&TranscodeReasons=DirectPlayError
[09:21:15] [WRN] [8] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from https://jellyfin.xxx.xxx.xxx/Items/cda10c0a-8b5c-5372-5d0b-b3aa3716cb2f/PlaybackInfo?format=json to 192.168.1.94 in 0:00:00.9914366 with Status Code 200
[09:21:15] [INF] [13] Emby.Server.Implementations.LiveTv.LiveTvManager: Opening channel stream from Emby, external channel Id: hdhr_2.1
[09:21:15] [INF] [13] Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV: Streaming Channel hdhr_2.1
[09:21:15] [INF] [13] Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun.HdHomerunHost: GetChannelStream: channel id: hdhr_2.1. stream id: native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5 profile: native
[09:21:15] [INF] [13] Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun.HdHomerunHost: Opening SharedHttpStream Live stream from http://192.168.1.125:5004/auto/v2.1
[09:21:15] [INF] [24] Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun.HdHomerunHost: Beginning SharedHttpStream stream to /config/data/transcodes/362e8b736f2148479377245b05136675.ts
[09:21:15] [INF] [13] Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun.HdHomerunHost: Live stream opened after 427.3621ms
[09:21:15] [INF] [13] Emby.Server.Implementations.LiveTv.EmbyTV.EmbyTV: Returning mediasource streamId native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5, mediaSource.Id native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5, mediaSource.LiveStreamId null
[09:21:15] [INF] [10] Emby.Server.Implementations.Library.MediaSourceManager: Live tv media info probe took 0.0659646 seconds
[09:21:15] [INF] [10] Emby.Server.Implementations.Library.MediaSourceManager: Live stream opened: {"Protocol": "Http", "Id": "native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5", "Path": "http://192.168.1.21:8096/LiveTv/LiveStreamFiles/362e8b736f2148479377245b05136675/stream.ts", "EncoderPath": null, "EncoderProtocol": null, "Type": "Default", "Container": "mpegts", "Size": null, "Name": null, "IsRemote": false, "ETag": null, "RunTimeTicks": null, "ReadAtNativeFramerate": false, "IgnoreDts": true, "IgnoreIndex": false, "GenPtsInput": false, "SupportsTranscoding": true, "SupportsDirectStream": true, "SupportsDirectPlay": false, "IsInfiniteStream": true, "RequiresOpening": true, "OpenToken": null, "RequiresClosing": true, "LiveStreamId": "a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5", "BufferMs": 0, "RequiresLooping": false, "SupportsProbing": true, "VideoType": null, "IsoType": null, "Video3DFormat": null, "MediaStreams": [{"Codec": "mpeg2video", "CodecTag": null, "Language": null, "ColorRange": "tv", "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": "SDR", "VideoRangeType": "SDR", "VideoDoViTitle": null, "LocalizedUndefined": null, "LocalizedDefault": null, "LocalizedForced": null, "LocalizedExternal": null, "DisplayTitle": "1080i MPEG2VIDEO SDR", "NalLengthSize": null, "IsInterlaced": true, "IsAVC": null, "ChannelLayout": null, "BitRate": 20000000, "BitDepth": 8, "RefFrames": 1, "PacketLength": null, "Channels": null, "SampleRate": null, "IsDefault": false, "IsForced": false, "Height": 1080, "Width": 1920, "AverageFrameRate": 29.97003, "RealFrameRate": 29.97003, "Profile": "Main", "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": 4, "IsAnamorphic": false, "$type": "MediaStream"}, {"Codec": "ac3", "CodecTag": "AC-3", "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": null, "VideoRangeType": null, "VideoDoViTitle": null, "LocalizedUndefined": null, "LocalizedDefault": null, "LocalizedForced": null, "LocalizedExternal": null, "DisplayTitle": "Dolby Digital - 5.1", "NalLengthSize": null, "IsInterlaced": false, "IsAVC": null, "ChannelLayout": "5.1", "BitRate": 384000, "BitDepth": null, "RefFrames": null, "PacketLength": null, "Channels": 6, "SampleRate": 48000, "IsDefault": false, "IsForced": false, "Height": null, "Width": null, "AverageFrameRate": null, "RealFrameRate": null, "Profile": null, "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, "$type": "MediaStream"}], "MediaAttachments": [], "Formats": [], "Bitrate": 20384000, "Timestamp": null, "RequiredHttpHeaders": {}, "TranscodingUrl": null, "TranscodingSubProtocol": null, "TranscodingContainer": null, "AnalyzeDurationMs": 3000, "TranscodeReasons": "0", "DefaultAudioStreamIndex": null, "DefaultSubtitleStreamIndex": null, "VideoStream": {"Codec": "mpeg2video", "CodecTag": null, "Language": null, "ColorRange": "tv", "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": "SDR", "VideoRangeType": "SDR", "VideoDoViTitle": null, "LocalizedUndefined": null, "LocalizedDefault": null, "LocalizedForced": null, "LocalizedExternal": null, "DisplayTitle": "1080i MPEG2VIDEO SDR", "NalLengthSize": null, "IsInterlaced": true, "IsAVC": null, "ChannelLayout": null, "BitRate": 20000000, "BitDepth": 8, "RefFrames": 1, "PacketLength": null, "Channels": null, "SampleRate": null, "IsDefault": false, "IsForced": false, "Height": 1080, "Width": 1920, "AverageFrameRate": 29.97003, "RealFrameRate": 29.97003, "Profile": "Main", "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": 4, "IsAnamorphic": false, "$type": "MediaStream"}, "$type": "MediaSourceInfo"}
[09:21:15] [INF] [10] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for amoney. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[09:21:15] [INF] [10] Jellyfin.Api.Helpers.MediaInfoHelper: StreamBuilder.BuildVideoItem( Profile=AndroidTV-ExoPlayer, Path=http://192.168.1.21:8096/LiveTv/LiveStreamFiles/362e8b736f2148479377245b05136675/stream.ts, AudioStreamIndex=null, SubtitleStreamIndex=null ) => ( PlayMethod=Transcode, TranscodeReason=DirectPlayError ) media:/videos/cda10c0a-8b5c-5372-5d0b-b3aa3716cb2f/master.m3u8?MediaSourceId=native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5&VideoCodec=hevc,h264&AudioCodec=ac3&AudioStreamIndex=-1&VideoBitrate=99616000&AudioBitrate=384000&AudioSampleRate=48000&MaxFramerate=29.97003&api_key=<token>&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5&RequireAvc=false&SegmentContainer=ts&BreakOnNonKeyFrames=False&mpeg2video-level=4&mpeg2video-videobitdepth=8&mpeg2video-profile=main&mpeg2video-audiochannels=6&h264-profile=high,main,baseline,constrainedbaseline&h264-level=52&h264-maxrefframes=4&aac-audiochannels=8&TranscodeReasons=DirectPlayError
[09:21:15] [WRN] [10] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from https://jellyfin.xxx.xxx.xxx/LiveStreams/Open?format=json to 192.168.1.94 in 0:00:00.7258726 with Status Code 200
[09:21:16] [INF] [23] Jellyfin.Api.Helpers.TranscodingJobHelper: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 3000000 -fflags +igndts -init_hw_device vaapi=va:,driver=iHD,kernel_driver=i915 -init_hw_device qsv=qs@va -filter_hw_device qs -autorotate 0 -i "http://192.168.1.21:8096/LiveTv/LiveStreamFiles/362e8b736f2148479377245b05136675/stream.ts" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 hevc_qsv -tag:v:0 hvc1 -preset 7 -b:v 12000000 -maxrate 12000000 -bufsize 24000000 -g:v:0 90 -keyint_min:v:0 90 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,yadif=0:-1:0,scale=trunc(min(max(iw\,ih*a)\,min(1920\,1080*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(1920/a\,1080))/2)*2,format=yuv420p" -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/354fb56535982bcf22bbfbd2643c06dc/" -hls_segment_filename "/config/data/transcodes/354fb56535982bcf22bbfbd2643c06dc%d.ts" -hls_playlist_type event -hls_list_size 0 -y "/config/data/transcodes/354fb56535982bcf22bbfbd2643c06dc.m3u8"
[09:21:16] [WRN] [3] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from https://jellyfin.xxx.xxx.xxx/Sessions/Playing to 192.168.1.94 in 0:00:00.6087028 with Status Code 204
[09:21:16] [INF] [11] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Adding playback tracker : 4d9664ea6a55b5b34d80b6cba733de3300048253-ef16fb8ea4b74d2dbe6fb695a0ad41b2-cda10c0a8b5c53725d0bb3aa3716cb2f
[09:21:16] [INF] [11] Jellyfin.Plugin.PlaybackReporting.Data.PlaybackTracker: PlaybackTracker : Adding Start Event : 03/04/2023 09:21:16
[09:21:16] [INF] [11] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Creating StartPlaybackTimer Task
[09:21:16] [INF] [3] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : Entered
[09:21:17] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Processing playback tracker : 4d9664ea6a55b5b34d80b6cba733de3300048253-ef16fb8ea4b74d2dbe6fb695a0ad41b2-cda10c0a8b5c53725d0bb3aa3716cb2f
[09:21:26] [WRN] [30] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from https://jellyfin.xxx.xxx.xxx/videos/cda10c0a-8b5c-5372-5d0b-b3aa3716cb2f/live.m3u8?DeviceId=4d9664ea6a55b5b34d80b6cba733de3300048253&MediaSourceId=native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5&VideoCodec=hevc,h264&AudioCodec=ac3&AudioStreamIndex=-1&VideoBitrate=99616000&AudioBitrate=384000&AudioSampleRate=48000&MaxFramerate=29.97003&PlaySessionId=b630f5f078d344378f359edcde8f1a7a&api_key=5b8bda31e6cc4e7e9b881b72d1ba2e09&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5&RequireAvc=false&SegmentContainer=ts&BreakOnNonKeyFrames=False&mpeg2video-level=4&mpeg2video-videobitdepth=8&mpeg2video-profile=main&mpeg2video-audiochannels=6&h264-profile=high,main,baseline,constrainedbaseline&h264-level=52&h264-maxrefframes=4&aac-audiochannels=8&TranscodeReasons=DirectPlayError to 192.168.1.94 in 0:00:10.0234536 with Status Code 200
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: session.RemoteEndPoint : 192.168.1.94
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_playing_id     = cda10c0a8b5c53725d0bb3aa3716cb2f
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id        = ef16fb8ea4b74d2dbe6fb695a0ad41b2
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : event_user_id_int    = 1
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_playing_id   = cda10c0a8b5c53725d0bb3aa3716cb2f
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : session_user_id      = ef16fb8ea4b74d2dbe6fb695a0ad41b2
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : play_method          = Transcode (v:hevc a:direct)
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.ClientName         = Android TV
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : e.DeviceName         = shield TV
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemName             = KPRC-HD
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemId               = cda10c0a8b5c53725d0bb3aa3716cb2f
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : ItemType             = TvChannel
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : All matches, playback registered
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Playback tracker found, adding playback info : 4d9664ea6a55b5b34d80b6cba733de3300048253-ef16fb8ea4b74d2dbe6fb695a0ad41b2-cda10c0a8b5c53725d0bb3aa3716cb2f
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Saving playback tracking activity in DB
[09:21:36] [INF] [32] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: StartPlaybackTimer : Exited
[09:21:37] [INF] [30] Jellyfin.Plugin.PlaybackReporting.EventMonitorEntryPoint: Processing playback tracker : 4d9664ea6a55b5b34d80b6cba733de3300048253-ef16fb8ea4b74d2dbe6fb695a0ad41b2-cda10c0a8b5c53725d0bb3aa3716cb2f

FFmpeg logs

/videos/cda10c0a-8b5c-5372-5d0b-b3aa3716cb2f/live.m3u8

{"Protocol":1,"Id":"native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5","Path":"http://192.168.1.21:8096/LiveTv/LiveStreamFiles/51e49c5b22134da9ac81d835c2281e15/stream.ts","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"mpegts","Size":null,"Name":null,"IsRemote":false,"ETag":null,"RunTimeTicks":null,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":false,"IsInfiniteStream":true,"RequiresOpening":true,"OpenToken":null,"RequiresClosing":true,"LiveStreamId":"a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_native_b23ebc9442ec90ed5f591ef1683972b1_978d0595634d01e0613e03c008c53ee5","BufferMs":0,"RequiresLooping":false,"SupportsProbing":true,"VideoType":null,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"mpeg2video","CodecTag":null,"Language":null,"ColorRange":"tv","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":"SDR","VideoRangeType":"SDR","VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"1080i MPEG2VIDEO SDR","NalLengthSize":null,"IsInterlaced":true,"IsAVC":null,"ChannelLayout":null,"BitRate":20000000,"BitDepth":8,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":29.97003,"RealFrameRate":29.97003,"Profile":"Main","Type":1,"AspectRatio":"16:9","Index":-1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p","Level":4,"IsAnamorphic":false},{"Codec":"ac3","CodecTag":"AC-3","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":null,"VideoRangeType":null,"VideoDoViTitle":null,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"DisplayTitle":"Dolby Digital - 5.1","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":"5.1","BitRate":384000,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"Profile":null,"Type":0,"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":20384000,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":null,"TranscodingContainer":null,"AnalyzeDurationMs":3000,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null}

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 3000000 -fflags +igndts -init_hw_device vaapi=va:,driver=iHD,kernel_driver=i915 -init_hw_device qsv=qs@va -filter_hw_device qs -autorotate 0 -i "http://192.168.1.21:8096/LiveTv/LiveStreamFiles/51e49c5b22134da9ac81d835c2281e15/stream.ts" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 hevc_qsv -tag:v:0 hvc1 -preset 7 -b:v 12000000 -maxrate 12000000 -bufsize 24000000 -g:v:0 90 -keyint_min:v:0 90 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,yadif=0:-1:0,scale=trunc(min(max(iw\,ih*a)\,min(1920\,1080*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(1920/a\,1080))/2)*2,format=yuv420p" -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/c98db375baf37cb15b9bc2a3dba33504/" -hls_segment_filename "/config/data/transcodes/c98db375baf37cb15b9bc2a3dba33504%d.ts" -hls_playlist_type event -hls_list_size 0 -y "/config/data/transcodes/c98db375baf37cb15b9bc2a3dba33504.m3u8"

ffmpeg version 5.1.2-Jellyfin Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-shared --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-static --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[mpeg2video @ 0x55a0ae8c8340] Invalid frame dimensions 0x0.
Input #0, mpegts, from 'http://192.168.1.21:8096/LiveTv/LiveStreamFiles/51e49c5b22134da9ac81d835c2281e15/stream.ts':
  Duration: N/A, start: 39399.900789, bitrate: N/A
  Program 3
  Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn
    Side data:
      cpb: bitrate max/min/avg: 17598000/0/0 buffer size: 7995392 vbv_delay: N/A
  Stream #0:1[0x34](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s
  Stream #0:2[0x35](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_qsv))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Output #0, hls, to '/config/data/transcodes/c98db375baf37cb15b9bc2a3dba33504.m3u8':
  Metadata:
    encoder         : Lavf59.27.100
  Stream #0:0: Video: hevc (hvc1 / 0x31637668), nv12(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 12000 kb/s, 29.97 fps, 90k tbn
    Metadata:
      encoder         : Lavc59.37.100 hevc_qsv
    Side data:
      cpb: bitrate max/min/avg: 12000000/0/12000000 buffer size: 24000000 vbv_delay: N/A
  Stream #0:1: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s
frame=    1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed=   0x
frame=   28 fps=0.0 q=-0.0 size=N/A time=-00:00:00.16 bitrate=N/A speed=N/A
frame=   62 fps= 59 q=-0.0 size=N/A time=00:00:01.08 bitrate=N/A speed=1.04x
frame=   94 fps= 60 q=-0.0 size=N/A time=00:00:02.04 bitrate=N/A speed=1.31x
[hls @ 0x55a0ae8dca80] Opening '/config/data/transcodes/c98db375baf37cb15b9bc2a3dba335040.ts' for writing
[hls @ 0x55a0ae8dca80] Opening '/config/data/transcodes/c98db375baf37cb15b9bc2a3dba33504.m3u8.tmp' for writing
frame=  125 fps= 61 q=-0.0 size=N/A time=00:00:03.00 bitrate=N/A speed=1.46x
frame=  156 fps= 61 q=-0.0 size=N/A time=00:00:03.99 bitrate=N/A speed=1.55x
frame=  185 fps= 59 q=-0.0 size=N/A time=00:00:05.08 bitrate=N/A speed=1.63x
[hls @ 0x55a0ae8dca80] Opening '/config/data/transcodes/c98db375baf37cb15b9bc2a3dba335041.ts' for writing
[hls @ 0x55a0ae8dca80] Opening '/config/data/transcodes/c98db375baf37cb15b9bc2a3dba33504.m3u8.tmp' for writing
frame=  209 fps= 57 q=-0.0 size=N/A time=00:00:05.56 bitrate=N/A speed=1.53x
frame=  231 fps= 56 q=-0.0 size=N/A time=00:00:06.20 bitrate=N/A speed= 1.5x
frame=  246 fps= 53 q=-0.0 size=N/A time=00:00:06.68 bitrate=N/A speed=1.44x
frame=  262 fps= 51 q=-0.0 size=N/A time=00:00:07.16 bitrate=N/A speed=1.38x


### Media info of the file

_No response_

### Application version

0.15.4

### Device information

Nvidia Shield

### Android version

11

### Jellyfin server version

10.8.9
Splinter7914 commented 1 year ago

Also the setting in the client "Direct Stream Live TV" has no impact.

jellyfin-bot commented 1 year ago

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 master branch, 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.

sielicki commented 9 months ago

https://developer.android.com/guide/topics/media/exoplayer/supported-formats

while exoplayer doesn't support mpegts as a container, there's nothing in the way of it supporting mpeg2 as a codec, I believe this is a bug.

meyerjom commented 4 months ago

Same Problem here.