[FFmpeg-devel] MJPEG other RTP and av_find_stream_info() problem

Michael Niedermayer michaelni
Mon Feb 22 11:22:39 CET 2010

On Fri, Feb 19, 2010 at 05:32:43PM +0100, Kevin Baradon wrote:
> Hi,
> I've implemented playing of MJPEG other RTP (RTSP) streams in ffmpeg (patch 
> will be submitted when stable), but I'm facing a problem.
> In my test program, I first open stream using av_open_input_file(), and 
> then call av_find_stream_info() to retrieve stream information. But the 
> latter blocks for at least 45 seconds before showing message :
>     [rtsp @ 8317920]MAX_READ_SIZE:5000000 reached
> After that, test program correctly decodes and shows stream.
> As a workaround, I set
>     AVFormatContext::probesize = 1;
> before calling av_find_stream_info(). But I wonder if this is the right 
> thing to do.

you should figure out what in av_find_stream_info() is missing so it continues
to search for it.

> MJPEG RTP demuxer currently sets the following parameters extracted from 
> headers :
> - AVStream::codec->width
> - AVStream::codec->height
> - AVStream::codec->pix_fmt
> MJPEG other RTP don't carry frame rate information in headers. If this 
> information is needed, I can compute it using RTP packet timestamps (I 
> tried to fill AVStream::r_frame_rate with correct value without success).

if you know it fill r_frame_rate & avg_frame_rate

> Is there any other fields in AVStream structure to fill to avoid 
> av_find_stream_info() parsing stream to guess its parameters ?

read teh fine code of av_find_stream_info(), placing av_log() liberally
in there to see where it is stuck ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/2efc996e/attachment.pgp>

More information about the ffmpeg-devel mailing list