[FFmpeg-devel] MJPEG FPS

Moritz Barsnick barsnick at gmx.net
Wed Aug 14 17:01:03 EEST 2019


On Wed, Aug 14, 2019 at 11:23:09 +0200, Daniel Kučera wrote:
> I'm trying to lower the latency when playing mjpeg multipart http
> stream and I came to this line:
> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/mpjpegdec.c#L157
>
> Does it mean each mjpeg stream is decoded as 25FPS?

Yes.

> Is this desired feature?

Probably. I believe every demuxer needs to provide an fps (does it?).
mpjpeg can't determine an fps, and needs to guess. Actually, it doesn't
even get timestamps from the source.

So either you provide the correct fps for a stream which originates as
CFR, or you use "-use_wallclock_as_timestamps 1" when capturing from
HTTP (and possibly "-vsync vfr") to cover unknown or VFR rates. (My
mpjpeg sources are true VFR, they switch between e.g. 1 and 5 fps, plus
the incoming jitter via HTTP.)

Moritz


More information about the ffmpeg-devel mailing list