[Libav-user] mp3 encoder audio quality

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] mp3 encoder audio quality

Lina Sharifi
Hi all,
I am trying to build an mp3 encoder( ffmpeg integrated with lame) in C++. For some reason I am not receiving good quality output. Here are the output samples:


I am using avcodec_encode_audio2 API as shown in the enoding-decoding example.
Also wanted to add, I see some delays in the encoder as when I am doing ret = avcodec_encode_audio2(m_pCodecCtxOut, &Encodedpkt, pInputFrame, &got_output); I dont get any output but after flushing with NULL I get some output for 2-3 loops.

Any suggestion or idea is appreciated.

Thanks,
Lina

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: mp3 encoder audio quality

Carl Eugen Hoyos-2
2017-02-04 17:57 GMT+01:00 Lina Sharifi <[hidden email]>:

> FFMPEG
> result:https://drive.google.com/file/d/0B9DbYNPuSyiRYTFzRmliNWxLcnM/view?usp=sharing

The file is broken afaict.
My initial guess was that you should make sure that the
sample_fmt you specify when initializing the encoder
is what you feed the encoder with but seeing this file I
guess something is wrong when you output the frames...

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: mp3 encoder audio quality

Lina Sharifi
Thanks again Carl,
My issue was in flushing the encoder. I am encoding raw data chunk by chunk, basically after each chunk (several calls to the encode API) I was flushing the encoder till I dont receive any output and was saving everything,That caused silence between chunks (choppy audio). I tried to count the number of delayed outputs in encoder loop and just flush by that count , and it helped in removing unwanted silences. 


On Sat, Feb 4, 2017 at 2:35 PM, Carl Eugen Hoyos <[hidden email]> wrote:
2017-02-04 17:57 GMT+01:00 Lina Sharifi <[hidden email]>:

> FFMPEG
> result:https://drive.google.com/file/d/0B9DbYNPuSyiRYTFzRmliNWxLcnM/view?usp=sharing

The file is broken afaict.
My initial guess was that you should make sure that the
sample_fmt you specify when initializing the encoder
is what you feed the encoder with but seeing this file I
guess something is wrong when you output the frames...

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user