On 22 April 2014 19:41, Luca Barbato <[email protected]> wrote: > On 22/04/14 19:49, Ben Ockmore wrote: > > Based on a suspicion I had, I looked into ways of removing the metadata > > from the FLAC file. I've found that the problem seems to be occur when > the > > FLAC file contains a picture in one of its metadata blocks. > > Ah, then it is quite simple. You are getting the cover picture as frame > and you aren't neither telling libavformat you want just the audio > stream nor you are checking that you are getting audio from the stream > you picked. > > Try to just check for the stream index or set the ->discard field to > AVDISCARD_ALL to all the other streams. > > lu > _______________________________________________ > libav-api mailing list > [email protected] > https://lists.libav.org/mailman/listinfo/libav-api >
But isn't that the point of the following line? int stream_no = av_find_best_stream(format_context,AVMEDIA_TYPE_AUDIO,-1,-1, NULL,0); Shouldn't this already be giving me the correct stream, even if there are others? I also tried setting the stream number of the packet based on the result of that function, and it didn't fix the problem. If this isn't the way to do things, how can I exclude non-audio frames from being decoded? Also, any thoughts on the "low score" frame header issue? I'm planning to mess around with the avconv source code when I next get the chance, and find out exactly why I don't see the same issues there. Hopefully if we can't find a solution here, I can get to the bottom of things that way. Thanks again for your help, Ben _______________________________________________ libav-api mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-api
