LIBFAAC не может пересчитать каналы

1593
Jimmery

Я использую avconvдля преобразования видео файлов в MP4, но всякий раз, когда я пытаюсь кодировать файлы с 6 или 8 каналов в 2 канала, libfaacя получаю следующие сообщения об ошибках:

Can not resample 8 channels @ 44100 Hz to 2 channels @ 44100 Hz 

( РЕДАКТИРОВАТЬ : полный вывод сообщений можно найти здесь: http://pastebin.com/UXGrBy1D )

Вот кодеки, для которых мы установили avconv: http://pastebin.com/hyQrqXqW

И это команда, которую я запускаю:

avconv -y -i input.mp4 -vcodec libx264 -bufsize 20M -maxrate 4000k -threads 12 -same_quant -acodec libfaac -ac 2 -ar 44100 -ab 128k output.mp4 

Я делаю что-то неправильно?

Или, есть ли альтернативы, libfaacкоторые будут повторно сэмплировать 8 каналов в 2 канала?

Я должен быть в состоянии сделать это из командной строки на моем сервере Ubuntu 12.04.

2
Хорошо, что говорит ошибка: он не может автоматически микшировать каналы. Возможно, вам придется сделать это, извлекая исходное аудио, микшируя его с помощью `sox` или подобного, а затем мультиплексируя это с закодированным видео. Можем ли мы увидеть ваш полный, неразрезанный вывод командной строки из `avconv`, пожалуйста? slhck 11 лет назад 0
Конечно, посмотрите на мои изменения. Неразрезанный вывод довольно большой, хотя! Jimmery 11 лет назад 0
Спасибо! Не могли бы вы объяснить, чего вам нужно достичь? Уменьшение размера файла? Совместимость с каким-то устройством? Относительно того, почему `-same_quant` не следует использовать, см .: [sameq не означает" то же качество "(http://superuser.com/questions/478549/what-is-the-sameq-option-in-ffmpeg -does-это среднеквадратичное же качества). slhck 11 лет назад 0

1 ответ на вопрос

4
evilsoup

First of all, if you haven't already done so, check out this ffmpeg h.264 encoding guide - it applies to avconv as well, just change every instance of ffmpeg to avconv. Also, consider upgrading to a more recent version of avconv or ffmpeg - since you're on Ubuntu, you could use this PPA, or compile it yourself (this last option will give you access to fdk_aac, which is a much better AAC encoder than FAAC).

Unless you know exactly what you're doing & have a specific reason, you probably shouldn't use -bufsize 20M -maxrate 4000k -threads 12 -same_quant. In fact, going by the input in that pastebin, you should probably just use -codec:v copy, which won't touch the video stream.

As for your stated problem... I don't think libfaac is your problem. Look here (from your pastebin):

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from \'/var/www/up/up50eefce404e4f.mp4\': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isomavc1mp42 creation_time : 2007-12-08 19:28:08 Duration: 00:46:47.64, start: 0.000000, bitrate: 308 kb/s Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 111 kb/s Metadata: creation_time : 2007-12-08 19:28:08 Stream #0.1(und): Video: h264 (Baseline), yuv420p, 320x240 [PAR 1:1 DAR 4:3], 195 kb/s, 11.99 fps, 11.99 tbr, 11988 tbn, 23976 tbc Metadata: creation_time : 2007-12-08 19:28:11 

FFmpeg thinks your input audio is stereo. Much later on:

Input stream #0:0 frame changed from rate:44100 fmt:s16 ch:2 to rate:44100 fmt:s16 ch:8 Resampling output channel count must be 1 or 2 for mono input; 1, 2 or 6 for stereo input; or N for N channel input. Can not resample 8 channels @ 44100 Hz to 2 channels @ 44100 Hz 

The video stream is also throwing up a hell of a lot of errors. I suspect that your input may be corrupted.

It's possible that the following command will work:

avconv -ac 8 -i input.mp4 -c:v copy -c:a libfaac -b:a 128k -ac 2 output.mp4 

-ac sets the number of audio channels: if the AAC stream isn't corrupted, it's possible that the container format is just providing incorrect data to avconv, and putting -ac 8 before the input overrides the setting provided by the MP4 container (and putting -ac 2 before the output tells ffmpeg to output to 2 audio channels).

большое спасибо за вашу помощь! Jimmery 11 лет назад 0

Похожие вопросы