<div dir="ltr"><div><div>Hi everyone!<br><br></div>I am trying to get this puzzle solved, but no success so far. Can anyone please guide me further?<br><br></div>Thanks in advance for your time!<br><div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 3:28 PM, Taha Ansari <span dir="ltr"><<a href="mailto:mtaha.ansari@gmail.com" target="_blank">mtaha.ansari@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div class="h5"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 3:06 PM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Taha Ansari <mtaha.ansari@...> writes:<br>
<br>
> I have run this application with existing mp4<br>
> files as input, and it properly extracts audio,<br>
> and encodes to mp4 (audio only:AAC), or even<br>
> directly in AAC format (i.e. test.aac also<br>
> works). But when I tried running it on mp3<br>
> files, output clip plays faster than it should<br>
> be (a clip of 1:12 seconds plays back till<br>
> 1:05 seconds only, and is also noisy).<br>
<br>
</div>I did not look at your code but did you consider<br>
that the AAC decoder outputs AV_SAMPLE_FMT_FLTP<br>
and the MP3 decoder signed 16 bit values (I<br>
believe you can request planar or not)?<br>
<br>
Carl Eugen<br>
<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">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>
</blockquote></div><br></div></div></div><div class="gmail_extra">Hi Carl!<br><br></div><div class="gmail_extra">As a matter of fact, I never knew about this, till now. In fact, when I was probing the two files, I got s16 indication, so I thought they were similar, maybe:<br>
<br>----------------------------------------------------------------------------------------------------<br></div><div class="gmail_extra">FFprobe from test.mp3 (input file):<br>----------------------------------------------------------------------------------------------------<br>
ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg developers<br> built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC)<br> configuration: --disable-static --enable-shared --enable-gpl --enable-version3<br>
--disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib<br>--enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-<br>amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut -<br>
-enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger -<br>-enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --<br>enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab<br>
le-libxavs --enable-libxvid --enable-zlib<br> libavutil 52. 9.100 / 52. 9.100<br> libavcodec 54. 77.100 / 54. 77.100<br> libavformat 54. 37.100 / 54. 37.100<br> libavdevice 54. 3.100 / 54. 3.100<br>
libavfilter 3. 23.102 / 3. 23.102<br> libswscale 2. 1.102 / 2. 1.102<br> libswresample 0. 17.101 / 0. 17.101<br> libpostproc 52. 2.100 / 52. 2.100<br>[mp3 @ 007b2a60] max_analyze_duration 5000000 reached at 5015510<br>
Input #0, mp3, from 'test.mp3':<br> Metadata:<br> major_brand : isom<br> minor_version : 512<br> compatible_brands: isomiso2avc1mp41<br> encoder : Lavf54.37.100<br> Duration: 00:01:12.67, start: 0.000000, bitrate: 128 kb/s<br>
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s<br>----------------------------------------------------------------------------------------------------<br><br>----------------------------------------------------------------------------------------------------<br>
</div><div class="gmail_extra">FFprobe from test.mp4 (converted file):<br>----------------------------------------------------------------------------------------------------<br><br>ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg developers<br>
built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC)<br> configuration: --disable-static --enable-shared --enable-gpl --enable-version3<br> --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib<br>
--enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-<br>amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut -<br>-enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger -<br>
-enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --<br>enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enab<br>le-libxavs --enable-libxvid --enable-zlib<br> libavutil 52. 9.100 / 52. 9.100<br>
libavcodec 54. 77.100 / 54. 77.100<br> libavformat 54. 37.100 / 54. 37.100<br> libavdevice 54. 3.100 / 54. 3.100<br> libavfilter 3. 23.102 / 3. 23.102<br> libswscale 2. 1.102 / 2. 1.102<br>
libswresample 0. 17.101 / 0. 17.101<br>
libpostproc 52. 2.100 / 52. 2.100<br>Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':<br> Metadata:<br> major_brand : isom<br> minor_version : 512<br> compatible_brands: isomiso2mp41<br>
encoder : Lavf54.37.100<br>
Duration: 00:01:04.62, start: 0.000000, bitrate: 129 kb/s<br> Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 128<br> kb/s<br> Metadata:<br> handler_name : SoundHandler<br>----------------------------------------------------------------------------------------------------<br>
<br></div><div class="gmail_extra">Hence the reason I was supplying:<br><br>c->sample_fmt = AV_SAMPLE_FMT_S16; (in add_audio_stream() function).<br><br></div><div class="gmail_extra">If I'm not wasting too much of your time, can you please guide how I can co relate the two formats, pragmatically?<br>
<br></div><div class="gmail_extra">Thanks for your time!<br></div></div>
</blockquote></div><br></div></div></div></div></div>