Hi all,

sorry for replying to myself...

I am still puzzled as to what is going on with my demuxer plug-in. So far I 
have tested what happens if I use the same AVCodecContext instance in the 
libavcodec based decoder, where that context has been instantiated in the 
libavformat based demuxer. The results where the same, scrambled video.

As the next step, I have compiled ffplay on Haiku and indeed it can play 
the .mts stream just fine. The picture looks perfect. So that rules out any 
problems on Haiku as a platform, like misaligned stack and so on.

Then I have confirmed that my demuxer and ffplay use the same stream IDs. I 
noticed that ffplay has no special handling for eventual AVPrograms at all, 
it looks like it simply opens the first video stream it finds, if you don't 
specify otherwise. However, it's the same stream I want to open in my 
demuxer (index 0).

Then I simply dumped all packets for that stream into a file. Once in my 
decoder plug-in, right before feeding the packets to avcodec_decode_video() 
and once in ffplay at the same place. The files end up having the very same 
content.

However, in ffplay, the packets are *much* larger and of varying size, 
while my demuxer plug-in receives packets which are much smaller and of 
mostly constant size:

ffplay:
opening video stream index: 0
wrote 238236 bytes
wrote 130005 bytes
wrote 14501 bytes
wrote 13735 bytes
wrote 19216 bytes
wrote 19197 bytes
wrote 36135 bytes
wrote 36278 bytes

my demuxer:
wrote 165 bytes
[h264 @ 0x1803ac10]no frame!
wrote 184 bytes
[h264 @ 0x1803ac10]error while decoding MB 0 0, bytestream (-24)
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes
wrote 184 bytes

For each packet, avcodec_decode_video() is called and you can already see 
the error messages from h264 in my decoder.

So how do I end up in this situation? I followed the ffplay code and the 
only thing I am doing differently is that I setup my own ByteIOContext and 
use av_open_input_stream() instead of av_open_input_file(). Could that be 
the problem? As input buffer size I use 64K and as probe buffer size I use 
32K (also tried 512/256K respectively).

Thanks a lot for giving my any insights!

Best regards,
-Stephan
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to