[libav-api] How to pack h264 RTSP stream into flv container?

Kulti kultihell at gmail.com
Wed Mar 30 15:27:16 CEST 2011


Hi, all.

I can successfully receive h264 rtsp stream, then decode and encode it
to h264 again, then write to flv container. But when I try to write
received AVPacket to flv container without decoding/encoding - the
output file cannot be played. VLC outputs the following errors:


[h264 @ 0xb0b0d5b0] QP 120 out of range
[h264 @ 0xb0b0d5b0] decode_slice_header error
[h264 @ 0xb0b0d5b0] concealing 4000 DC, 4000 AC, 4000 MV errors
[h264 @ 0xb0b0d5b0] deblocking_filter_idc 32 out of range
[h264 @ 0xb0b0d5b0] decode_slice_header error
[h264 @ 0xb0b0d5b0] concealing 4000 DC, 4000 AC, 4000 MV errors
[h264 @ 0xb0b0d5b0] illegal memory management control operation 32
[h264 @ 0xb0b0d5b0] top block unavailable for requested intra mode at 6 0
[h264 @ 0xb0b0d5b0] error while decoding MB 6 0
[h264 @ 0xb0b0d5b0] number of reference frames exceeds max (probably
corrupt input), discarding one
.....
etc

I read some documentation and found, that av_write_frame must receive
AVPacket with one video frame, but av_read_frame read one video frame
too. Also I've try to start writing from packet with flag
AV_PKT_FLAG_KEY.

At now I cannot understand, what I'm doing wrong...


More information about the libav-api mailing list