I haven't needed to encode anything, but I'm pretty sure that you need to write the header to your file before you start encoding your data. There is a separate call to write the header (I don't know what it is called, but I've seen it before in the Doxygen docs).<br>
<br><div class="gmail_quote">On Wed, Mar 30, 2011 at 3:49 AM, Kulti <span dir="ltr"><<a href="mailto:kultihell@gmail.com">kultihell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi, all.<br>
<br>
I can successfully receive h264 rtsp stream, then decode and encode it<br>
to h264 again, then write to flv container. But when I try to write<br>
received AVPacket to flv container without decoding/encoding - the<br>
output file cannot be played. VLC outputs the following errors:<br>
<br>
<br>
[h264 @ 0xb0b0d5b0] QP 120 out of range<br>
[h264 @ 0xb0b0d5b0] decode_slice_header error<br>
[h264 @ 0xb0b0d5b0] concealing 4000 DC, 4000 AC, 4000 MV errors<br>
[h264 @ 0xb0b0d5b0] deblocking_filter_idc 32 out of range<br>
[h264 @ 0xb0b0d5b0] decode_slice_header error<br>
[h264 @ 0xb0b0d5b0] concealing 4000 DC, 4000 AC, 4000 MV errors<br>
[h264 @ 0xb0b0d5b0] illegal memory management control operation 32<br>
[h264 @ 0xb0b0d5b0] top block unavailable for requested intra mode at 6 0<br>
[h264 @ 0xb0b0d5b0] error while decoding MB 6 0<br>
[h264 @ 0xb0b0d5b0] number of reference frames exceeds max (probably<br>
corrupt input), discarding one<br>
.....<br>
etc<br>
<br>
I read some documentation and found, that av_write_frame must receive<br>
AVPacket with one video frame, but av_read_frame read one video frame<br>
too. Also I've try to start writing from packet with flag<br>
AV_PKT_FLAG_KEY.<br>
<br>
At now I cannot understand, what I'm doing wrong...<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Spencer Graffe<br>- A Guy<br>