You've already forked VptPassiveAdapter
720p
This commit is contained in:
@@ -470,6 +470,26 @@ 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")
|
||||
defer span.End()
|
||||
ffmpegCmd := []string{
|
||||
FfmpegExec,
|
||||
"-hide_banner",
|
||||
"-y",
|
||||
"-i", inputFile,
|
||||
"-vf", "scale=-2:720",
|
||||
"-c:v", "libx264",
|
||||
"-preset", "fast",
|
||||
"-crf", "28",
|
||||
"-c:a", "aac",
|
||||
"-b:a", "128k",
|
||||
"-f", "mp4",
|
||||
outputFile,
|
||||
}
|
||||
return handleFfmpegProcess(subCtx, ffmpegCmd)
|
||||
}
|
||||
|
||||
func GetVideoCodec(ctx context.Context, filePath string) (string, error) {
|
||||
_, span := tracer.Start(ctx, "GetVideoCodec")
|
||||
defer span.End()
|
||||
|
||||
Reference in New Issue
Block a user