Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-25 Thread Taha Ansari
I have another observation:

When transcoding from mp4 to mp4 (using my code), I see
codec_ctx_audio->frame_size is equal to 1024 (that is decoder codec
context), and encoder codec context's frame_size is allocated the same
(1024).

Whereas, while converting from mp3 to mp4, codec_ctx_audio->frame_size is
1152, and encoder codec context frame_size is 1024.

I am thinking these could be related, if I figure out magic going on here,
I might be able to proceed better?
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Taha Ansari
On Mon, Jun 24, 2013 at 11:52 PM, Paul B Mahol  wrote:

> On 6/24/13, Taha Ansari  wrote:
> >>>mp4 to mp4 is not encoding but remuxing which can also do
> >>> transcoding.
> >
> > Understood... only my point is: since this decode -> resample -> encode
> > process is happening from my code, it should be applicable to other
> formats
> > as well, shouldn't it?
>
> Yes.
>

Hi again,

I tried searching online again, apparently I'm doing almost identical to
this post (input/output format changed but theme is same):

http://stackoverflow.com/questions/14989397/how-to-convert-sample-rate-from-av-sample-fmt-fltp-to-av-sample-fmt-s16

It does not work for me (same quick audio playback)

People have posted similar question (in theme at least):
http://stackoverflow.com/questions/16904841/how-to-encode-resampled-pcm-audio-to-aac-using-ffmpeg-api-when-input-pcm-samples
http://stackoverflow.com/questions/16724722/how-to-fill-audio-avframe-ffmpeg-with-the-data-obtained-from-cmsamplebufferref

Also they could not find the answer.

I'm tired trying to figure it out on my own, is there any kind soul who has
done this already?

Please share...
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Paul B Mahol
On 6/24/13, Taha Ansari  wrote:
>>>mp4 to mp4 is not encoding but remuxing which can also do
>>> transcoding.
>
> Understood... only my point is: since this decode -> resample -> encode
> process is happening from my code, it should be applicable to other formats
> as well, shouldn't it?

Yes.

>
>>
>> > code, I am thinking it is the decoding part where I need to be careful
>> > dealing with planar formats... is my understanding correct?
>> >
>> ___
>> Libav-user mailing list
>> Libav-user@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>>
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Taha Ansari
>>mp4 to mp4 is not encoding but remuxing which can also do transcoding.

Understood... only my point is: since this decode -> resample -> encode
process is happening from my code, it should be applicable to other formats
as well, shouldn't it?

>
> > code, I am thinking it is the decoding part where I need to be careful
> > dealing with planar formats... is my understanding correct?
> >
> ___
> Libav-user mailing list
> Libav-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Paul B Mahol
On 6/24/13, Taha Ansari  wrote:
>>>Do you have any link to any example that uses planar data correctly? I
> have been trying >>since your email to get it to work, but no success so
> far.
>
>>
> Since encoding from mp4 to mp4 seems to be working fine with my modified

mp4 to mp4 is not encoding but remuxing which can also do transcoding.

> code, I am thinking it is the decoding part where I need to be careful
> dealing with planar formats... is my understanding correct?
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Taha Ansari
>>Do you have any link to any example that uses planar data correctly? I
have been trying >>since your email to get it to work, but no success so
far.

>
Since encoding from mp4 to mp4 seems to be working fine with my modified
code, I am thinking it is the decoding part where I need to be careful
dealing with planar formats... is my understanding correct?
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Taha Ansari
"Compatible" results from rest of thread means its wrong one, as it gives

> wrong output.
>
> Planar sample format have data in different format stored in memory thus if
> you do not use it correctly crash happens
>

Do you have any link to any example that uses planar data correctly? I have
been trying since your email to get it to work, but no success so far.
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Paul B Mahol
On 6/24/13, Taha Ansari  wrote:
> You can't change input sample format like that, input sample format is
>
>> what decoder outputs, nothing else.
>>
>> Same apply to sample format that encoder accepts.
>>
>> So you first need to make sure that you do not change sample format
>> of decoder and that sample format for encoder is actually supported.
>>
>>
> That makes sense, so I modified swr initialization function like this:
>
> swr = swr_alloc();
> av_opt_set_int(swr, "in_channel_layout",
> codec_ctx_audio->channel_layout, 0);
> av_opt_set_int(swr, "out_channel_layout",
> codec_ctx_audio->channel_layout,  0);
> av_opt_set_int(swr, "in_sample_rate",
> codec_ctx_audio->sample_rate, 0);
> av_opt_set_int(swr, "out_sample_rate",
> codec_ctx_audio->sample_rate, 0);
> av_opt_set_sample_fmt(swr, "in_sample_fmt",
> codec_ctx_audio->sample_fmt, 0);
> av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,
> 0);
> swr_init(swr);
>
> So I'm letting decoder decide whatever format it is comfortable with.
>
> Buf for encoder, I know AV_SAMPLE_FMT_S16 has given me compatible results
> so far (otherwise crashing). So I keep it like this and run my program:
> same results, unfortunately (btw codec_ctx_audio->sample_fmt shows
> AV_SAMPLE_FMT_S16P inside debugger anyway).

