fixed tight encoding & refactored video encoders

This commit is contained in:
amit bezalel
2018-02-10 02:01:19 +02:00
parent 88ff26e513
commit 5c4293d610
12 changed files with 154 additions and 147 deletions

View File

@@ -3,10 +3,10 @@ package main
import (
"image"
"os"
"path/filepath"
vnc "vnc2video"
"vnc2video/encoders"
"vnc2video/logger"
"path/filepath"
)
func main() {
@@ -34,12 +34,12 @@ func main() {
}
//launch video encoding process:
vcodec := &encoders.X264ImageEncoder{}
vcodec := &encoders.X264ImageEncoder{FFMpegBinPath: "./ffmpeg"}
//vcodec := &encoders.DV8ImageEncoder{}
//vcodec := &encoders.DV9ImageEncoder{}
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
logger.Tracef("current dir: %s", dir)
go vcodec.Run("./ffmpeg", "./output.mp4")
go vcodec.Run("./output.mp4")
screenImage := image.NewRGBA(image.Rect(0, 0, int(fbs.Width()), int(fbs.Height())))
for _, enc := range encs {
@@ -50,7 +50,6 @@ func main() {
}
}
msgReader := vnc.NewFBSPlayHelper(fbs)
//loop over all messages, feed images to video codec: