Hi. Your options are to either buffer up enough packets for the detection to > work (and emulate seek and close/open), or feed the codec directly. Feeding > the codec directly bypasses all the avformat stuff, and should be much more > efficient. Note that you don't need ByteIOContext for that, you just wrap > your data in AVPacket. The trick is correctly initializing the codec > context if you don't know the parameters. I've never done it, and could use > some hints myself. But, you can always dig through the avformat stuff and > see what codec context fields they assign. Then, grab some mpeg > specification docs and write your own detection logic. >
That is what I wanted to do - but for decoder I need the Codec context, and the only way to fill it seems to use the av_parser. Perhaps i need to feed it with more packets before it can decide? Any way to find out that it is done detecting? > > One other interesting idea is to buffer a number of packets ahead of time > (if you know that the stream has a consistent format) and then feed these > old packets through ByteIOContext until av_find_stream_info returns. then > start feeding it live packets. > > This sounds an interesting approach - any short example how to use it? I googled for it but only have found the ByteIOContext sturcture details - nothing else related to the implementation Thanks in advance. _______________________________________________ libav-user mailing list libav-user@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/libav-user