mirror of
https://github.com/alfg/ffmpegd.git
synced 2025-09-26 19:41:15 +08:00
feat: add gopsize option
This commit is contained in:
@@ -24,9 +24,9 @@ const (
|
||||
██╔══╝ ██╔══╝ ██║╚██╔╝██║██╔═══╝ ██╔══╝ ██║ ██║██║ ██║
|
||||
██║ ██║ ██║ ╚═╝ ██║██║ ███████╗╚██████╔╝██████╔╝
|
||||
╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═════╝
|
||||
v0.0.8
|
||||
v0.1.0
|
||||
`
|
||||
version = "ffmpegd version 0.0.8"
|
||||
version = "ffmpegd version 0.1.0"
|
||||
description = "[\u001b[32mffmpegd\u001b[0m] - websocket server for \u001b[33mffmpeg-commander\u001b[0m.\n"
|
||||
usage = `
|
||||
Usage:
|
||||
@@ -191,7 +191,9 @@ func handleFiles(w http.ResponseWriter, r *http.Request) {
|
||||
Files: []file{},
|
||||
}
|
||||
|
||||
files, _ := ioutil.ReadDir(cleanPath(prefix))
|
||||
base, _ := filepath.Abs(".")
|
||||
cleaned := filepath.Join(base, cleanPath(prefix))
|
||||
files, _ := ioutil.ReadDir(cleaned)
|
||||
for _, f := range files {
|
||||
if f.IsDir() {
|
||||
if prefix == "." {
|
||||
|
@@ -70,6 +70,7 @@ type videoOptions struct {
|
||||
MinRate string `json:"minrate"`
|
||||
MaxRate string `json:"maxrate"`
|
||||
BufSize string `json:"bufsize"`
|
||||
GopSize string `json:"gopsize"`
|
||||
PixelFormat string `json:"pixel_format"`
|
||||
FrameRate string `json:"frame_rate"`
|
||||
Speed string `json:"speed"`
|
||||
@@ -335,6 +336,11 @@ func setVideoFlags(opt videoOptions) []string {
|
||||
args = append(args, []string{"-bufsize", opt.BufSize}...)
|
||||
}
|
||||
|
||||
// GOP size.
|
||||
if opt.GopSize != "" && opt.GopSize != "0" {
|
||||
args = append(args, []string{"-g", opt.GopSize}...)
|
||||
}
|
||||
|
||||
// Pixel Format.
|
||||
if opt.PixelFormat != "" && opt.PixelFormat != "auto" {
|
||||
args = append(args, []string{"-pix_fmt", opt.PixelFormat}...)
|
||||
|
Reference in New Issue
Block a user