1

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 }; 
2
  • What failure? does it work on the command line for you? Commented Feb 8, 2018 at 19:02
  • Unfortunately. I have not tried it many times. @rogerdpack Commented Feb 9, 2018 at 12:51

1 Answer 1

2

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 
Sign up to request clarification or add additional context in comments.

3 Comments

my ffmpeg just works like this, but I'm doing it wrong. Do you have any other solution EXAMPLE IMAGE
@MehmetKurtgöz Have you verified that the ffmpeg command actually runs? If it does then show the complete log from the ffmpeg command. You can edit your question to include this info.
Upvoting the answer from LordNeckbeard, as always... :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.