<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:10pt"><div class="" style="">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.</div><div class="" style=""><br class="" style=""></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class="">I have built ffmpeg with libmp3lame (latest version) included and I get no errors when opening the mp3 decoder.</div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><br class="" style=""></div><div
 style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class="">I have tried to decode the mp3 file in every many different ways I can find. avcodec_decode_audio4 and avcodec_decode_audio3 both return header missing error. </div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class="">I can get the mp3 packet calling fread or av_read_packet but <span style="background-color: transparent" class="">av_read_frame
 just crashes. I have ensured that the stream index is correct before trying to decode the packet.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span style="background-color: transparent" class=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span style="background-color: transparent" class="">I have tried many different mp3 files. I am using the latest ffmpeg snapshot.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent;
 font-style: normal" class=""><span style="background-color: transparent" class=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span style="background-color: transparent" class="">When calling avformat_find_stream_info with my mp3 format context I get a seg fault crash. This crash doesn't happen for any other file type, just mp3 files.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span style="background-color: transparent" class=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica
 Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span style="background-color: transparent" class="">Can anybody please give me sufficient knowledge to move on from this as I really want to work with mp3 files with libav.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span style="background-color: transparent" class=""><br class="" style=""></span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""><span style="background-color: transparent" class="">Why do I get header missing when decoding mp3 only and why does </span><span
 style="font-size: 10pt" class="">avformat_find_stream_info crash only for mp3 files?</span></div><div style="color: rgb(0, 0, 0); font-size: 10pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><span style="font-size: 10pt" class=""><br></span></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class="">Let me know if any more information is required.</div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica
 Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class="">Thanks</div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class=""><br></div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;" class="">Bradley</div><div style="color: rgb(0, 0, 0); font-size: 13.63636302947998px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal" class=""> </div></div></body></html>