You've already forked VptPassiveAdapter
common p
This commit is contained in:
@@ -470,15 +470,17 @@ func handleFfmpegProcess(ctx context.Context, ffmpegCmd []string) (bool, error)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func CompressTo720p(ctx context.Context, inputFile, outputFile string) (bool, error) {
|
||||
subCtx, span := tracer.Start(ctx, "CompressTo720p")
|
||||
func CompressVideo(ctx context.Context, inputFile, outputFile string, height int) (bool, error) {
|
||||
subCtx, span := tracer.Start(ctx, "CompressVideo")
|
||||
defer span.End()
|
||||
span.SetAttributes(attribute.Int("height", height))
|
||||
scaleFilter := fmt.Sprintf("scale=-2:%d", height)
|
||||
ffmpegCmd := []string{
|
||||
FfmpegExec,
|
||||
"-hide_banner",
|
||||
"-y",
|
||||
"-i", inputFile,
|
||||
"-vf", "scale=-2:720",
|
||||
"-vf", scaleFilter,
|
||||
"-c:v", "libx264",
|
||||
"-preset", "fast",
|
||||
"-crf", "28",
|
||||
|
||||
Reference in New Issue
Block a user