Add pix_fmt argument to ffmpeg decoder
This commit is contained in:
parent
8c6e604f26
commit
fede9f9005
|
@ -22,21 +22,34 @@ func NewDecoder(r io.Reader, settings map[string]any) (d *Decoder, err error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
pixelFormat := utilities.GetSettingString(settings, "pix_fmt", "")
|
||||
|
||||
ffmpegBinary := "ffmpeg"
|
||||
if p := os.Getenv("FFMPEG_PATH"); p != "" {
|
||||
ffmpegBinary = p
|
||||
}
|
||||
|
||||
cmd := exec.Command(ffmpegBinary,
|
||||
//"-v", "quiet",
|
||||
args := []string{
|
||||
"-v", "quiet",
|
||||
"-probesize", "8192",
|
||||
"-strict", "experimental",
|
||||
"-i", "pipe:",
|
||||
"-map_metadata", "-1",
|
||||
"-map", fmt.Sprintf("0:v:%d", videoIndex),
|
||||
}
|
||||
|
||||
if pixelFormat != "" {
|
||||
args = append(args, "-pix_fmt:v", pixelFormat)
|
||||
}
|
||||
|
||||
args = append(args, []string{
|
||||
"-f", "yuv4mpegpipe",
|
||||
"-strict", "experimental",
|
||||
"pipe:",
|
||||
}...)
|
||||
|
||||
cmd := exec.Command(ffmpegBinary,
|
||||
args...,
|
||||
)
|
||||
|
||||
cmdIn, err := cmd.StdinPipe()
|
||||
|
|
Loading…
Reference in a new issue