Using Ffmpeg on Android to make a video from Single image merged with an Audio file, it works but the output video is not seeking to any time stamps ex - always starts from 0:00, on seeking the video ahead it just restarts the whole video from start.

The command I used is -

 -y  -framerate  30  -i  "+ImagePath+"  -i  "+AudioPath+"  -vsync  vfr  -c:v  libx264  -codec:a  copy  -pix_fmt  yuv420p  -crf  23  "+OutputVideoPath

can this be due to single frame only? (one image in video) if so what can be used to convert a single image to seekable video.

1

There are 1 answers

4
VC.One On

This command will work to make a seekable MP4 (using input from image file and MP3 audio).

ffmpeg -y -i AUDIO.file -f image2 -loop 1 -r 2 -i IMAGE.file -shortest -c:a copy -c:v libx264 -crf 18 -framerate 30 -preset veryfast -movflags +faststart OUTPUT.mp4

Just replace AUDIO.file and IMAGE.fileand OUTPUT.mp4 with your custom file names.

Try this in your Android code:

-y -i "+AudioPath+" -f image2 -loop 1 -r 2 -i "+ImagePath+" -shortest -c:a copy -c:v libx264 -crf 18 -framerate 30 -preset veryfast -movflags +faststart "+OutputVideoPath+"

Try setting up your code like this:

"-y -i "+AudioPath+" -f image2 -loop 1 -r 2 -i "+ImagePath+" -shortest -c:a copy -c:v libx264 -crf 18 -framerate 30 -preset veryfast -movflags +faststart "+OutputVideoPath