[libav-tools] How to use avconv merge video with multi-language audio and subtitile files

Janne Grunau janne-libav at jannau.net
Wed Jun 6 12:30:42 CEST 2012

On 2012-06-06 16:09:18 +0800, Dongsheng Song wrote:
> The avconv man page is not very clear: http://libav.org/avconv.html
> For example, if I have one video file and 2 languages audio and subtitle files:
> video.mp4 eng.aac eng.srt chi.aac chi.srt
> How can I merge these 5 files to one mkv file ?

specify all files as input files, avconv handles multiple -i parameters
you have map the stream via -map parameter since avconv will by default
just pick one stream of ech type. '-map 0 -map 1 -map 2 -map 3 -map 4'
before the output file in your example. set the codec to copy

> How can I mask which is the default audio and subtitle?

I think that's usually left as player decision, either via position or
language. You should set the language for the audio and subtitle
streams. '-metadata:s:1 laguage=eng' will set the language of the
second stream to english.

> Should I attach an Chinese font file to render chi.srt ?

I don't know what the conventions are, see help for -attach
on how to attach fonts.



More information about the libav-tools mailing list