From d52a120fa6be9f92b8bd4e7d43c747d6dbf31482 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Tue, 9 Jun 2020 23:35:40 -0700 Subject: [PATCH] Add resizing to video processing --- Dockerfile | 1 - README.md | 2 -- ffmpeg.go | 4 +++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 387bd2c1c..ca4ba6ddb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,5 @@ ADD . /app WORKDIR /app RUN apk add --no-cache ffmpeg ffmpeg-libs RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o owncast . -RUN ls -al owncast WORKDIR /app CMD ["/app/owncast"] \ No newline at end of file diff --git a/README.md b/README.md index 40be713eb..601658343 100644 --- a/README.md +++ b/README.md @@ -173,8 +173,6 @@ The following is a list of things, as long as there's some traction, I'd like to * Add built-in Let's Encrypt support so SSL is enabled out of the box. -* Add a Dockerfile so you can run it from a container. - ## License diff --git a/ffmpeg.go b/ffmpeg.go index ed0c666c4..f886a0292 100644 --- a/ffmpeg.go +++ b/ffmpeg.go @@ -42,7 +42,9 @@ func startFfmpeg(configuration Config) { ffmpegFlags := []string{ "-hide_banner", "-i pipe:", - strings.Join(videoMaps, " "), // All the different video variants + "-vf scale=900:-2", + "-sws_flags fast_bilinear", + strings.Join(videoMaps, " "), // All the different video variants strings.Join(audioMaps, " ") + " -c:a copy", // Audio for all the variants // strings.Join(audioMaps, " ") + " -c:a aac -b:a 192k -ac 2", // Audio for all the variants "-master_pl_name stream.m3u8",