{"id":4662,"date":"2014-03-30T14:21:51","date_gmt":"2014-03-30T14:21:51","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/no-audio-on-windows-media-player-when-converting-uncompressed-video-to-mp4-with-aac-using-ffmpeg-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:21:51","modified_gmt":"2014-03-30T14:21:51","slug":"no-audio-on-windows-media-player-when-converting-uncompressed-video-to-mp4-with-aac-using-ffmpeg-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/no-audio-on-windows-media-player-when-converting-uncompressed-video-to-mp4-with-aac-using-ffmpeg-collection-of-common-programming-errors\/","title":{"rendered":"No Audio on Windows Media PLayer When Converting Uncompressed Video to MP4 with AAC using ffmpeg-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/636bec3398ab7aa3d5c6eeaee1a1350a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDominic P<\/p>\n<p>I&#8217;m having problems converting uncompressed video to mp4 format using AAC for the audio. I don&#8217;t get any errors, but no audio plays with the video in the output files in Windows Media PLayer (other players handle it fine, but normally WMP doesn&#8217;t have an issue with my other MP4&#8217;s so I still feel like something&#8217;s wrong here). Here is my full command:<\/p>\n<p><code>ffmpeg -i uncompressed.avi -s 426x240 -pix_fmt yuv420p -c:v libx264 -preset:v veryslow -profile:v main -crf:v 27 -movflags +faststart -c:a libfdk_aac -b:a 128k -t 00:00:10 output.mp4<\/code><\/p>\n<p>And the output:<\/p>\n<pre><code>ffmpeg version N-55064-g3cd8aaa Copyright (c) 2000-2013 the FFmpeg developers\n  built on Jul 29 2013 12:59:12 with gcc 4.8.0 (GCC)\n  configuration: --arch=x86_64 --target-os=mingw32 --cross-prefix=\/home\/dominic\/GitHub\/ffmpeg-windows-build-helpers\/sandbox\/mingw-w64-x86_64\/bin\/x86_64-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libsoxr --enable-libx264 --enable-avisynth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfig --enable-libass --enable-libutvideo --enable-libopus --disable-w32threads --enable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libbluray --enable-libvpx --enable-libilbc --enable-static --disable-shared --enable-nonfree --enable-libfdk-aac --enable-runtime-cpudetect\n  libavutil      52. 40.100 \/ 52. 40.100\n  libavcodec     55. 19.100 \/ 55. 19.100\n  libavformat    55. 12.102 \/ 55. 12.102\n  libavdevice    55.  3.100 \/ 55.  3.100\n  libavfilter     3. 81.103 \/  3. 81.103\n  libswscale      2.  4.100 \/  2.  4.100\n  libswresample   0. 17.103 \/  0. 17.103\n  libpostproc    52.  3.100 \/ 52.  3.100\nGuessed Channel Layout for  Input Stream #0.1 : stereo\nInput #0, avi, from 'uncompressed.avi':\n  Metadata:\n    date            : 2012-04-16T16:02:12.00409-07:00\n  Duration: 00:02:22.93, start: 0.000000, bitrate: 1199367 kb\/s\n    Stream #0:0: Video: rawvideo, bgr24, 1920x1080, 23.98 tbr, 23.98 tbn, 23.98 tbc\n    Stream #0:1: Audio: pcm_f32le ([3][0][0][0] \/ 0x0003), 96000 Hz, stereo, flt, 6144 kb\/s\n[libx264 @ 000000000038f580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2\n[libx264 @ 000000000038f580] profile Main, level 2.2\n[libx264 @ 000000000038f580] 264 - core 133 r2339 585324f - H.264\/MPEG-4 AVC codec - Copyleft 2003-2013 - http:\/\/www.videolan.org\/x264.html - options: cabac=1 ref=16 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=27.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00\nOutput #0, mp4, to 'output.mp4':\n  Metadata:\n    date            : 2012-04-16T16:02:12.00409-07:00\n    encoder         : Lavf55.12.102\n    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] \/ 0x0021), yuv420p, 426x240, q=-1--1, 24k tbn, 23.98 tbc\n    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] \/ 0x0040), 96000 Hz, stereo, s16, 128 kb\/s\nStream mapping:\n  Stream #0:0 -&gt; #0:0 (rawvideo -&gt; libx264)\n  Stream #0:1 -&gt; #0:1 (pcm_f32le -&gt; libfdk_aac)\nPress [q] to stop, [?] for help\nframe=   53 fps=0.0 q=0.0 size=       0kB time=00:00:02.84 bitrate=   0.1kbits\/s    \nframe=   98 fps= 97 q=32.0 size=      23kB time=00:00:04.76 bitrate=  38.8kbits\/s    \nframe=  151 fps=100 q=32.0 size=      64kB time=00:00:06.68 bitrate=  78.5kbits\/s    \nframe=  200 fps= 99 q=32.0 size=     105kB time=00:00:08.60 bitrate=  99.7kbits\/s    \n[mp4 @ 00000000023d8e20] Starting second pass: moving header on top of the file\nframe=  240 fps= 87 q=-1.0 Lsize=     244kB time=00:00:10.00 bitrate= 199.8kbits\/s    \n\nvideo:77kB audio:157kB subtitle:0 global headers:0kB muxing overhead 4.142690%\n[libx264 @ 000000000038f580] frame I:2     Avg QP:24.64  size:  8447\n[libx264 @ 000000000038f580] frame P:45    Avg QP:29.82  size:   686\n[libx264 @ 000000000038f580] frame B:193   Avg QP:35.11  size:   159\n[libx264 @ 000000000038f580] consecutive B-frames:  0.8%  0.0%  2.5% 26.7% 22.9% 15.0% 11.7% 16.7%  3.8%\n[libx264 @ 000000000038f580] mb I  I16..4: 41.6%  0.0% 58.4%\n[libx264 @ 000000000038f580] mb P  I16..4:  0.2%  0.0%  0.7%  P16..4: 12.0%  3.7%  5.8%  0.8%  0.3%    skip:76.4%\n[libx264 @ 000000000038f580] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  8.5%  1.5%  0.9%  direct: 0.3%  skip:88.8%  L0:42.5% L1:50.5% BI: 7.0%\n[libx264 @ 000000000038f580] direct mvs  spatial:95.9% temporal:4.1%\n[libx264 @ 000000000038f580] coded y,uvDC,uvAC intra: 76.0% 40.8% 12.1% inter: 1.6% 0.4% 0.0%\n[libx264 @ 000000000038f580] i16 v,h,dc,p: 25% 29%  6% 39%\n[libx264 @ 000000000038f580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 13%  4%  9% 13% 12% 14% 11% 14%\n[libx264 @ 000000000038f580] i8c dc,h,v,p: 21% 48% 21% 10%\n[libx264 @ 000000000038f580] Weighted P-Frames: Y:2.2% UV:2.2%\n[libx264 @ 000000000038f580] ref P L0: 48.5% 11.1% 11.4%  4.7%  4.1%  5.3%  3.6%  1.9%  1.6%  1.5%  0.9%  1.1%  0.9%  1.3%  1.1%  1.1%\n[libx264 @ 000000000038f580] ref B L0: 77.3%  6.0%  5.8%  2.5%  2.5%  2.1%  1.3%  0.5%  0.6%  0.3%  0.3%  0.4%  0.2%  0.2%  0.2%\n[libx264 @ 000000000038f580] ref B L1: 93.9%  6.1%\n[libx264 @ 000000000038f580] kb\/s:62.65\n<\/code><\/pre>\n<p>The only warning I get is that it has guessed the channel layout for the audio. But, it guessed correctly, so I can&#8217;t see how that could be the problem:<\/p>\n<p><strong>Things I&#8217;ve tried:<\/strong><\/p>\n<ul>\n<li>Used <code>libvo_aacenc<\/code> and <code>aac<\/code> (with <code>-strict experimental<\/code>)&#8230;same results<\/li>\n<li>Tired both of the above on a freely distributable build (compiled without <code>--enable-nonfree<\/code>) downloaded from here instead of my own build&#8230;same results<\/li>\n<li>Encoded the same input file with <code>libvorbis<\/code>&#8230;audio works perfectly<\/li>\n<\/ul>\n<p>I&#8217;m at a loss. The fact that the vorbis encoder works fine makes me think that it can&#8217;t be a problem with the input file. But, I can&#8217;t understand why AAC is choking on it then. Any ideas where I&#8217;m going wrong?<\/p>\n<p><strong>Update:<\/strong> Here is the output of <code>ffprobe<\/code> for the file that&#8217;s having problems:<\/p>\n<pre><code>ffprobe version N-54933-g1af9211 Copyright (c) 2007-2013 the FFmpeg developers\n  built on Jul 25 2013 18:05:50 with gcc 4.7.3 (GCC)\n  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib\n  libavutil      52. 40.100 \/ 52. 40.100\n  libavcodec     55. 19.100 \/ 55. 19.100\n  libavformat    55. 12.102 \/ 55. 12.102\n  libavdevice    55.  3.100 \/ 55.  3.100\n  libavfilter     3. 81.103 \/  3. 81.103\n  libswscale      2.  4.100 \/  2.  4.100\n  libswresample   0. 17.103 \/  0. 17.103\n  libpostproc    52.  3.100 \/ 52.  3.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':\n  Metadata:\n    major_brand     : isom\n    minor_version   : 512\n    compatible_brands: isomiso2avc1mp41\n    date            : 2012-04-16T16:02:12.00409-07:00\n    encoder         : Lavf55.12.102\n  Duration: 00:00:10.03, start: 0.021333, bitrate: 199 kb\/s\n    Stream #0:0(und): Video: h264 (Main) (avc1 \/ 0x31637661), yuv420p, 426x240, 63 kb\/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc\n    Metadata:\n      handler_name    : VideoHandler\n    Stream #0:1(und): Audio: aac (mp4a \/ 0x6134706D), 96000 Hz, stereo, fltp, 128 kb\/s\n    Metadata:\n      handler_name    : SoundHandler\n<\/code><\/pre>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/636bec3398ab7aa3d5c6eeaee1a1350a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDominic P<\/p>\n<p>Ok, the issue here seems to be the sample rate. The audio was encoded at 96 kHz which, apparently, Windows Media Player doesn&#8217;t support. When I used <code>-ar 48000<\/code> to set the sample rate to 48 kHz the audio played perfectly. 96 kHz is probably overkill for web video anyway. Thanks to all who helped.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Dominic P I&#8217;m having problems converting uncompressed video to mp4 format using AAC for the audio. I don&#8217;t get any errors, but no audio plays with the video in the output files in Windows Media PLayer (other players handle it fine, but normally WMP doesn&#8217;t have an issue with my other MP4&#8217;s so I still [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4662","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4662"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4662\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}