Add auto transcoding to JPEG snapshot

This commit is contained in:
Alexey Khit
2023-05-03 07:49:48 +03:00
parent e78f9fa69d
commit 4656086985
4 changed files with 137 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
package ffmpeg
import (
"bytes"
"os/exec"
)
func TranscodeToJPEG(b []byte) ([]byte, error) {
cmd := exec.Command("ffmpeg", "-hide_banner", "-i", "-", "-f", "mjpeg", "-")
cmd.Stdin = bytes.NewBuffer(b)
return cmd.Output()
}