0
ffmpeg -y -loop 1 -i '$inputFile' -f lavfi -i anullsrc=r=44100:cl=stereo -vf "scale=1280:720" -c:v libx264 -pix_fmt yuv420p -c:a aac -strict experimental -t $seconds -crf 28 -preset ultrafast '$outputFile'

I am using above command to create a silent audio or music video using FFMPEG, this command is working fine to do so, but taking a long processing time, For 3second video creation it is taking 20+ seconds in android devices i found -loop 1 is indefinite loop that is making to take more time.

I need some helpful suggestion to optimise the results of processing. Moreover, I required silent sound too.

I tried different commands but they are not supporting both the functionality of silent and time frame.

2
  • 2
    1. Try reducing the video framerate: For example add -r 1 before the first -i for creating 1fps video. (less frames to encode reduces the processing time). 2. Instead of using scale filter, create a 1280x720 PNG input image from advanced (save the scaling time - the filter scales every frame).
    – Rotem
    Commented Sep 30, 2023 at 20:33
  • Rotem Thank you, I never thought about -r 1 or found in my searches, and applies a many commands. it helps me a lot. Commented Oct 2, 2023 at 11:13

0

You must log in to answer this question.

Browse other questions tagged .