Skip to content

Commit

Permalink
Force more compatible transcoding profile for LiveTV (jellyfin#11801)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnattu committed May 24, 2024
1 parent d89e5a0 commit e7b1162
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Jellyfin.Api/Helpers/MediaInfoHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,19 @@ public void SortMediaSources(PlaybackInfoResponse result, long? maxBitrate)
/// <returns>A <see cref="Task"/> containing the <see cref="LiveStreamResponse"/>.</returns>
public async Task<LiveStreamResponse> OpenMediaSource(HttpContext httpContext, LiveStreamRequest request)
{
// Enforce more restrictive transcoding profile for LiveTV due to compatability reasons
// Cap the MaxStreamingBitrate to 20Mbps, because we are unable to reliably probe source bitrate,
// which will cause the client to request extremely high bitrate that may fail the player/encoder
request.MaxStreamingBitrate = request.MaxStreamingBitrate > 20000000 ? 20000000 : request.MaxStreamingBitrate;

if (request.DeviceProfile is not null)
{
// Remove all fmp4 transcoding profiles, because it causes playback error and/or A/V sync issues
// Notably: Some channels won't play on FireFox and LG webOs
// Some channels from HDHomerun will experience A/V sync issues
request.DeviceProfile.TranscodingProfiles = request.DeviceProfile.TranscodingProfiles.Where(p => !string.Equals(p.Container, "mp4", StringComparison.OrdinalIgnoreCase)).ToArray();
}

var result = await _mediaSourceManager.OpenLiveStream(request, CancellationToken.None).ConfigureAwait(false);

var profile = request.DeviceProfile;
Expand Down

0 comments on commit e7b1162

Please sign in to comment.