"Compatible" results from rest of thread means its wrong one, as it gives
wrong output.

Planar sample format have data in different format stored in memory thus if
you do not use it correctly crash happens

>
> The success I'm talking of, from AV_SAMPLE_FMT_S16 have been from some
> other test, i.e. if i try to encode an mp4 file as mp4 file (makes no sense
> but this exercise makes me visualize my guess for 'AV_SAMPLE_FMT_S16' is
> working, i.e. mp4 to mp4 conversion from my code runs just fine).
>
> Obviously, I need to improve encoding functions, somehow. But I can't put
> my finger on it. 
>
> Cleary examples are not documented properly and needs improving ASAP.
>>
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Taha Ansari
You can't change input sample format like that, input sample format is

> what decoder outputs, nothing else.
>
> Same apply to sample format that encoder accepts.
>
> So you first need to make sure that you do not change sample format
> of decoder and that sample format for encoder is actually supported.
>
>
That makes sense, so I modified swr initialization function like this:

swr = swr_alloc();
av_opt_set_int(swr, "in_channel_layout",
codec_ctx_audio->channel_layout, 0);
av_opt_set_int(swr, "out_channel_layout",
codec_ctx_audio->channel_layout,  0);
av_opt_set_int(swr, "in_sample_rate",
codec_ctx_audio->sample_rate, 0);
av_opt_set_int(swr, "out_sample_rate",
codec_ctx_audio->sample_rate, 0);
av_opt_set_sample_fmt(swr, "in_sample_fmt",
codec_ctx_audio->sample_fmt, 0);
av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,  0);
swr_init(swr);

So I'm letting decoder decide whatever format it is comfortable with.

Buf for encoder, I know AV_SAMPLE_FMT_S16 has given me compatible results
so far (otherwise crashing). So I keep it like this and run my program:
same results, unfortunately (btw codec_ctx_audio->sample_fmt shows
AV_SAMPLE_FMT_S16P inside debugger anyway).

The success I'm talking of, from AV_SAMPLE_FMT_S16 have been from some
other test, i.e. if i try to encode an mp4 file as mp4 file (makes no sense
but this exercise makes me visualize my guess for 'AV_SAMPLE_FMT_S16' is
working, i.e. mp4 to mp4 conversion from my code runs just fine).

Obviously, I need to improve encoding functions, somehow. But I can't put
my finger on it. 

Cleary examples are not documented properly and needs improving ASAP.
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Paul B Mahol
On 6/24/13, Taha Ansari  wrote:
> Hi Carl,
>
> On your suggestion, I downloaded latest available build from Zeranoe site:
> ffmpeg-20130623-git-c329713-win32. I had some trouble getting my code to
> run with latest build, but finally was able to do so.
>
> I had to make following additions:
>
> inside open_audio_input():
>
> // Set up SWR context once you've got codec information
> swr = swr_alloc();
> av_opt_set_int(swr, "in_channel_layout",
> codec_ctx_audio->channel_layout, 0);
> av_opt_set_int(swr, "out_channel_layout",
> codec_ctx_audio->channel_layout,  0);
> av_opt_set_int(swr, "in_sample_rate",
> codec_ctx_audio->sample_rate, 0);
> av_opt_set_int(swr, "out_sample_rate",
> codec_ctx_audio->sample_rate, 0);
> av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_S16P,
> 0);
> av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,
> 0);
> swr_init(swr);
>
> inside decode_packet():
>
> swr_convert( swr, audio_dst_data,
> decoded_frame->nb_samples, (const uint8_t**) decoded_frame->extended_data,
> decoded_frame->nb_samples );
>
> inside add_audio_stream():
>
> c->sample_fmt  = AV_SAMPLE_FMT_S16;
> c->bit_rate= audio_bit_rate;
> c->sample_rate = audio_sample_rate;
> c->channels= audio_channels;
>
> Then, all things started working, but the output was identical to previous
> behavior (plays faster, and ends on same time: on about 65th second).
>
> I tried changing output format from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLTP
> (inside above relevant functions), but it fails inside avcodec_open2(),
> giving me -22 return value.

