I think it is specific to the source having aac audio track. I have other mp4 files with multiple audio tracks that are all 2 channel and they appear to work.
I tried creating two new mp4's from my source movie.mp4 and copying the aac stream to one and the ac3 stream to the other.
I wound up with movie1.mp4 with these streams, and it errors out when trying to encode it with or without -ac 2.
- Code:
Stream #0.0(und): Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 6026 kb/s, 23.98 fps, 23.98 tbr, 48k tbn, 47.95 tbc
Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1, s16, 319 kb/s
[wmv2 @ 032b02b0]impossible bitrate constraints, this will fail
Output #0, asf, to 'C:\Windows\TEMP\Serviio\transcoding-temp-33-ASF.stftemp-33-ASF.stf':
Metadata:
WM/EncodingSettings: Lavf52.62.0
Stream #0.0(und): Video: wmv2, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 1800 kb/s, 1k tbn, 23.98 tbc
Stream #0.1(eng): Audio: wmav2, 48000 Hz, 2 channels, s16, 192 kb/s
ffmpeg without the -ac 2 option
- Code:
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
ffmpeg with the -ac 2 option
- Code:
Resampling with input channels greater than 2 unsupported.
Can not resample 6 channels @ 48000 Hz to 2 channels @ 48000 Hz
movie2.mp4 that has ac3 audio track works fine. However it lists as 2 channel in the source stream even though I used -acodec copy to create it (and the transcode flew by at over 1000fps.) I suspect that since the transcode works with both audio tracks in the original source when I added the -map options that it would still work if this was correctly listed at 6 channel.
- Code:
Stream #0.0(und): Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 6026 kb/s, 23.98 fps, 23.98 tbr, 48k tbn, 47.95 tbc
Stream #0.1(eng): Audio: ac3, 48000 Hz, 2 channels, s16, 640 kb/s
[wmv2 @ 00feff10]impossible bitrate constraints, this will fail
Output #0, asf, to 'C:\Windows\TEMP\Serviio\transcoding-temp-33-ASF.stftemp-33-ASF.stf':
Metadata:
WM/EncodingSettings: Lavf52.62.0
Stream #0.0(und): Video: wmv2, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 1800 kb/s, 1k tbn, 23.98 tbc
Stream #0.1(eng): Audio: wmav2, 48000 Hz, 2 channels, s16, 192 kb/s
My conclusion is that ffmpeg doesn't appear to work right with aac audio tracks, and it is defaulting to that stream even though it is stream #2. The reason my mp4 files have both ac3 and aac streams is because they are originally encoded to play native on ps3, which works with the aac stream but not the ac3 stream. ac3 stream works in other software. Obviously if I remove the ac3 stream and only have the aac stream the transcode will fail, so having the ac3 stream isn't harming it any.
My goal is to transcode to a format the xbox 360 can support, but I'm not sure how to accomplish this without somehow convincing ffmpeg to use the ac3 stream to transcode.