Skip to content

Commit 2521f0f

Browse files
committed
- [+] implement karaoke option; close #31
1 parent 9124987 commit 2521f0f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

ffcvt.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ cut_ok:
198198
}
199199

200200
encodedExt = Opts.Ext
201+
if Opts.Karaoke && encodedExt == _encodedExt {
202+
encodedExt = "_karaoke.mp4"
203+
}
201204
// Sanity check
202205
if Opts.WDirectory != "" {
203206
// To error on the safe side -- when -d is not given but -f is,
@@ -435,6 +438,16 @@ func transcodeFile(inputName string) {
435438
args := []string{"-i", inputName}
436439
args = append(args, strings.Fields(Opts.OptExtra)...)
437440
args = encodeParametersS(encodeParametersA(encodeParametersV(args)))
441+
if Opts.Karaoke {
442+
args = append(args, "-filter_complex")
443+
args = append(args, "[0:1]pan=mono|c0=c0-c1[a]")
444+
args = append(args, "-map")
445+
args = append(args, "0:0")
446+
args = append(args, "-map")
447+
args = append(args, "[a]")
448+
args = append(args, "-map")
449+
args = append(args, "0:1")
450+
}
438451
if len(transpFrom) != 0 {
439452
args = append(args, "-af")
440453
af := fmt.Sprintf("atempo=%s/%s,asetrate=44100*%[2]s/%[1]s",

0 commit comments

Comments
 (0)