Fix audio codec error with ffmpeg

1

I had an AVI (XVid) file with 2 audio channels. I removed the FIRST audio channel using ffmpeg as:

ffmpeg -i <input.avi> -acodec copy -vcodec copy -map 0:0 -map 0:2 <output.avi>

Now, VLC can play the video, with the correct audio, BUT, no other media player does. I checked with the avidemux and then I found that the audio codec is set as "Unknown".

The original audio codec was AC3/48000Hz and 6 channels. I believe that the only problem is that this information is not written in the file (since VLC identifies the problem and plays the file correctly).

ffmpeg output is:

Input #0, avi, from 'output.avi':
   Metadata:
   encoder         : Lavf55.12.100
   Duration: 01:24:46.68, start: 0.000000, bitrate: 1703 kb/s
      Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x432 [SAR 1:1 DAR 5:3], 25 fps, 25 tbr, 25 tbn, 30k tbc
      Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 384 kb/s

How can I fix that?

Peter

Posted 2013-09-21T15:42:46.917

Reputation: 279

Are you sure that the other players can in fact play AC3 audio streams at all? (Which ones have you been trying?) – slhck – 2013-09-21T17:36:52.763

As I said, Yes. VLC on Windows 7 as well as MPlayer on Linux. So, yes, generally, players CAN play the audio. Having said that, an older version of VLC said that it cannot play the "undef" audio. – Peter – 2013-09-23T13:16:07.427

No answers