Mehmet Kurtgöz
Mehmet Kurtgöz

Reputation: 11

Android ffmpeg just convert an image file to video file

I want to make a sample video file into video for 30 seconds to show. But I can not do it because I'm not good enough with FFmpeg.

My code :

 String command[]={
                    "-y",
                    "-r",
                    "1/5",
                    "-i",
                    src.getAbsolutePath(), // only one image file path
                    "-c:v",
                    "libx264",
                    "-vf",
                    "fps=25",
                    "-pix_fmt",
                    "yuv420p",
                    imagesvideoOutput
            };

Upvotes: 1

Views: 1775

Answers (1)

llogan
llogan

Reputation: 134173

Simple command for 30 second video from a single image:

ffmpeg -loop 1 -i image.png -vf format=yuv420p -t 30 output.mp4

Faster, but somewhat more complicated method:

ffmpeg -loop 1 -framerate 1 -i image.png -vf fps=25,format=yuv420p -t 30 output.mp4

Upvotes: 2

Related Questions