Browse Source

include audio language metadata in all streaming modes (#295)

* include audio language metadata in all streaming modes

* cleanup
pull/296/head
Jason Dove 4 years ago committed by GitHub
parent
commit
5f28707cce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CHANGELOG.md
  2. 18
      ErsatzTV.Core/FFmpeg/FFmpegProcessBuilder.cs
  3. 6
      ErsatzTV.Core/FFmpeg/FFmpegProcessService.cs

5
CHANGELOG.md

@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Include audio language metadata in all streaming modes
### Fixed
- Fix flooding schedule items that have a fixed start time
## [0.0.48-prealpha] - 2021-06-22
### Added

18
ErsatzTV.Core/FFmpeg/FFmpegProcessBuilder.cs

@ -230,14 +230,29 @@ namespace ErsatzTV.Core.FFmpeg @@ -230,14 +230,29 @@ namespace ErsatzTV.Core.FFmpeg
return this;
}
public FFmpegProcessBuilder WithMetadata(Channel channel)
public FFmpegProcessBuilder WithMetadata(Channel channel, Option<MediaStream> maybeAudioStream)
{
if (channel.StreamingMode == StreamingMode.TransportStream)
{
_arguments.AddRange(new[] { "-map_metadata", "-1" });
}
foreach (MediaStream audioStream in maybeAudioStream)
{
if (!string.IsNullOrWhiteSpace(audioStream.Language))
{
_arguments.AddRange(new[] { "-metadata:s:a:0", $"language={audioStream.Language}" });
}
}
var arguments = new List<string>
{
"-metadata", "service_provider=\"ErsatzTV\"",
"-metadata", $"service_name=\"{channel.Name}\""
};
_arguments.AddRange(arguments);
return this;
}
@ -323,7 +338,6 @@ namespace ErsatzTV.Core.FFmpeg @@ -323,7 +338,6 @@ namespace ErsatzTV.Core.FFmpeg
new[]
{
"-c:a", playbackSettings.AudioCodec,
"-map_metadata", "-1",
"-movflags", "+faststart",
"-muxdelay", "0",
"-muxpreload", "0"

6
ErsatzTV.Core/FFmpeg/FFmpegProcessService.cs

@ -105,7 +105,7 @@ namespace ErsatzTV.Core.FFmpeg @@ -105,7 +105,7 @@ namespace ErsatzTV.Core.FFmpeg
});
return builder.WithPlaybackArgs(playbackSettings)
.WithMetadata(channel)
.WithMetadata(channel, maybeAudioStream)
.WithFormat("mpegts")
.WithDuration(start + version.Duration - now)
.WithPipe()
@ -130,7 +130,7 @@ namespace ErsatzTV.Core.FFmpeg @@ -130,7 +130,7 @@ namespace ErsatzTV.Core.FFmpeg
.WithErrorText(desiredResolution, errorMessage)
.WithPixfmt("yuv420p")
.WithPlaybackArgs(playbackSettings)
.WithMetadata(channel)
.WithMetadata(channel, None)
.WithFormat("mpegts");
duration.IfSome(d => builder = builder.WithDuration(d));
@ -149,7 +149,7 @@ namespace ErsatzTV.Core.FFmpeg @@ -149,7 +149,7 @@ namespace ErsatzTV.Core.FFmpeg
.WithRealtimeOutput(playbackSettings.RealtimeOutput)
.WithInfiniteLoop()
.WithConcat($"http://localhost:{Settings.ListenPort}/ffmpeg/concat/{channel.Number}")
.WithMetadata(channel)
.WithMetadata(channel, None)
.WithFormat("mpegts")
.WithPipe()
.Build();

Loading…
Cancel
Save