Hello everybody,
I already searched the archives and googled for hours and I was unable to
find a solution for the problem.
Here is what happens: I'm streaming a H264 video from (let's say...)
youtube, and feeding the stream directly to libav. When
av_find_stream_info() is called, it generates all sorts of messages and the
application crashes a little bit after failing to decode a few frames. I
pasted the error messages at the end.
Well, I was wondering if you guys have any information that could help me
solve this problem.
I used the 720P version of youtube's video_id == *di3w1yV4Ehg* for testing
purposes.
Here is what I tried: since my application successfully downloads the
stream, I dumped the data to a file and executed ffmpeg to make sure it was
ok. And yes, I am also able to play the file and watch the video with no
problems. This is the output I got:
*FFmpeg version SVN-r22215, Copyright (c) 2000-2010 the FFmpeg developers
built on Mar 4 2010 22:38:41 with gcc 4.3.3
configuration:
libavutil 50.10. 0 / 50.10. 0
libavcodec 52.55. 0 / 52.55. 0
libavformat 52.54. 0 / 52.54. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.10. 0 / 0.10. 0
Seems stream 1 codec frame rate differs from container frame rate: 59.94
(2997/50) -> 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'seek_dump.flv':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isomavc1mp42
Duration: 00:01:46.50, start: 0.000000, bitrate: 2174 kb/s
Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16, 125 kb/s
Stream #0.1(und): Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9],
2046 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc*
So we know for sure that we are dealing with 264 video and feeding the
decoder with real data from the start of the stream.
In pseudo-code, this is how we deal with libav (btw, in the real code, all
calls have safety check and none fails):
*
av_register_all();
AVFormatContext* avformat_ctx = avformat_alloc_context();
avformat_ctx->iformat = av_find_input_format("h264");
uint8_t* pb_buffer = av_malloc(4096);
avformat_ctx->pb = av_alloc_put_byte(pb_buffer, 4096, 0, &stream_handle,
ffmpeg_read_cb, NULL, NULL);
avformat_ctx->pb->is_streamed = 1;
avformat_ctx->flags |= AVFMT_NOFILE;
av_open_input_stream(&avformat_ctx, avformat_ctx->pb, "",
avformat_ctx->iformat, NULL);
av_find_stream_info(avformat_ctx);
dump_format(avformat_ctx, 0, "stream", 0);*
At this point, the program dumps...
*Input #0, h264, from 'stream':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 25 tbr, 1200k tbn, 50 tbc*
... which is not consistent with the ffmpeg output, as you can see.
I will certainly appreciate any help comming from you guys.
Thank you,
--
Karl
av_find_stream_info error messages:
*
[NULL @ 0x98d21e0]sps_id out of range
[NULL @ 0x98d21e0]non-existing PPS referenced
[h264 @ 0x98d21e0]sps_id out of range
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]no frame!
[h264 @ 0x98d21e0]non-existing PPS referenced
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]no frame!
[h264 @ 0x98d21e0]illegal POC type 31
[h264 @ 0x98d21e0]non-existing PPS referenced
[h264 @ 0x98d21e0]illegal POC type 3
[h264 @ 0x98d21e0]illegal POC type 31
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]illegal POC type 5
[h264 @ 0x98d21e0]no frame!
[h264 @ 0x98d21e0]non-existing PPS referenced
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]no frame!
[h264 @ 0x98d21e0]pps_id (-1) out of range
[h264 @ 0x98d21e0]non-existing PPS referenced
[h264 @ 0x98d21e0]pps_id (-1) out of range
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]no frame!
[h264 @ 0x98d21e0]non-existing PPS referenced
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]no frame!
[h264 @ 0x98d21e0]too many reference frames
[h264 @ 0x98d21e0]non-existing PPS referenced
[h264 @ 0x98d21e0]too many reference frames
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]no frame!
[h264 @ 0x98d21e0]illegal POC type 31
[h264 @ 0x98d21e0]missing picture in access unit
[h264 @ 0x98d21e0]illegal POC type 31
[h264 @ 0x98d21e0]slice type too large (0) at 0 0
[h264 @ 0x98d21e0]decode_slice_header error
[h264 @ 0x98d21e0]no frame!
*
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user