You can't change input sample format like that, input sample format is
what decoder outputs, nothing else.

Same apply to sample format that encoder accepts.

So you first need to make sure that you do not change sample format
of decoder and that sample format for encoder is actually supported.

Cleary examples are not documented properly and needs improving ASAP.

>
> Any ideas how to fix this?
>
> Thanks for your time...
>
>
> On Mon, Jun 24, 2013 at 11:26 AM, Taha Ansari
> wrote:
>
>> Hi Carl,
>>
>> You are right, last working build I downloaded from Zeranoe FFmpeg builds
>> was from a long time ago. If you suggest I can always get the latest
>> working build from there, but! the point is: even for this old version of
>> FFmpeg, command line "ffmpeg.exe -i test.mp3 test.mp4" converts the file
>> just fine, so there is obviously something wrong with my code...
>>
>> Still, if you suggest I get latest build from there, well, I can do it as
>> well!
>>
>> Kindly, could you guide further based on above facts?
>>
>>
>> On Mon, Jun 24, 2013 at 11:04 AM, Carl Eugen Hoyos
>> wrote:
>>
>>> Taha Ansari  writes:
>>>
>>> > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012
>>>
>>> This looks outdated.
>>> The aac decoder of current git head outputs FLTP iirc.
>>>
>>> Carl Eugen
>>>
>>> ___
>>> Libav-user mailing list
>>> Libav-user@ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/libav-user
>>>
>>
>>
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-24 Thread Taha Ansari
Hi Carl,

On your suggestion, I downloaded latest available build from Zeranoe site:
ffmpeg-20130623-git-c329713-win32. I had some trouble getting my code to
run with latest build, but finally was able to do so.

I had to make following additions:

inside open_audio_input():

// Set up SWR context once you've got codec information
swr = swr_alloc();
av_opt_set_int(swr, "in_channel_layout",
codec_ctx_audio->channel_layout, 0);
av_opt_set_int(swr, "out_channel_layout",
codec_ctx_audio->channel_layout,  0);
av_opt_set_int(swr, "in_sample_rate",
codec_ctx_audio->sample_rate, 0);
av_opt_set_int(swr, "out_sample_rate",
codec_ctx_audio->sample_rate, 0);
av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_S16P, 0);
av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,  0);
swr_init(swr);

inside decode_packet():

swr_convert( swr, audio_dst_data,
decoded_frame->nb_samples, (const uint8_t**) decoded_frame->extended_data,
decoded_frame->nb_samples );

inside add_audio_stream():

c->sample_fmt  = AV_SAMPLE_FMT_S16;
c->bit_rate= audio_bit_rate;
c->sample_rate = audio_sample_rate;
c->channels= audio_channels;

Then, all things started working, but the output was identical to previous
behavior (plays faster, and ends on same time: on about 65th second).

I tried changing output format from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLTP
(inside above relevant functions), but it fails inside avcodec_open2(),
giving me -22 return value.

Any ideas how to fix this?

Thanks for your time...


On Mon, Jun 24, 2013 at 11:26 AM, Taha Ansari wrote:

> Hi Carl,
>
> You are right, last working build I downloaded from Zeranoe FFmpeg builds
> was from a long time ago. If you suggest I can always get the latest
> working build from there, but! the point is: even for this old version of
> FFmpeg, command line "ffmpeg.exe -i test.mp3 test.mp4" converts the file
> just fine, so there is obviously something wrong with my code...
>
> Still, if you suggest I get latest build from there, well, I can do it as
> well!
>
> Kindly, could you guide further based on above facts?
>
>
> On Mon, Jun 24, 2013 at 11:04 AM, Carl Eugen Hoyos wrote:
>
>> Taha Ansari  writes:
>>
>> > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012
>>
>> This looks outdated.
>> The aac decoder of current git head outputs FLTP iirc.
>>
>> Carl Eugen
>>
>> ___
>> Libav-user mailing list
>> Libav-user@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>>
>
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-23 Thread Taha Ansari
Hi Carl,

You are right, last working build I downloaded from Zeranoe FFmpeg builds
was from a long time ago. If you suggest I can always get the latest
working build from there, but! the point is: even for this old version of
FFmpeg, command line "ffmpeg.exe -i test.mp3 test.mp4" converts the file
just fine, so there is obviously something wrong with my code...

Still, if you suggest I get latest build from there, well, I can do it as
well!

