4

Trying to convert an mkv file to avi:

 avconv -i 1.mkv ./converted/1.avi

Getting this output:

avconv version 0.8.1-4:0.8.1-0ubuntu1, Copyright (c) 2000-2011 the Libav developers
  built on Mar 22 2012 05:29:10 with gcc 4.6.3
[matroska,webm @ 0x8ba3aa0] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska,webm, from '1.mkv':
  Metadata:
    TITLE           : 
    ARTIST          : 
    COMPOSER        : 
    SYNOPSIS        : 
    DATE_RELEASED   : 
    GENRE           : 
  Duration: 00:07:48.54, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264 (Main), yuv420p, 1910x800 [PAR 1:1 DAR 191:80], 24 fps, 24 tbr, 1k tbn, 180k tbc (default)
    Stream #0.1: Audio: aac, 44100 Hz, stereo, s16 (default)
[buffer @ 0x8dcd160] w:1910 h:800 pixfmt:yuv420p
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 0x8f24540] invalid bit rate
Output #0, avi, to './converted/1.avi':
  Metadata:
    TITLE           : 
    ARTIST          : 
    COMPOSER        : 
    SYNOPSIS        : 
    DATE_RELEASED   : 
    GENRE           : 
    Stream #0.0(eng): Video: mpeg4, yuv420p, 1910x800 [PAR 1:1 DAR 191:80], q=2-31, 200 kb/s, 90k tbn, 24 tbc (default)
    Stream #0.1: Audio: ac3, 44100 Hz, stereo, flt, 200 kb/s (default)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (aac -> ac3)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

Google has turned up nothing.

sennett
  • 193

1 Answers1

3

First of all, try using another encoder rather than ac3. With your command, you're basically letting avconv decide on everything by its own. While this may be a bug (please file a report if it works in FFmpeg), you can probably circumvent it by specifying an encoder — I'd suggest MP3 if you have that linked to libav:

avconv -i 1.mkv -c:a libmp3lame ./converted/1.avi

Here's an indication for the error:

Incompatible sample format 's16' for codec 'ac3'

Maybe try forcing AC3 and maybe even specifying parameters like -b:a:

avconv -i 1.mkv -c:a ac3 ./converted/1.avi

You might also want to use proper options for the video stream too, rather than converting a (probably high quality) h.264 stream to plain MPEG-4. I'm pretty sure the result of your conversion will look bad if you don't.

slhck
  • 235,242