From 7e843808cae528d540000041480ff50e7d5d6b7b Mon Sep 17 00:00:00 2001 From: ghostwheel Date: Sun, 12 Mar 2023 22:49:04 -0600 Subject: [PATCH] Added map for audio stream, too It seems that if -map is used for video (-map 0:v:0) then a map is also needed for audio, otherwise no audio is produced. --- internal/ffmpeg/convert.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/ffmpeg/convert.go b/internal/ffmpeg/convert.go index 7bd41c19a..be29d8b32 100644 --- a/internal/ffmpeg/convert.go +++ b/internal/ffmpeg/convert.go @@ -51,6 +51,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc "-vf", format, "-c:v", string(encoder), "-map", "0:v:0", + "-map", "0:a", "-vsync", "vfr", "-r", "30", "-b:v", bitrate, @@ -68,6 +69,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc "-i", fileName, "-c:v", string(encoder), "-map", "0:v:0", + "-map", "0:a", "-c:a", "aac", "-vf", format, "-profile", "high", @@ -90,6 +92,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc "-vf", format, "-c:v", string(encoder), "-map", "0:v:0", + "-map", "0:a", "-vsync", "vfr", "-r", "30", "-b:v", bitrate, @@ -107,6 +110,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc "-pix_fmt", "yuv420p", "-c:v", string(encoder), "-map", "0:v:0", + "-map", "0:a", "-c:a", "aac", "-preset", "15", "-pixel_format", "yuv420p", @@ -133,6 +137,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc "-i", fileName, "-c:v", string(encoder), "-map", "0:v:0", + "-map", "0:a", "-c:a", "aac", "-vf", format, "-num_output_buffers", "72", @@ -154,6 +159,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc "-i", fileName, "-c:v", string(encoder), "-map", "0:v:0", + "-map", "0:a", "-c:a", "aac", "-vf", format, "-max_muxing_queue_size", "1024",