Kindly, could you guide further based on above facts?


On Mon, Jun 24, 2013 at 11:04 AM, Carl Eugen Hoyos  wrote:

> Taha Ansari  writes:
>
> > ffprobe version N-47062-g26c531c Copyright (c) 2007-2012
>
> This looks outdated.
> The aac decoder of current git head outputs FLTP iirc.
>
> Carl Eugen
>
> ___
> Libav-user mailing list
> Libav-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-23 Thread Carl Eugen Hoyos
Taha Ansari  writes:

> ffprobe version N-47062-g26c531c Copyright (c) 2007-2012

This looks outdated.
The aac decoder of current git head outputs FLTP iirc.

Carl Eugen

___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-23 Thread Taha Ansari
Hi everyone!

I am trying to get this puzzle solved, but no success so far. Can anyone
please guide me further?

Thanks in advance for your time!


On Fri, Jun 21, 2013 at 3:28 PM, Taha Ansari  wrote:

>
>
>
> On Fri, Jun 21, 2013 at 3:06 PM, Carl Eugen Hoyos wrote:
>
>> Taha Ansari  writes:
>>
>> > I have run this application with existing mp4
>> > files as input, and it properly extracts audio,
>> > and encodes to mp4 (audio only:AAC), or even
>> > directly in AAC format (i.e. test.aac also
>> > works). But when I tried running it on mp3
>> > files, output clip plays faster than it should
>> > be (a clip of 1:12 seconds plays back till
>> > 1:05 seconds only, and is also noisy).
>>
>> I did not look at your code but did you consider
>> that the AAC decoder outputs AV_SAMPLE_FMT_FLTP
>> and the MP3 decoder signed 16 bit values (I
>> believe you can request planar or not)?
>>
>> Carl Eugen
>>
>> ___
>> Libav-user mailing list
>> Libav-user@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>>
>
> Hi Carl!
>
> 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:
>
>
> 
> FFprobe from test.mp3 (input file):
>
> 
> ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg
> developers
>   built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC)
>   configuration: --disable-static --enable-shared --enable-gpl
> --enable-version3
>  --disable-pthreads --enable-runtime-cpudetect --enable-avisynth
> --enable-bzlib
> --enable-frei0r --enable-libass --enable-libopencore-amrnb
> --enable-libopencore-
> amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
> --enable-libnut -
> -enable-libopenjpeg --enable-libopus --enable-librtmp
> --enable-libschroedinger -
> -enable-libspeex --enable-libtheora --enable-libutvideo
> --enable-libvo-aacenc --
> enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264
> --enab
> le-libxavs --enable-libxvid --enable-zlib
>   libavutil  52.  9.100 / 52.  9.100
>   libavcodec 54. 77.100 / 54. 77.100
>   libavformat54. 37.100 / 54. 37.100
>   libavdevice54.  3.100 / 54.  3.100
>   libavfilter 3. 23.102 /  3. 23.102
>   libswscale  2.  1.102 /  2.  1.102
>   libswresample   0. 17.101 /  0. 17.101
>   libpostproc52.  2.100 / 52.  2.100
> [mp3 @ 007b2a60] max_analyze_duration 500 reached at 5015510
> Input #0, mp3, from 'test.mp3':
>   Metadata:
> major_brand : isom
> minor_version   : 512
> compatible_brands: isomiso2avc1mp41
> encoder : Lavf54.37.100
>   Duration: 00:01:12.67, start: 0.00, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
>
> 
>
>
> 
> FFprobe from test.mp4 (converted file):
>
> 
>
> ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg
> developers
>   built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC)
>   configuration: --disable-static --enable-shared --enable-gpl
> --enable-version3
>  --disable-pthreads --enable-runtime-cpudetect --enable-avisynth
> --enable-bzlib
> --enable-frei0r --enable-libass --enable-libopencore-amrnb
> --enable-libopencore-
> amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
> --enable-libnut -
> -enable-libopenjpeg --enable-libopus --enable-librtmp
> --enable-libschroedinger -
> -enable-libspeex --enable-libtheora --enable-libutvideo
> --enable-libvo-aacenc --
> enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264
> --enab
> le-libxavs --enable-libxvid --enable-zlib
>   libavutil  52.  9.100 / 52.  9.100
>   libavcodec 54. 77.100 / 54. 77.100
>   libavformat54. 37.100 / 54. 37.100
>   libavdevice54.  3.100 / 54.  3.100
>   libavfilter 3. 23.102 /  3. 23.102
>   libswscale  2.  1.102 /  2.  1.102
>   libswresample   0. 17.101 /  0. 17.101
>   libpostproc52.  2.100 / 52.  2.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
>   Metadata:
> major_brand : isom
> minor_version   : 512
> compatible_brands: isomiso2mp41
> encoder : Lavf54.37.100
>   Duration: 00:01:04.62, start: 0.00, bitrate: 129 kb/s
> Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
> s16, 128
>  kb/s
> Metadata:
>   handler_name: SoundHandler
>
> 
>
> Hence the

Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-21 Thread Taha Ansari
On Fri, Jun 21, 2013 at 3:06 PM, Carl Eugen Hoyos  wrote:

