title: ffmpeg: converting to mp4 with error: unsupported codec
body: <p>i am converting a videofile with the latest version of ffmpeg in php:</p>
  
  <pre><code>exec("ffmpeg -y -i capture.wmv capture.mp4 2&gt;&amp;1", $output);
  var_dump($output);
  </code></pre>
  
  <p>This is the result:</p>
  
  <pre><code>array(21) {
    [0]=&gt;
    string(99) "FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.3, Copyright (c) 2000-2009 Fabrice Bellard, et al."
    [1]=&gt;
    string(451) "  configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static"
    [2]=&gt;
    string(35) "  libavutil     49.15. 0 / 49.15. 0"
    [3]=&gt;
    string(35) "  libavcodec    52.20. 1 / 52.20. 1"
    [4]=&gt;
    string(35) "  libavformat   52.31. 0 / 52.31. 0"
    [5]=&gt;
    string(35) "  libavdevice   52. 1. 0 / 52. 1. 0"
    [6]=&gt;
    string(35) "  libavfilter    0. 4. 0 /  0. 4. 0"
    [7]=&gt;
    string(35) "  libswscale     0. 7. 1 /  0. 7. 1"
    [8]=&gt;
    string(35) "  libpostproc   51. 2. 0 / 51. 2. 0"
    [9]=&gt;
    string(43) "  built on Jan 24 2013 19:42:59, gcc: 4.4.3"
    [10]=&gt;
    string(34) "Input #0, asf, from 'capture.wmv':"
    [11]=&gt;
    string(60) "  Duration: 00:04:11.45, start: 3.000000, bitrate: 1755 kb/s"
    [12]=&gt;
    string(62) "    Stream #0.0: Audio: wmav2, 44100 Hz, stereo, s16, 128 kb/s"
    [13]=&gt;
    string(82) "    Stream #0.1: Video: wmv2, yuv420p, 1280x720, 1600 kb/s, 1k tbr, 1k tbn, 1k tbc"
    [14]=&gt;
    string(33) "Output #0, mp4, to 'capture.mp4':"
    [15]=&gt;
    string(83) "    Stream #0.0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 200 kb/s, 90k tbn, 1k tbc"
    [16]=&gt;
    string(62) "    Stream #0.1: Audio: 0x0000, 44100 Hz, stereo, s16, 64 kb/s"
    [17]=&gt;
    string(15) "Stream mapping:"
    [18]=&gt;
    string(21) "  Stream #0.1 -&gt; #0.0"
    [19]=&gt;
    string(21) "  Stream #0.0 -&gt; #0.1"
    [20]=&gt;
    string(40) "Unsupported codec for output stream #0.1"
  }
  </code></pre>
  
  <p>I need a standard mp4-file for playing in web with html5. Where could be the problem? Is the codex not installed? Or is something wrong with the console command?</p>
  
  <p>EDIT:
  After using a static build i try to convert a wmv to mp4 with</p>
  
  <pre><code>exec("/www/htdocs/xxxx/video/ffmpeg -y -i capture.wmv capture.mp4 2&gt;&amp;1", $output);
  </code></pre>
  
  <p>The result file has a size of only some bytes - this is the output:</p>
  
  <pre><code>array(40) {
    [0]=&gt;
    string(77) "ffmpeg version N-49805-gfd6a021 Copyright (c) 2000-2013 the FFmpeg developers"
    [1]=&gt;
    string(61) "  built on Feb 11 2013 05:23:18 with gcc 4.6 (Debian 4.6.3-1)"
    [2]=&gt;
    string(609) "  configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx"
    [3]=&gt;
    string(40) "  libavutil      52. 17.101 / 52. 17.101"
    [4]=&gt;
    string(40) "  libavcodec     54. 91.102 / 54. 91.102"
    [5]=&gt;
    string(40) "  libavformat    54. 62.100 / 54. 62.100"
    [6]=&gt;
    string(40) "  libavdevice    54.  3.103 / 54.  3.103"
    [7]=&gt;
    string(40) "  libavfilter     3. 37.101 /  3. 37.101"
    [8]=&gt;
    string(40) "  libswscale      2.  2.100 /  2.  2.100"
    [9]=&gt;
    string(40) "  libswresample   0. 17.102 /  0. 17.102"
    [10]=&gt;
    string(40) "  libpostproc    52.  2.100 / 52.  2.100"
    [11]=&gt;
    string(54) "Guessed Channel Layout for  Input Stream #0.0 : stereo"
    [12]=&gt;
    string(34) "Input #0, asf, from 'capture.wmv':"
    [13]=&gt;
    string(11) "  Metadata:"
    [14]=&gt;
    string(32) "    WMFSDKNeeded    : 0.0.0.0000"
    [15]=&gt;
    string(32) "    DeviceConformanceTemplate: @"
    [16]=&gt;
    string(37) "    WMFSDKVersion   : 12.0.7601.17514"
    [17]=&gt;
    string(23) "    IsVBR           : 0"
    [18]=&gt;
    string(60) "  Duration: 00:04:13.40, start: 0.000000, bitrate: 1742 kb/s"
    [19]=&gt;
    string(90) "    Stream #0:0(ger): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 128 kb/s"
    [20]=&gt;
    string(125) "    Stream #0:1(ger): Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 1280x720, 1600 kb/s, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc"
    [21]=&gt;
    string(35) "[libx264 @ 0x2f082e0] using SAR=1/1"
    [22]=&gt;
    string(63) "[libx264 @ 0x2f082e0] MB rate (3600000) &gt; level limit (2073600)"
    [23]=&gt;
    string(88) "[libx264 @ 0x2f082e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX"
    [24]=&gt;
    string(45) "[libx264 @ 0x2f082e0] profile High, level 5.2"
    [25]=&gt;
    string(684) "[libx264 @ 0x2f082e0] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00"
    [26]=&gt;
    string(33) "Output #0, mp4, to 'capture.mp4':"
    [27]=&gt;
    string(11) "  Metadata:"
    [28]=&gt;
    string(32) "    WMFSDKNeeded    : 0.0.0.0000"
    [29]=&gt;
    string(32) "    DeviceConformanceTemplate: @"
    [30]=&gt;
    string(37) "    WMFSDKVersion   : 12.0.7601.17514"
    [31]=&gt;
    string(23) "    IsVBR           : 0"
    [32]=&gt;
    string(35) "    encoder         : Lavf54.62.100"
    [33]=&gt;
    string(122) "    Stream #0:0(ger): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 16k tbn, 1k tbc"
    [34]=&gt;
    string(90) "    Stream #0:1(ger): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s"
    [35]=&gt;
    string(15) "Stream mapping:"
    [36]=&gt;
    string(39) "  Stream #0:1 -&gt; #0:0 (wmv2 -&gt; libx264)"
    [37]=&gt;
    string(45) "  Stream #0:0 -&gt; #0:1 (wmav2 -&gt; libvo_aacenc)"
    [38]=&gt;
    string(31) "Press [q] to stop, [?] for help"
    [39]=&gt;
    string(96) "frame=  158 fps=0.0 q=33.0 size=       0kB time=00:00:00.10 bitrate=   3.6kbits/s dup=155 drop=0"
  }
  </code></pre>
  
  <p>slhck - thanks for your tipps - do you see the problem?</p>