<div dir="ltr"><div>This is information about the file which cannot be compressed:<br><span style="color:rgb(68,68,68)"><i> Metadata:<br>    major_brand     : isom<br>    minor_version   : 0<br>    compatible_brands: isom3gp4<br>    creation_time   : 1948-08-31 11:42:22<br>  Duration: 00:00:47.68, start: 0.000000, bitrate: 96 kb/s<br>    Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, s16, 96 kb/s<br>    Metadata:<br>      creation_time   : 1948-08-31 11:42:22<br>      handler_name    : SoundHandle<br><br><br></i></span></div><div>I managed to build FFMPEG 2.4 and it is working. I can compress sound with parameters 96000 and sampling rate 16000. However there is problem with applying patch aac-improvements-wip-v8g.It failes with info:  1 out of 3 hunks FAILED -- saving rejects to file libavcodec/psymodel.h.rej.  File psymodel.h.rej looks following:<br><br>--- libavcodec/psymodel.h<br>+++ libavcodec/psymodel.h<br>@@ -27,9 +27,22 @@<br> /** maximum possible number of bands */<br> #define PSY_MAX_BANDS 128<br> /** maximum number of channels */<br>-#define PSY_MAX_CHANS 20<br>+#define PSY_MAX_CHANS 24<br> <br>-#define AAC_CUTOFF(s) (s->bit_rate ? FFMIN3(4000 + s->bit_rate/8, 12000 + s->bit_rate/32, s->sample_rate / 2) : (s->sample_rate / 2))<br>+/* cutoff for VBR is purposedly increased, since LP filtering actually<br>+ * hinders VBR performance rather than the opposite<br>+ */<br>+#define _AAC_CUTOFF(bit_rate,channels,sample_rate) (bit_rate ? FFMIN3(FFMIN3( \<br>+    bit_rate/channels/2, \<br>+    3000 + bit_rate/channels/4, \<br>+    12000 + bit_rate/channels/16), \<br>+    20000, \<br>+    sample_rate / 2): (sample_rate / 2))<br>+#define AAC_CUTOFF(s) ( \<br>+    (s->flags & CODEC_FLAG_QSCALE) \<br>+    ? /*_AAC_CUTOFF(((int)(480000.0f*(s->global_quality ? s->global_quality/120.0f : 1.0f))), 1, s->sample_rate)*/s->sample_rate / 2 \<br>+    : _AAC_CUTOFF(s->bit_rate, s->channels, s->sample_rate) \<br>+)<br> <br> /**<br>  * single band psychoacoustic information<br><br></div><div><br>Build fails with: <br></div><div><br><i></i></div><span style="color:rgb(68,68,68)"></span><div><a href="http://its.ffmpeg.org/attachment/ticket/2686/aac-improvements-wip-v8g.patch" target="_blank"><i></i></a>libavcodec/aaccoder.c:910:13: error: implicit declaration of function '_AAC_CUTOFF' [-Werror=implicit-function-declaration]<br>libavcodec/aaccoder.c:814:44: warning: variable 'energies' set but not used [-Wunused-but-set-variable]<br>libavcodec/aaccoder.c: At top level:<br>libavcodec/aaccoder.c:366:14: warning: 'find_max_absval' defined but not used [-Wunused-function]<br>cc1: some warnings being treated as errors<br><br>make: *** [libavcodec/aaccoder.o] Error 1<br>make: *** Waiting for unfinished jobs....<br>CC    libavcodec/aacenc.o<br>libavcodec/aacdec.c: In function 'imdct_and_windowing_eld':<br>libavcodec/aacdec.c:2590:29: warning: array subscript is above array bounds [-Warray-bounds]<br>libavcodec/aacdec.c:2596:29: warning: array subscript is above array bounds [-Warray-bounds]<br>Native build complete, exiting...<br>marcin@marcin:~/android-dev/FFFMPEG_BUILDS/ffmpeg-2.4-build-scrypts$ <br><br></div><div>Good info is that with 2.4 it is working but it would be very good to apply this patch to improve quality of aac. Is there any fix for this patch problem??<br><br><br></div><div>BR, Marcin<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 September 2014 18:51, Claudio Freire <span dir="ltr"><<a href="mailto:klaussfreire@gmail.com" target="_blank">klaussfreire@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Sep 19, 2014 at 5:28 AM, adev dev <<a href="mailto:androiddevmar11@gmail.com">androiddevmar11@gmail.com</a>> wrote:<br>
> I am not using command line. It is done in code in Android project. Some<br>
> devices cannot record sound with 192000 and 44100 probably due to some<br>
> hardware limitations. In such case Android dicreases params to 96000 and<br>
> 16000.<br>
><br>
> I can reproduce the issue when I record sound with sampling rate 32000 and<br>
> try to compress it with samling rate 44100 on FFMPEG side. Sound is very<br>
> fast and it ends before the movie is ended. I this specific case setting<br>
> sampling rate to 32000 on FFMPEG side fixes the problem and sound is<br>
> correctly compressed.<br>
<br>
</span>Then it is quite possible that either during recording or during<br>
playback, the sample rate is specified as 44100 or 22050 when it<br>
really is lower.<br>
<br>
Can you inspect the generated files on a pc, on a console, with the command:<br>
<br>
ffmpeg -i <file><br>
<br>
And paste the output?<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</div></div></blockquote></div><br></div></div>