Browse Source

upgrade to ffmpeg 5.1 (#931)

* use ffmpeg 5.1 on windows

* remove some debug logs

* use latest ffmpeg on arm

* use ffmpeg 5.1 base images

* update ffmpeg health check for 5.1

* update changelog
pull/933/head
Jason Dove 3 years ago committed by GitHub
parent
commit
5546ad204c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/artifacts.yml
  2. 2
      CHANGELOG.md
  3. 12
      ErsatzTV.Application/Streaming/HlsSessionWorker.cs
  4. 10
      ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs
  5. 4
      ErsatzTV/Controllers/IptvController.cs
  6. 2
      docker/Dockerfile
  7. 3
      docker/arm32v7/Dockerfile
  8. 3
      docker/arm64/Dockerfile
  9. 2
      docker/nvidia/Dockerfile
  10. 2
      docker/nvidia/ffmpeg.Dockerfile
  11. 2
      docker/vaapi/Dockerfile
  12. 12
      docker/vaapi/ffmpeg.Dockerfile

2
.github/workflows/artifacts.yml

@ -198,7 +198,7 @@ jobs: @@ -198,7 +198,7 @@ jobs:
id: downloadffmpeg
name: Download ffmpeg
with:
url: "https://github.com/GyanD/codexffmpeg/releases/download/5.0/ffmpeg-5.0-full_build.7z"
url: "https://github.com/GyanD/codexffmpeg/releases/download/5.1/ffmpeg-5.1-full_build.7z"
target: ffmpeg/
- name: Build

2
CHANGELOG.md

@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Always return playlist after a maximum of 8 seconds while starting up an HLS Segmenter session
- Use multi-variant playlists instead of redirects for HLS Segmenter sessions
- Upgrade ffmpeg from 5.0 to 5.1 in most docker images (not ARM variants)
- Upgrading from 5.0 to 5.1 is also recommended for other installations (Windows, Linux)
## [0.6.5-beta] - 2022-08-02
### Fixed

12
ErsatzTV.Application/Streaming/HlsSessionWorker.cs

@ -88,7 +88,7 @@ public class HlsSessionWorker : IHlsSessionWorker @@ -88,7 +88,7 @@ public class HlsSessionWorker : IHlsSessionWorker
{
Slim.Release();
sw.Stop();
_logger.LogDebug("TrimPlaylist took {Duration}", sw.Elapsed);
// _logger.LogDebug("TrimPlaylist took {Duration}", sw.Elapsed);
}
}
@ -401,11 +401,11 @@ public class HlsSessionWorker : IHlsSessionWorker @@ -401,11 +401,11 @@ public class HlsSessionWorker : IHlsSessionWorker
var toDelete = allSegments.Filter(s => s.SequenceNumber < trimResult.Sequence).ToList();
if (toDelete.Count > 0)
{
_logger.LogDebug(
"Deleting HLS segments {Min} to {Max} (less than {StartSequence})",
toDelete.Map(s => s.SequenceNumber).Min(),
toDelete.Map(s => s.SequenceNumber).Max(),
trimResult.Sequence);
// _logger.LogDebug(
// "Deleting HLS segments {Min} to {Max} (less than {StartSequence})",
// toDelete.Map(s => s.SequenceNumber).Min(),
// toDelete.Map(s => s.SequenceNumber).Max(),
// trimResult.Sequence);
}
foreach (Segment segment in toDelete)

10
ErsatzTV.Infrastructure/Health/Checks/FFmpegVersionHealthCheck.cs

