<div dir="ltr"><div>Flow will be like this <br><br>avcodec_register_all();<br><br>avcodec_find_decoder(AV_CODEC_ID_MP3)<br><br>avcodec_alloc_context3<br><br>avcodec_open2  // check this function is available in your code....<br>
<br><br></div>Thanks <br>Tushar<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 9 May 2014 16:41, Tushar Paithankar <span dir="ltr"><<a href="mailto:p.tushar99@gmail.com" target="_blank">p.tushar99@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi Ankush,<br><br></div>Try using AV_CODEC_ID_MP3 rather than AV_CODEC_ID_MP2 , I have implemented the MP3 Decoder using ffmpeg and it is working fine.<br>
<br><br></div>Let me know if you have any further problem n please share issue in detail..<br>
<br><br><br></div>Thanks <br></div>Tushar<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On 9 May 2014 09:01, Ankush <span dir="ltr"><<a href="mailto:wadkes93@gmail.com" target="_blank">wadkes93@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">

<div>
<div>
<div style="FONT-SIZE:11pt;FONT-FAMILY:Calibri,sans-serif">I am currently trying to read the audio samples from a video file. I <br>tried the sample code provided in the examples section <br>decoding_encoding.c and i only changed the <br>

avcodec_find_decoder(AV_CODEC_ID_MP2) to <br>avcodec_find_decoder(pCodecCtx->codec_id), everything works fine with <br>this till i reach the avcodec_decode_audio4() where i get a negative <br>value from this function.<br>

I managed my way through video decoding sucesfully but seem to be <br>stucked here from a long time. i tried with .mts and .mp4 file and even <br>.mp3 file but all seem to return a negative value.<br><br>Thank you.</div>
</div>
</div><br></div></div>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>