Add video_codec.
This commit is contained in:
parent
37c4b45f2f
commit
466ce59e31
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
type FfmpegCli struct {
|
||||
path string
|
||||
videoCodec string
|
||||
}
|
||||
|
||||
func newFfmpegCli() *FfmpegCli {
|
||||
|
@ -43,10 +44,16 @@ func newFfmpegCli() *FfmpegCli {
|
|||
return nil
|
||||
}
|
||||
|
||||
log.Printf("Found executable worker: ffmpeg (%s)\n", strings.Split(string(version), "\n")[0])
|
||||
codec := utils.EnvVideoCodec.GetValue()
|
||||
if codec == "" {
|
||||
codec = "h264"
|
||||
}
|
||||
|
||||
log.Printf("Found executable worker: ffmpeg (%s) with codec %q\n", strings.Split(string(version), "\n")[0], codec)
|
||||
|
||||
return &FfmpegCli{
|
||||
path: path,
|
||||
videoCodec: codec,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +65,7 @@ func (worker *FfmpegCli) EncodeMp4(inputPath string, outputPath string) error {
|
|||
args := []string{
|
||||
"-i",
|
||||
inputPath,
|
||||
"-vcodec", "h264",
|
||||
"-vcodec", worker.videoCodec,
|
||||
"-acodec", "aac",
|
||||
"-vf", "scale='min(1080,iw)':'min(1080,ih)':force_original_aspect_ratio=decrease:force_divisible_by=2",
|
||||
"-movflags", "+faststart+use_metadata_tags",
|
||||
|
|
|
@ -38,6 +38,7 @@ const (
|
|||
EnvDisableFaceRecognition EnvironmentVariable = "PHOTOVIEW_DISABLE_FACE_RECOGNITION"
|
||||
EnvDisableVideoEncoding EnvironmentVariable = "PHOTOVIEW_DISABLE_VIDEO_ENCODING"
|
||||
EnvDisableRawProcessing EnvironmentVariable = "PHOTOVIEW_DISABLE_RAW_PROCESSING"
|
||||
EnvVideoCodec EnvironmentVariable = "PHOTOVIEW_VIDEO_CODEC"
|
||||
)
|
||||
|
||||
// GetName returns the name of the environment variable itself
|
||||
|
|
Loading…
Reference in New Issue