According to the documentation for using Two-Pass method we have to run ffmpeg twice like this:

ffmpeg -y -i input -c:v libx264 -b:v 2600k -pass 1 -an -f mp4 /dev/null && \
ffmpeg -i input -c:v libx264 -b:v 2600k -pass 2 -c:a aac -b:a 128k output.mp4

But When I use these codes I get this error:

Unable to find a suitable output format for '&&'

And Android doesn't recognize "&& \" as an argument for ffmpeg or ffmpeg doesn't recognize such a thing on Android!

Could somebody tell me how I should do 2-Pass encoding on Android with FFmpeg?

migrated from superuser.com Dec 22 '18 at 20:43

This question came from our site for computer enthusiasts and power users.

  • Remove the && and execute the two commands one after another. – Gyan Dec 22 '18 at 7:38
  • @Gyan if I remove && then it says "Unable to find a suitable output format for '\' " and if I remove \ it says "ratecontrol_init: can't open stats file" – MSH Dec 22 '18 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy