[Libav-user] Mp3 play using ffmpeg

Anshul Maheshwari er.anshul.maheshwari at gmail.com
Fri Nov 1 06:46:05 CET 2013


On Thu, Oct 31, 2013 at 6:54 PM, Yamusani Vinay <yamusanivinay at gmail.com> wrote:
> I tried playing another mp3 file then at the below line.
>
> int res = av_find_stream_info(pFormatCtx);
>
> I got res as -1 so this is unable to find stream info..so please help in
> solving this issue..
>
>
>
> On Thu, Oct 31, 2013 at 6:21 PM, Robert Schmidt <rob.f.schmidt86 at gmail.com>
> wrote:
>>
>> On Thu, Oct 31, 2013 at 9:46 AM, Yamusani Vinay <yamusanivinay at gmail.com>
>> wrote:
>> >
>> > the error is while decoding the length obtained  is negative.
>> >
>>
>> One possibility is that you might be trying to decode a non-audio
>> packet.  On line 110, after you've read a packet from the file, you
>> check if your decoding context is for audio, which will always be
>> true.  What I think you want to do is instead check that the packet
>> you retrieved is associated with your audio stream and not some other
>> stream in the file.
>>
>> Something like
>>
>>     if (packet.stream_index == audioStream)
>>
>> It's possible this code worked for a .wav file if the file only had a
>> single stream containing audio data.
>>
>> Hope this helps.
>>
>> Rob
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>



-- 
with regards
Anshul
:)


More information about the Libav-user mailing list