Question

I am converting some input stream from my DVB S2 Card to RTMP.

Everything works fine after switching to recent avconv and x264 :)

The only thing I couldn't find out is, how do I select the right audio stream?

The source sometimes has up to 6 audio tracks. Avconv automatically chooses the one with the highest bitrate. However I want to select the "ger" one:

Here are the streams of ARTE german/french TV Channel for example:

Input #0, mpegts, from 'http://192.168.1.50:9981/stream/channelid/1035':
  Duration: N/A, start: 19083.694722, bitrate: 15576 kb/s
  Program 1
    Stream #0.0[0xa8], 127, 1/90000: Video: mpeg2video (Main), yuv420p, 544x576 [PAR 32:17 DAR 16:9], 1/50, 15000 kb/s, 25 fps, 90k tb50 tbc
    Stream #0.1[0x70](fre), 204, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0.2[0x71](ger), 207, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
    Stream #0.3[0x72](eng), 207, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
    Stream #0.4[0x73](qaa), 207, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 128 kb/s
  No Program
    Stream #0.5[0x3b], 126, 1/90000: Audio: mp1, 0 channels, s16p

libav Docs are really not that helpful. Who does now the right syntax?

EDIT: I found the -map option: http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20use%20-map%20option But it is not possible to map by name? Only by index?

Maybe I need to use avprobe then, to find the corrent stream index for "ger".

Was it helpful?

Solution

Indeed, you need to specify the stream by index with the -map option. The following worked in my case (I wanted to chose a lower-resolution stereo stream that had better channel separation instead of the higher-resolution 5.1 stream that didn't merge down as well).

In your case, the (ger) stream you want is "0.2", except avconv wants a colon separator, e.g.

avconv -i input.m4v -map 0:2 output.mp3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top