[FFmpeg-user] Create a live video stream from a single image file

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Dec 23 03:08:19 EET 2019

Am So., 22. Dez. 2019 um 22:41 Uhr schrieb Weydson Lima <weyseal at gmail.com>:
> On 12/22/19 10:03 AM, Carl Eugen Hoyos wrote:
> > Am Sa., 21. Dez. 2019 um 22:04 Uhr schrieb Weydson Lima <weyseal at gmail.com>:
> >> I'm trying to create a live video stream from a single image. Once this
> >> image gets overwritten, a new video frame would then be created
> >> otherwise the last image would be used as the current video frame.
> >>
> >> Is there a way to accomplish that using the ffmpeg command line? I was
> >> thinking about something like this pseudo code:
> >>
> >> cat -forever source.jpg | ffmpeg -i pipe:0 udp://
> > Did you test the loop option of the image2 demuxer and its friends?
> Thanks. I looked at the loop option in the documentation before posting
> to the mailing list but wasn't sure if it was the right approach. I've
> tried the following but am unable to update the video once the source
> file changes:
> ffmpeg -f image2 -loop 1 -i source.png -f mpegts
> "udp://"

Complete, uncut console output missing.

> I tried different approaches to update source.png:
> cat new.png > source.png
> cp new.png source.png
> mv -f new.png source.png

(I just overwrote the source file with ffmpeg in my tests.)

> Apparently ffmpeg isn't refreshing source.png?

Works fine here and if I rm the file, ffmpeg exits
with an error message.

Carl Eugen

More information about the ffmpeg-user mailing list