1

I am trying to transcode tv streams but with only the english audio stream included. I have tried using the -map 0:m:language:eng stream specifier, but I get:

"Automatic encoder selection failed for output stream #0:3. Default encoder for format mpegts (codec none) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:3"

This is despite including an encoder. I have tried all sorts of variations on this theme without success.

Full output for one attempt is below:

ffmpeg -i http://192.168.1.74:8001/1:0:1:189E:7FD:2:11A0000:0:0:0: -ignore_unknown -map 0:a -map 0:m:language:eng -map 0:v -acodec aac -vcodec libx264 -b:v 1100000 -t 00:00:30 "somethin.ts" 2>output.txt

    Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 03db7b60] Could not find codec parameters for stream 17 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 03db7b60] Could not find codec parameters for stream 18 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'http://192.168.1.74:8001/1:0:1:189E:7FD:2:11A0000:0:0:0:':
  Duration: N/A, start: 23690.732933, bitrate: N/A
  Program 6321 
  Program 6322 
  Program 6338 
  Program 6301 
  Program 6302 
    Stream #0:0[0x13ec]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x13ee](NAR): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 224 kb/s
    Stream #0:2[0x13ed](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 224 kb/s
    Stream #0:3[0x13ef](eng,eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:4[0x13f0](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:5[0xf04]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:6[0xf03]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:7[0xf02]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:8[0xf01]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:9[0xf00]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:10[0x92a]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:11[0x913]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:12[0x912]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:13[0x911]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:14[0x919]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:15[0xf09]: Unknown: none ([11][0][0][0] / 0x000B)
    Stream #0:16[0xf08]: Unknown: none ([11][0][0][0] / 0x000B)
    Stream #0:17[0xf07]: Unknown: none ([11][0][0][0] / 0x000B)
    Stream #0:18[0xf06]: Unknown: none ([11][0][0][0] / 0x000B)
  Program 6318 
  Program 6390 
  Program 6391 
  Program 6351 
  Program 6361 
  Program 6306 
  Program 6341 
Automatic encoder selection failed for output stream #0:3. Default encoder for format mpegts (codec none) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:3

Any ideas on how to do this. I cant specify streams by number as I want to use it for lots of tv streams and the order is often different.

Thanks

Firoz Memon
  • 4,282
  • 3
  • 22
  • 32
jdauthre
  • 21
  • 1
  • 3

1 Answers1

0

Output stream 0:3 is a image-based subtitle stream. Since you've not specified an encoder for subtitles, ffmpeg is trying to pick one and fails since it doesn't have an image-based subtitle encoder. You can copy or drop the stream.

ffmpeg -i http://192.168.1.74:8001/1:0:1:189E:7FD:2:11A0000:0:0:0: -ignore_unknown -c copy -map 0:a -map 0:m:language:eng -map 0:v -acodec aac -vcodec libx264 -b:v 1100000 -t 00:00:30 "somethin.ts" 2>output.txt

Of course, your primary aim is to map only the audio stream by language. Your command will map the video twice, as it is tagged as English.

To avoid this, you can use two ffmpeg commands:

ffmpeg -i http://192.168.1.74:8001/1:0:1:189E:7FD:2:11A0000:0:0:0: -ignore_unknown -c copy -map 0:v:0 -map 0:m:language:eng -f mpegts - | ffmpeg -f mpegts -i - -map 0:v:0 -map 0:a:0 -c:a aac -c:v libx264 -b:v 1.1M out.ts
Gyan
  • 85,394
  • 9
  • 169
  • 201
  • Thanks the second suggestion worked perfectly, I have simplified it a little into one ffmpeg command : *ffmpeg -i http://192.168.1.74:8001/1:0:1:189E:7FD:2:11A0000:0:0:0: -ignore_unknown -c copy -sn -map 0:v:0 -map 0:m:language:eng -acodec aac -vcodec libx264 -f mpegts -t 00:01:00 -b:v 1.1M output.ts – jdauthre Oct 16 '17 at 17:52
  • This will duplicate the video stream (and almost double size of output) if your input video is tagged with `eng`. – Gyan Oct 16 '17 at 18:00
  • In the samples I have tried this hasnt been the case, but thanks I will bear this in mind. I think the video isn't routinely tagged as eng, although I am not fully sure about stream tags, am I right to assume the tag is just the text you get when ffmpeg lists the streams when running – jdauthre Oct 16 '17 at 18:36