avconv can't convert stream to MP4 file, fails with "Unable to set encoding parameters"

5

2

I'm trying to script some testing of Wowza Media Server. Basically, I'm attempting to just beat the living bejeepers out of the thing. I have 5 slightly older computers, originally XP boxes, which I have installed Mint 15 on. I have a script that basically calls the file (or a symbolic link to the file) and takes it into avconv, then dumps it into null.

The idea here is that with 5 of these computers all starting a new thread every second, up to the max they can handle without freezing, we'll get a decent idea of what our current implementation can handle. The script I have works great, but only on some machines. The systems are all the same hardware, and I installed the same software on them in the beginning, although some of them may have had additional packages installed for various tasks since then. The command I issue in script is:

avconv version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2000-2013 the Libav developers
built on Mar 30 2013 22:20:06 with gcc 4.7.2
[h264 @ 0xd87ae0] mmco: unref short failure
[applehttp @ 0xd80d40] max_analyze_duration reached
[applehttp @ 0xd80d40] Estimating duration from bitrate, this may be inaccurate
Input #0, applehttp, from     'http://OUR_DOMAIN.com:1935/vod/_definst_/encode/video_file/00/00/00/12/13/mp4:TestFile.mp4/playlist.m3u8':
  Duration: 02:05:54.00, start: 27.728000, bitrate: N/A
    Stream #0.0: Data: [21][0][0][0] / 0x0015
    Metadata:
      variant_bitrate : 1610015
    Stream #0.1: Video: h264 (Main), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 23.98 tbr, 90k tbn, 47.95 tbc
    Metadata:
      variant_bitrate : 1610015
    Stream #0.2: Audio: aac, 48000 Hz, 5.1, s16
    Metadata:
      variant_bitrate : 1610015
[buffer @ 0x13e02c0] w:1280 h:720 pixfmt:yuv420p
[libvo_aacenc @ 0x12c49c0] Unable to set encoding parameters
Output #0, mp4, to '/dev/null':
    Stream #0.0: Video: mpeg4, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
    Metadata:
      variant_bitrate : 1610015
    Stream #0.1: Audio: libvo_aacenc, 48000 Hz, 5.1, s16, 200 kb/s
    Metadata:
      variant_bitrate : 1610015
Stream mapping:
  Stream #0:1 -> #0:0 (h264 -> mpeg4)
  Stream #0:2 -> #0:1 (aac -> libvo_aacenc)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

Any clues would be greatly appreciated. Thanks!

mikecole79

Posted 2013-09-02T15:57:13.960

Reputation: 61

Answers

9

The problem seems to be that your input is 5.1 and libvo_aacenc only supports stereo.

So either use a different encoder or downmix (-ac 2) or don't transcode audio at all (-c:a copy).

Anton Khirnov

Posted 2013-09-02T15:57:13.960

Reputation: 196

@slhck and Anton, can you suggest a 5.1 encoder? or a command to list them in ffmpeg? – jiggunjer – 2015-12-08T04:38:14.867

@jiggunjer The -encoders option lists all encoders. I would try to use libfdk_aac, which is one of the highest quality encoders with 5.1 support. (You may need to compile avconv/ffmpeg with libfdk support.) – slhck – 2015-12-09T09:35:06.393

@slhck Thanks. I won't be compiling it for my windows anytime soon, the configure/make toolchain gives me a headache. If only they knew cmake... – jiggunjer – 2015-12-10T00:58:25.507