[Libav-user] Problems decoding mp3 files

b.mcdonagh at sky.com b.mcdonagh at sky.com
Mon Apr 28 13:04:04 CEST 2014


Dear Carl,

Thank you for taking the time to respond. I have some hope now! I will go read about top posting and how to send in text only as soon as I press send so please forgive me if I have done the same again unintentionally. I just want to provide the info asap that will help somebody help me.

inputAudioFormat is null before openinput (as I believe it should be) and then I call avformat_find_stream_info and it will crash, another note to add is if I set max_analyse_duration and probesize to 0 before avformat_find_stream_info it doesn't crash but a message

[mp3 @ 82a75a0] Could not find codec parameters for stream 0 (Audio: mp3, 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options 

is then found in the log.

I don't know what else to tell you about the avformat_find_stream_info crash other than it reports

Process 864538880 (EnhancedVideo) terminated SIGSEGV code=2 fltno=11 ip=79884afe(/apps/com.example.EnhancedVideo.testDev_hancedVideoe3ed8854/native/lib/libavcodec.so.55 at av_fast_realloc+0x5) mapaddr=00584afe. ref=0718fffc bdslot=1

 - I don't have great knowledge with c++ debugging - I have only ever used momentics ide.

If I leave out avformat_find_stream_info and call av_read_frame I get a crash

Process 870105349 (EnhancedVideo) terminated SIGSEGV code=2 fltno=11 ip=79a84af8(/apps/com.example.EnhancedVideo.testDev_hancedVideoe3ed8854/native/lib/libavcodec.so.55 at avpriv_tak_parse_streaminfo+0x2229f) mapaddr=00584af8. ref=0724fff8 bdslot=1


But I can get past this by calling av_read_packet instead but then I get lots of [mp3 @ 8448950] Header missing in the log (I dont break when decode returns -1 just for testing).

I have just run it again with av_read_packet just so I can get the exact message for you and noticed as I have done a couple of times in the past that there is actually a success of some kind when decoding the first packet after calling av_read_packet. 

Before all the header missing errors (which are all at the end of the log) I get in the log from the code below it..

b4 while read frame 
after while read frame 
result decodeframe 627 
after while read frame 
result decodeframe -1094995529 
after while read frame 
result decodeframe -1094995529 
after while read frame 
result decodeframe -1094995529 
after while read frame 
result decodeframe -1094995529 
after while read frame 

From this code

AVPacket pkt;
av_init_packet( &pkt ); //tried both leaving this line in and commenting it out neither help
qDebug() << "b4 while read frame";
while (av_read_packet( inputAudioFormat, &pkt ) >= 0) //crashes here unless call av_read_packet instead
{
qDebug() << "after while read frame";
if(pkt.stream_index == 0)
{


if(decoded_frame)
av_frame_unref(decoded_frame);

if (!(decoded_frame = avcodec_alloc_frame()))
{
fprintf(stderr, "Could not allocate audio frame\n");
exit(1);
}

int rv = avcodec_decode_audio4(inputAudioContextz, decoded_frame, &got_frame, &pkt);
qDebug() << "result decodeframe" <<rv;;
}
}

Whatever info I can provide you I will, whatever test I can do to fix this I will. I have built and tested without lame without success all problems are the same.

Everything seems ok compilation wise - as I mentioned in a previous email I have actually encoded an mp4 video (with these library files) containing mp3 audio from calling av_parser_parse2 but I don't think this is the correct way.

Regards

Bradley

On Monday, 28 April 2014, 9:19, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
 
b.mcdonagh at ... <b.mcdonagh at ...> writes:

> I have built ffmpeg with libmp3lame (latest version) 
> included and I get no errors when opening the mp3 decoder.

Please note that libmp3lame is not used (in the sense of 
"it cannot be used by FFmpeg") to decode mp3.
To simplify things, you should probably recompile FFmpeg 
without libmp3lame.

> //yyy = avformat_find_stream_info(inputAudioFormat, NULL);
> //qDebug() << " crashes above line if not commented out 
> ...after find stream info inputAudioFormat res=" << yyy;

Maybe you want to tell us more about the crash?
(I hope you agree that if *inputAudioFormat is a valid 
AVFormatContext no crash should happen / that such a 
crash is an important issue that we would like to hear 
about.)

Did you already run fate on your target to confirm that 
your compilation was fine?
(Many people have reported here that compilation for qnx 
"fails" for them but nobody so far has added enough 
information so that we could help...)

Please do not top-post here, it is considered rude.
It is also a good idea if you force your mailer to 
text-only for this mailing list.

Carl Eugen

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


More information about the Libav-user mailing list