> Taha Ansari  writes:
>
> > I have run this application with existing mp4
> > files as input, and it properly extracts audio,
> > and encodes to mp4 (audio only:AAC), or even
> > directly in AAC format (i.e. test.aac also
> > works). But when I tried running it on mp3
> > files, output clip plays faster than it should
> > be (a clip of 1:12 seconds plays back till
> > 1:05 seconds only, and is also noisy).
>
> I did not look at your code but did you consider
> that the AAC decoder outputs AV_SAMPLE_FMT_FLTP
> and the MP3 decoder signed 16 bit values (I
> believe you can request planar or not)?
>
> Carl Eugen
>
> ___
> Libav-user mailing list
> Libav-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>

Hi Carl!

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:


FFprobe from test.mp3 (input file):

ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg
developers
  built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3
 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth
--enable-bzlib
--enable-frei0r --enable-libass --enable-libopencore-amrnb
--enable-libopencore-
amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libnut -
-enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libutvideo
--enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264
--enab
le-libxavs --enable-libxvid --enable-zlib
  libavutil  52.  9.100 / 52.  9.100
  libavcodec 54. 77.100 / 54. 77.100
  libavformat54. 37.100 / 54. 37.100
  libavdevice54.  3.100 / 54.  3.100
  libavfilter 3. 23.102 /  3. 23.102
  libswscale  2.  1.102 /  2.  1.102
  libswresample   0. 17.101 /  0. 17.101
  libpostproc52.  2.100 / 52.  2.100
[mp3 @ 007b2a60] max_analyze_duration 500 reached at 5015510
Input #0, mp3, from 'test.mp3':
  Metadata:
major_brand : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf54.37.100
  Duration: 00:01:12.67, start: 0.00, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s



FFprobe from test.mp4 (converted file):


ffprobe version N-47062-g26c531c Copyright (c) 2007-2012 the FFmpeg
developers
  built on Nov 25 2012 12:23:20 with gcc 4.7.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl
--enable-version3
 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth
--enable-bzlib
--enable-frei0r --enable-libass --enable-libopencore-amrnb
--enable-libopencore-
amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libnut -
-enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libutvideo
--enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264
--enab
le-libxavs --enable-libxvid --enable-zlib
  libavutil  52.  9.100 / 52.  9.100
  libavcodec 54. 77.100 / 54. 77.100
  libavformat54. 37.100 / 54. 37.100
  libavdevice54.  3.100 / 54.  3.100
  libavfilter 3. 23.102 /  3. 23.102
  libswscale  2.  1.102 /  2.  1.102
  libswresample   0. 17.101 /  0. 17.101
  libpostproc52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
major_brand : isom
minor_version   : 512
compatible_brands: isomiso2mp41
encoder : Lavf54.37.100
  Duration: 00:01:04.62, start: 0.00, bitrate: 129 kb/s
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
s16, 128
 kb/s
Metadata:
  handler_name: SoundHandler


Hence the reason I was supplying:

c->sample_fmt  = AV_SAMPLE_FMT_S16; (in add_audio_stream() function).

If I'm not wasting too much of your time, can you please guide how I can co
relate the two formats, pragmatically?

Thanks for your time!
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Conversion from mp3 to aac/mp4 container problem

2013-06-21 Thread Carl Eugen Hoyos
Taha Ansari  writes:

> I have run this application with existing mp4 
> files as input, and it properly extracts audio, 
> and encodes to mp4 (audio only:AAC), or even 
> directly in AAC format (i.e. test.aac also 
> works). But when I tried running it on mp3 
> files, output clip plays faster than it should 
> be (a clip of 1:12 seconds plays back till 
> 1:05 seconds only, and is also noisy).

I did not look at your code but did you consider 
that the AAC decoder outputs AV_SAMPLE_FMT_FLTP 
and the MP3 decoder signed 16 bit values (I 
believe you can request planar or not)?

Carl Eugen

___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user