@ -8,8 +8,8 @@ namespace ErsatzTV.Infrastructure.Health.Checks; @@ -8,8 +8,8 @@ namespace ErsatzTV.Infrastructure.Health.Checks;
public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthCheck
{
private const string BundledVersion = "N-106635-g83e1a1de88";
private const string BundledVersionVaapi = "N-106957-g27cffd16aa";
private const string BundledVersion = "5.1";
private const string BundledVersionVaapi = "5.1";
private readonly IConfigElementRepository _configElementRepository;
public FFmpegVersionHealthCheck(IConfigElementRepository configElementRepository) =>
@ -72,13 +72,13 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe @@ -72,13 +72,13 @@ public class FFmpegVersionHealthCheck : BaseHealthCheck, IFFmpegVersionHealthChe
{
if (version.StartsWith("3.") || version.StartsWith("4."))
{
return FailResult($"{app} version {version} is too old; please install 5.0!");
return FailResult($"{app} version {version} is too old; please install 5.1!");
}
if (!version.StartsWith("5.0") && version != BundledVersion && version != BundledVersionVaapi)
if (!version.StartsWith("5.1") && version != BundledVersion && version != BundledVersionVaapi)
{
return WarningResult(
$"{app} version {version} is unexpected and may have problems; please install 5.0!");
$"{app} version {version} is unexpected and may have problems; please install 5.1!");
}
return None;

4
ErsatzTV/Controllers/IptvController.cs

@ -124,11 +124,11 @@ public class IptvController : ControllerBase @@ -124,11 +124,11 @@ public class IptvController : ControllerBase
[HttpGet("iptv/session/{channelNumber}/hls.m3u8")]
public async Task<IActionResult> GetLivePlaylist(string channelNumber, CancellationToken cancellationToken)
{
_logger.LogDebug("Checking for session worker for channel {Channel}", channelNumber);
// _logger.LogDebug("Checking for session worker for channel {Channel}", channelNumber);
if (_ffmpegSegmenterService.SessionWorkers.TryGetValue(channelNumber, out IHlsSessionWorker worker))
{
_logger.LogDebug("Trimming playlist for channel {Channel}", channelNumber);
// _logger.LogDebug("Trimming playlist for channel {Channel}", channelNumber);
DateTimeOffset now = DateTimeOffset.Now.AddSeconds(-30);
Option<TrimPlaylistResult> maybePlaylist = await worker.TrimPlaylist(now, cancellationToken);

2
docker/Dockerfile

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal-amd64 AS dotnet-runtime
FROM jasongdove/ffmpeg:5.0-ubuntu2004 AS runtime-base
FROM jasongdove/ffmpeg:5.1-ubuntu2004 AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev tzdata fontconfig fonts-dejavu libgdiplus

3
docker/arm32v7/Dockerfile

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal-arm32v7 AS dotnet-runtime
# TODO: upgrade once https://github.com/linuxserver/docker-ffmpeg/issues/19 is fixed
FROM linuxserver/ffmpeg:arm32v7-4.4-cli-ls55 AS runtime-base
FROM linuxserver/ffmpeg:arm32v7-latest AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev \
tzdata \

3
docker/arm64/Dockerfile

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal-arm64v8 AS dotnet-runtime
# TODO: upgrade once https://github.com/linuxserver/docker-ffmpeg/issues/19 is fixed
FROM linuxserver/ffmpeg:arm64v8-4.4-cli-ls55 AS runtime-base
FROM linuxserver/ffmpeg:arm64v8-latest AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev \
tzdata \

2
docker/nvidia/Dockerfile

@ -29,7 +29,7 @@ ARG INFO_VERSION="unknown" @@ -29,7 +29,7 @@ ARG INFO_VERSION="unknown"
RUN dotnet publish ErsatzTV.csproj -c release -o /app -r linux-x64 --self-contained false --no-restore /p:DebugType=Embedded /p:InformationalVersion=${INFO_VERSION}
# final stage/image
FROM jasongdove/ffmpeg:5.0-nvidia2004 AS runtime-base
FROM jasongdove/ffmpeg:5.1-nvidia2004 AS runtime-base
ENV FONTCONFIG_PATH=/etc/fonts
RUN fc-cache update
WORKDIR /app

2
docker/nvidia/ffmpeg.Dockerfile

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal-amd64 AS dotnet-runtime
FROM jasongdove/ffmpeg-base:5.0-nvidia2004 AS runtime-base
FROM jasongdove/ffmpeg-base:5.1-nvidia2004 AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev tzdata fontconfig fonts-dejavu libgdiplus \

2
docker/vaapi/Dockerfile

@ -29,7 +29,7 @@ ARG INFO_VERSION="unknown" @@ -29,7 +29,7 @@ ARG INFO_VERSION="unknown"
RUN dotnet publish ErsatzTV.csproj -c release -o /app -r linux-x64 --self-contained false --no-restore /p:DebugType=Embedded /p:InformationalVersion=${INFO_VERSION}
# final stage/image
FROM jasongdove/ffmpeg:5.0-vaapi2004 AS runtime-base
FROM jasongdove/ffmpeg:5.1-vaapi2004 AS runtime-base
ENV FONTCONFIG_PATH=/etc/fonts
RUN fc-cache update
WORKDIR /app

12
docker/vaapi/ffmpeg.Dockerfile

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal-amd64 AS dotnet-runtime
FROM jasongdove/ffmpeg-base:5.0-vaapi2004 AS runtime-base
FROM jasongdove/ffmpeg-base:5.1-vaapi2004 AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev \
tzdata \
@ -18,22 +18,22 @@ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu @@ -18,22 +18,22 @@ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu
wget \
mesa-va-drivers \
&& mkdir /tmp/intel && cd /tmp/intel \
&& wget -O - https://github.com/intel/libva/archive/refs/tags/2.14.0.tar.gz | tar zxf - \
&& cd libva-2.14.0 \
&& wget -O - https://github.com/intel/libva/archive/refs/tags/2.15.0.tar.gz | tar zxf - \
&& cd libva-2.15.0 \
&& ./autogen.sh \
&& ./configure \
&& make -j$(nproc) \
&& make -j$(nproc) install \
&& cd /tmp/intel \
&& wget -O - https://github.com/intel/gmmlib/archive/refs/tags/intel-gmmlib-22.1.2.tar.gz | tar zxf - \
&& mv gmmlib-intel-gmmlib-22.1.2 gmmlib \
&& wget -O - https://github.com/intel/gmmlib/archive/refs/tags/intel-gmmlib-22.1.7.tar.gz | tar zxf - \
&& mv gmmlib-intel-gmmlib-22.1.7 gmmlib \
&& cd gmmlib \
&& mkdir build && cd build \
&& cmake .. \
&& make -j$(nproc) \
&& make install \
&& cd /tmp/intel \
&& git clone --depth 1 --branch intel-media-22.3 https://github.com/intel/media-driver \
&& git clone --depth 1 --branch intel-media-22.4 https://github.com/intel/media-driver \
&& mkdir build_media && cd build_media \
&& cmake ../media-driver \
&& make -j$(nproc) \

Loading…
Cancel
Save