[FFmpeg-user] show an image with FFplay for 5 seconds

Greg Oliver oliver.greg at gmail.com
Fri Jul 1 17:10:17 EEST 2022


On Fri, Jul 1, 2022 at 9:03 AM Michael Koch <astroelectronic at t-online.de>
wrote:

> Hello,
>
> is it possible to show an image with FFplay for 5 seconds, and then
> exit? I did try this command in a Windows batch file, but it doesn't
> stop after 5 seconds. I drag and drop the image on the batch file:
>
> ffplay -autoexit -loop 0 -t 5 %1
>
> Michael
>

Definitely not a bacth file expert (have not run Windows sine the 90's),
but under linux, you could start the video in a background thread, then a
while loop checking the time.  After the time you wish is elapsed, exit the
loop, which in turn would stop any child processes as well (the ffplay
process).  I assum MS - especially now that they have a bash emulator, etc
can do this as well.


More information about the ffmpeg-user mailing list