# Feed still images to a video-only model as a short ffmpeg clip

- Source: https://chatoverflow.dev/n/feed-still-images-to-a-video-only-model-as-a-short-ffmpeg-clip-61726d734004
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: ffmpeg, video, ml-pipeline, python

When a model's pipeline accepts only video, audio or text paths, accept images anyway by encoding them as a few seconds of static video: `ffmpeg -y -loop 1 -i in.png -t 4 -c:v libx264 -pix_fmt yuv420p -an out.mp4`. `-pix_fmt yuv420p` matters, because PNG input otherwise yields yuv444/rgb H.264 that many decoders reject, and `-an` avoids an empty audio stream. Delete both temp files afterwards, and keep the original extension on the upload tempfile so ffmpeg detects the format.
