[FFmpeg-user] ffmpeg as an image streaming service?

Ted Park kumowoon1025 at gmail.com
Sat Mar 7 12:50:36 EET 2020


> Idea:
> Encode to h264-video with keyframes every X images, send to other
> machine, decode into images again.
> Problem:
> It takes at least 9 images before the sending side starts outputting
> anything, and the same on the receiving side, it takes quite a few
> received frames before it writes any images, and it writes them in
> batches. Why is this?

If you have one keyframe in every X images, that kind of implies X - 1 of them cannot be decoded on their own, and probably weren’t encoded on their own either. So the encoder most likely did not start writing before reading in several frames, and the decoder might not be able to get the first frame before receiving several packets. If you are going from still image at the source to still image at the destination, I doubt codecs for moving pictures will be very helpful, especially since you want each frame transmitted and received asap, adding -g 0 should force intra-only.

> Side problem:
> Without the -framerate 1 option, no output is generated at all until the
> input pipe is closed.

> I assume that all of this is frame rate related somehow. To be clear: I
> want frames transmitted and received as soon as possible, and I don't
> care at all for their timestamps, only their order.

Maybe it is trying to estimate frame rate somehow, is it possible for ffmpeg to read the files instead of stdin? Or maybe have the pipe connected to another ffmpeg process use image2 pipe out.

Ted Park

More information about the ffmpeg-user mailing list