Update convert.go

When I upgraded my phone to the Google Pixel 7, I noticed that the videos it takes have an extra video stream in them for their compressed HVC1 implementation. This means that all software transcoding of that format would fail, as it was transcoding the wrong video stream. This alteration fixed the issue for me, and will likely avoid video files with multiple video streams causing issues in the future.
This commit is contained in:
Micah 2023-03-01 20:30:45 -06:00 committed by Michael Mayer
parent de54be541c
commit 240393d8b6

View file

@ -50,6 +50,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc
"-c:a", "aac",
"-vf", format,
"-c:v", string(encoder),
"-map", "0:v:0",
"-vsync", "vfr",
"-r", "30",
"-b:v", bitrate,
@ -66,6 +67,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc
ffmpegBin,
"-i", fileName,
"-c:v", string(encoder),
"-map", "0:v:0",
"-c:a", "aac",
"-vf", format,
"-profile", "high",
@ -87,6 +89,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc
"-c:a", "aac",
"-vf", format,
"-c:v", string(encoder),
"-map", "0:v:0",
"-vsync", "vfr",
"-r", "30",
"-b:v", bitrate,
@ -103,6 +106,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc
"-i", fileName,
"-pix_fmt", "yuv420p",
"-c:v", string(encoder),
"-map", "0:v:0",
"-c:a", "aac",
"-preset", "15",
"-pixel_format", "yuv420p",
@ -128,6 +132,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc
ffmpegBin,
"-i", fileName,
"-c:v", string(encoder),
"-map", "0:v:0",
"-c:a", "aac",
"-vf", format,
"-num_output_buffers", "72",
@ -148,6 +153,7 @@ func AvcConvertCommand(fileName, avcName, ffmpegBin, bitrate string, encoder Avc
ffmpegBin,
"-i", fileName,
"-c:v", string(encoder),
"-map", "0:v:0",
"-c:a", "aac",
"-vf", format,
"-max_muxing_queue_size", "1024",