This commit is contained in:
Matt
2022-07-08 15:06:47 +10:00
committed by GitHub
4 changed files with 10 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
package encoders package encoders
import ( import (
"fmt"
"image" "image"
"io" "io"
"os" "os"
@@ -25,13 +26,12 @@ func (enc *VP8ImageEncoder) Init(videoFileName string) {
if !strings.HasSuffix(videoFileName, fileExt) { if !strings.HasSuffix(videoFileName, fileExt) {
videoFileName = videoFileName + fileExt videoFileName = videoFileName + fileExt
} }
binary := "./ffmpeg" cmd := exec.Command(enc.FFMpegBinPath,
cmd := exec.Command(binary,
"-f", "image2pipe", "-f", "image2pipe",
"-vcodec", "ppm", "-vcodec", "ppm",
//"-r", strconv.Itoa(framerate), //"-r", strconv.Itoa(framerate),
"-vsync", "2", "-vsync", "2",
"-r", "5", "-r", fmt.Sprint(enc.Framerate),
"-probesize", "10000000", "-probesize", "10000000",
"-an", //no audio "-an", //no audio
//"-vsync", "2", //"-vsync", "2",

View File

@@ -1,6 +1,7 @@
package encoders package encoders
import ( import (
"fmt"
"image" "image"
"io" "io"
"os" "os"
@@ -24,12 +25,11 @@ func (enc *DV9ImageEncoder) Init(videoFileName string) {
if !strings.HasSuffix(videoFileName, fileExt) { if !strings.HasSuffix(videoFileName, fileExt) {
videoFileName = videoFileName + fileExt videoFileName = videoFileName + fileExt
} }
binary := "./ffmpeg" cmd := exec.Command(enc.FFMpegBinPath,
cmd := exec.Command(binary,
"-f", "image2pipe", "-f", "image2pipe",
"-vcodec", "ppm", "-vcodec", "ppm",
//"-r", strconv.Itoa(framerate), //"-r", strconv.Itoa(framerate),
"-r", "5", "-r", fmt.Sprint(enc.Framerate),
//"-i", "pipe:0", //"-i", "pipe:0",
"-i", "-", "-i", "-",
"-vcodec", "libvpx-vp9", //"libvpx",//"libvpx-vp9"//"libx264" "-vcodec", "libvpx-vp9", //"libvpx",//"libvpx-vp9"//"libx264"

View File

@@ -2,6 +2,7 @@ package encoders
import ( import (
"errors" "errors"
"fmt"
"image" "image"
"io" "io"
"os" "os"
@@ -33,7 +34,7 @@ func (enc *HuffYuvImageEncoder) Init(videoFileName string) {
"-f", "image2pipe", "-f", "image2pipe",
"-vcodec", "ppm", "-vcodec", "ppm",
//"-r", strconv.Itoa(framerate), //"-r", strconv.Itoa(framerate),
"-r", "12", "-r", fmt.Sprint(enc.Framerate),
//"-re", //"-re",
//"-i", "pipe:0", //"-i", "pipe:0",

View File

@@ -3,6 +3,7 @@ package encoders
import ( import (
"errors" "errors"
"image" "image"
"fmt"
"io" "io"
"os" "os"
"os/exec" "os/exec"
@@ -32,7 +33,7 @@ func (enc *QTRLEImageEncoder) Init(videoFileName string) {
"-f", "image2pipe", "-f", "image2pipe",
"-vcodec", "ppm", "-vcodec", "ppm",
//"-r", strconv.Itoa(framerate), //"-r", strconv.Itoa(framerate),
"-r", "12", "-r", fmt.Sprint(enc.Framerate),
//"-re", //"-re",
//"-i", "pipe:0", //"-i", "pipe:0",