This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options_video.go
38 lines (34 loc) · 1.6 KB
/
options_video.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package ffmpeg
import (
"fmt"
)
// FLAG SPEC ARGS AFFECTS IMPL
// hwaccel true [hwaccel] [input] [ ]
// hwaccel_device true [hwaccel_device] [input] [ ]
// r true [fps] [input output] [ ]
// s true [size] [input output] [X]
// pix_fmt true [format] [input output] [X]
// sws_flags false [flags] [input output] [ ]
// vframes false [number] [output] [ ]
// aspect true [aspect] [output] [ ]
// vn false [] [output] [ ]
// vcodec false [codec] [output] [ ]
// pass true [n] [output] [ ]
// passlogfile true [prefix] [output] [ ]
// vf false [filtergraph] [output] [ ]
// vtag false [fourcc/tag] [output] [ ]
// force_key_frames true [time[,time...]] [output] [ ]
// force_key_frames true [expr:expr] [output] [ ]
// copyinkf true [] [output] [ ]
func WithSize(stream StreamSpecifier, w, h int) FileOption {
return func(f *File) error {
f.options = append(f.options, []string{"-s" + stream.String(), fmt.Sprintf("%dx%d", w, h)}...)
return nil
}
}
func WithPixelFormat(stream StreamSpecifier, pf PixelFormat) FileOption {
return func(f *File) error {
f.options = append(f.options, []string{"-pix_fmt" + stream.String(), pf.String()}...)
return nil
}
}