Skip to content

Commit dbcc464

Browse files
committed
- [+] add the -cfg wireframe
1 parent 526e910 commit dbcc464

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

config.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const progname = "ffcvt" // os.Args[0]
1717

1818
// The Options struct defines the structure to hold the commandline values
1919
type Options struct {
20+
Cfg string // cfg file to define your own targets: webm/wx/youtube etc
2021
Target string // target type: webm/x265-opus/x264-mp3/wx/youtube/copy
2122
Encoding // anonymous field to hold encoding values
2223
Directory string // directory that hold input files
@@ -60,6 +61,8 @@ var Opts Options
6061
func initVars() {
6162

6263
// set default values for command line parameters
64+
flag.StringVar(&Opts.Cfg, "cfg", "",
65+
"cfg file to define your own targets: webm/wx/youtube etc")
6366
flag.StringVar(&Opts.Target, "t", "webm",
6467
"target type: webm/x265-opus/x264-mp3/wx/youtube/copy")
6568
flag.StringVar(&Opts.VES, "ves", "",
@@ -151,6 +154,10 @@ func initVars() {
151154
func initVals() {
152155
exists := false
153156
// Now override those default values from environment variables
157+
if len(Opts.Cfg) == 0 ||
158+
len(os.Getenv("FFCVT_CFG")) != 0 {
159+
Opts.Cfg = os.Getenv("FFCVT_CFG")
160+
}
154161
if len(Opts.Target) == 0 ||
155162
len(os.Getenv("FFCVT_T")) != 0 {
156163
Opts.Target = os.Getenv("FFCVT_T")
@@ -293,7 +300,7 @@ func initVals() {
293300

294301
}
295302

296-
const usageSummary = " -t\ttarget type: webm/x265-opus/x264-mp3/wx/youtube/copy (FFCVT_T)\n -ves\tvideo encoding method set (FFCVT_VES)\n -aes\taudio encoding method set (FFCVT_AES)\n -ses\tsubtitle encoding method set (FFCVT_SES)\n -vep\tvideo encoding method prepend (FFCVT_VEP)\n -aep\taudio encoding method prepend (FFCVT_AEP)\n -sep\tsubtitle encoding method prepend (FFCVT_SEP)\n -vea\tvideo encoding method append (FFCVT_VEA)\n -aea\taudio encoding method append (FFCVT_AEA)\n -abr\taudio bitrate (64k for opus, 256k for mp3) (FFCVT_ABR)\n -crf\tthe CRF value: 0-51. Higher CRF gives lower quality\n\t (28 for x265, ~ 23 for x264) (FFCVT_CRF)\n\n -d\tdirectory that hold input files (FFCVT_D)\n -f\tinput file name (either -d or -f must be specified) (FFCVT_F)\n -sym\tsymlinks will be processed as well (FFCVT_SYM)\n -exts\textension list for all the files to be queued (FFCVT_EXTS)\n -suf\tsuffix to the output file names (FFCVT_SUF)\n -ext\textension for the output file (FFCVT_EXT)\n -w\twork directory that hold output files (FFCVT_W)\n\n -ac\tcopy audio codec (FFCVT_AC)\n -vc\tcopy video codec (FFCVT_VC)\n -an\tno audio, output video only (FFCVT_AN)\n -vn\tno video, output audio only (FFCVT_VN)\n -vss\tvideo: same size (FFCVT_VSS)\n -C,Cut\tCut segment(s) out to keep. Specify in the form of start-[end],\n\tstrictly in the format of hh:mm:ss, and may repeat (FFCVT_C,CUT)\n -S,Seg\tSplit video into multiple segments (strictly in format: hh:mm:ss) (FFCVT_S,SEG)\n -Speed\tSpeed up/down video playback speed (e.g. 1.28) (FFCVT_SPEED)\n -lang\tlanguage selection for audio stream extraction (FFCVT_LANG)\n -sel\tsubtitle encoding language (language picked for reencoded video) (FFCVT_SEL)\n -o\tmore options that will pass to ffmpeg program (FFCVT_O)\n -ato-opus\taudio encode to opus, using -abr (FFCVT_ATO_OPUS)\n -vto-x265\tvideo video encode to x265, using -crf (FFCVT_VTO_X265)\n\n -p\tpar2create, create par2 files (in work directory) (FFCVT_P)\n -nc\tno clobber, do not queue those already been converted (FFCVT_NC)\n -n\tno exec, dry run (FFCVT_N)\n\n -force\toverwrite any existing none-empty file (FFCVT_FORCE)\n -debug\tdebugging level (FFCVT_DEBUG)\n -ffmpeg\tffmpeg program executable name (FFCVT_FFMPEG)\n -ffprobe\tffprobe program execution (FFCVT_FFPROBE)\n -version\tprint version then exit (FFCVT_VERSION)\n\nDetails:\n\n"
303+
const usageSummary = " -cfg\tcfg file to define your own targets: webm/wx/youtube etc (FFCVT_CFG)\n -t\ttarget type: webm/x265-opus/x264-mp3/wx/youtube/copy (FFCVT_T)\n -ves\tvideo encoding method set (FFCVT_VES)\n -aes\taudio encoding method set (FFCVT_AES)\n -ses\tsubtitle encoding method set (FFCVT_SES)\n -vep\tvideo encoding method prepend (FFCVT_VEP)\n -aep\taudio encoding method prepend (FFCVT_AEP)\n -sep\tsubtitle encoding method prepend (FFCVT_SEP)\n -vea\tvideo encoding method append (FFCVT_VEA)\n -aea\taudio encoding method append (FFCVT_AEA)\n -abr\taudio bitrate (64k for opus, 256k for mp3) (FFCVT_ABR)\n -crf\tthe CRF value: 0-51. Higher CRF gives lower quality\n\t (28 for x265, ~ 23 for x264) (FFCVT_CRF)\n\n -d\tdirectory that hold input files (FFCVT_D)\n -f\tinput file name (either -d or -f must be specified) (FFCVT_F)\n -sym\tsymlinks will be processed as well (FFCVT_SYM)\n -exts\textension list for all the files to be queued (FFCVT_EXTS)\n -suf\tsuffix to the output file names (FFCVT_SUF)\n -ext\textension for the output file (FFCVT_EXT)\n -w\twork directory that hold output files (FFCVT_W)\n\n -ac\tcopy audio codec (FFCVT_AC)\n -vc\tcopy video codec (FFCVT_VC)\n -an\tno audio, output video only (FFCVT_AN)\n -vn\tno video, output audio only (FFCVT_VN)\n -vss\tvideo: same size (FFCVT_VSS)\n -C,Cut\tCut segment(s) out to keep. Specify in the form of start-[end],\n\tstrictly in the format of hh:mm:ss, and may repeat (FFCVT_C,CUT)\n -S,Seg\tSplit video into multiple segments (strictly in format: hh:mm:ss) (FFCVT_S,SEG)\n -Speed\tSpeed up/down video playback speed (e.g. 1.28) (FFCVT_SPEED)\n -lang\tlanguage selection for audio stream extraction (FFCVT_LANG)\n -sel\tsubtitle encoding language (language picked for reencoded video) (FFCVT_SEL)\n -o\tmore options that will pass to ffmpeg program (FFCVT_O)\n -ato-opus\taudio encode to opus, using -abr (FFCVT_ATO_OPUS)\n -vto-x265\tvideo video encode to x265, using -crf (FFCVT_VTO_X265)\n\n -p\tpar2create, create par2 files (in work directory) (FFCVT_P)\n -nc\tno clobber, do not queue those already been converted (FFCVT_NC)\n -n\tno exec, dry run (FFCVT_N)\n\n -force\toverwrite any existing none-empty file (FFCVT_FORCE)\n -debug\tdebugging level (FFCVT_DEBUG)\n -ffmpeg\tffmpeg program executable name (FFCVT_FFMPEG)\n -ffprobe\tffprobe program execution (FFCVT_FFPROBE)\n -version\tprint version then exit (FFCVT_VERSION)\n\nDetails:\n\n"
297304

298305
// Usage function shows help on commandline usage
299306
func Usage() {

ffcvt_cli.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ StructVar: Opts
2929
Options:
3030

3131
# Basic fields for encoding
32-
32+
33+
- Name: Cfg
34+
Type: string
35+
Flag: cfg
36+
Value: '""'
37+
Usage: "cfg file to define your own targets: webm/wx/youtube etc"
38+
3339
- Name: Target
3440
Type: string
3541
Flag: t

0 commit comments

Comments
 (0)