I have a camera taking pictures every ~second and saving that image to a remote network folder in YYYY-MM-DD hhmmss.jpg format (2020-12-31 232359.jpg). The filenames aren't necessarily sequential, sometimes they skip a second or two - the process isn't perfectly synced as the device can experience a CPU spike, network delay or whatever.

The goal is to later stitch the photos together with ffmpeg (I don't care of the sync isn't perfect)

ffmpeg -framerate 1 -f image2 -i "folder/%*.jpg" video.mp4

What I'm trying to do now, is to have a live stream continuously showing the latest image. I tried this (not streaming, just saving to a file for testing):

ffmpeg -framerate 1 -start_number 115522 -i "folder/%*.jpg" test.mp4

The idea would be that the stream would start at "2020-12-31 115522.jpg" (assume this is the latest image in the folder) and continue on, however when using wildcards/glob pattern -start_number doesn't actually do anything - it just grabs the first image in the directory and continues on, so I'm not even sure if this method would continuously grab the latest image to stream. Using %d for the pattern doesn't work as it requires filenames to be perfectly sequentially and any gaps result in the stream/video stopping.

I'm a bit at a loss on what to try next as ffmpeg is usually my go to for streaming/converting/etc and I can't figure out if this is even at all possible with just ffmpeg. Hopefully someone has any ideas

The computer that would stream this is running Windows 10 with WSL2, so (presumably) any Windows or Linux solutions will work (if needed I can run nodejs/python/etc). The stream itself doesn't necessarily have to be a video stream, as long as it can work on desktop and mobile in whatever fashion is perfectly fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.