Open memob0x opened 6 years ago
@smblott-github the same question
I seem to remember that you can use the -map
flag to ffmpeg
to control which tracks are in the output.
Awesome! Thanks.
Should we add it to find or --help
>
Here is the command using ffmpeg
. It uses the -map
option to select the streams to copy. -map 0:v
selects all video streams. -map 0:a:0
selects the first audio stream, -map 0:a:1
the second audio stream etc.
So if you want the second audio stream you would use this:
$ ffmpeg -i inputfile.mkv -c copy -map 0:v -map 0:a:1 outputfile.mkv
the library castnow uses, stream-transcoder, saves custom parameters (e.g. those passed by castnow --ffmpeg) into a map keyed on the key name. This means that trying to pass a key with the same name will be overwritten; you can't pass -map twice.
I was able to hack it by editing plugins/transcode.js as follows
for (var key in opts) {
trans.custom(key, opts[key]);
}
trans.custom('map', '0:2');
trans.custom('map\0', '0:0');
var args = trans._compileArguments();
I'm not really a js guy so I can't make a decent patch to properly support this, but I figured I'd let others know the nature of the problem.
how do i switch audio track? i tried some --ffmpeg-metatadata commands with no luck...
Not too sure about it, but i think --tomp4 choose english by default, without --tomp4 it choose the first in the list.