[Libav-user] Problems decoding mp3 files

b.mcdonagh at sky.com b.mcdonagh at sky.com
Mon Apr 28 01:03:49 CEST 2014

Thank you for your response Gonzalo.

Currently I don't have the code using the problematic functions I state, I have the code working (actually encoding the data to video file) by not using av_find_stream_info and avcodec_decode_audio4, I'm currently using av_parser_parse2 to get the mp3 data out of the pkt returned from fread and then just writing this (via AVPacket) using av_interleaved_write_frame to the output audio stream. I found av_parser_parse2  out of desperation when I couldn't decode the mp3 data any other way.

The problem with the above way is I can only get mp3 codec to work properly in outputted video file - if I use aac codec then I just get silence when playing the video. The problem with mp3 audio in the mp4 video is that it doesn't seem to play in all players on my pc, vlc is ok with it. maybe I'm using av_parser_parse2  wrong??

I'm telling you this because I have already changed the code (to match output-api.c/muxing.c/remuxing.c examples) so many times to try to decode in the many ways I have stated and I know what I have stated is right without changing the code back again to match the samples (I have done so 3 times already today) (I hope you understand) -  avformat_find_stream_info crashes for mp3 only and avcodec_decode_audio4 returns header missing for mp3 file only. av_read_frame crashes but av_read_packet doesn't.

I am using qnx platform which is arm linux. 


On Sunday, 27 April 2014, 23:42, Gonzalo Garramuno <ggarra13 at gmail.com> wrote:
On 27/04/14 19:29, b.mcdonagh at sky.com wrote:
> I have spent the last few weeks learning about libav to try to decode 
> mp3 files so I can create videos with the audio from the mp3 files.
> Let me know if any more information is required.
> Thanks
> Bradley
Bradley, more info is required.  Can you post or upload a section of 
your code?

Libav-user mailing list
Libav-user at ffmpeg.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140428/f5cdc0e7/attachment.html>

More information about the Libav-user mailing list