user3088260
user3088260

Reputation: 141

Encoding a live stream of bitmaps using FFMPEG

I've got a constant stream of jpeg's that need to be converted to a video (of any kind).
The problem is that the stream is virtually infinite and I don't know any method of creating videos using pictures that doesn't store the whole file in memory until the stream stops..

Is there a way that I can feed FFMPEG with bitmaps or jpegs constantly from c# or at least make ffmpeg read images from a folder with +432000 images (on the command line)?

Please note that there will be no sound, the images will be low quality, they will come at a rate ~5 FPS and this will run on a high-ish end laptop. BTW I can provide code but I assume this is unnecessary at the moment as I am only creating bitmaps and saving them.

Upvotes: 2

Views: 2582

Answers (1)

aergistal
aergistal

Reputation: 31247

Update: You could create an MJPEG stream based on the static images.

Here's a sample project written in node:

https://github.com/psanford/node-mjpeg-test-server/tree/master/resources

It would be preferable to configure the source to send MJPEG directly if possible. You could then use this stream as input and live transcode it to something else.

Command line:

From the command line you can use -pattern_type glob -i '*.jpg' or -i img%06d.jpg if your files are sequential like img000000.jpg, img000001.jpg etc.

Source and examples: FFmpeg - Create a video slideshow from images

Upvotes: 2

Related Questions