FFmpeg, as of version 6.0, natively supports only up to 2-pass encoding when it comes to most typical codec applications like x264. A 3-pass encode isn't typically supported directly through FFmpeg because most codecs and use cases don't benefit from more than two passes. A two-pass approach is usually sufficient for balancing quality and file size, combining a first pass to gather video information and a second pass to achieve optimal encoding based on that information.
However, if you are interested in simulating what could conceptually be considered a “3-pass” process, you would essentially be performing an additional pass to further refine certain parameters or for experimental purposes. This would not be a standard approach and is generally not necessary.
Here’s an example on how you can perform a two-pass encode using FFmpeg with your specified parameters:
First pass:
ffmpeg -y -i input.mp4 -c:v libx264 -preset slow -profile:v high -level 4.0 -bf 2 -coder 1 -pix_fmt yuv420p -b:v 6000k -r 30 -g 15 -threads 8 -pass 1 -f mp4 -an -movflags +faststart -t 00:01:00.1 /dev/null
Second pass:
ffmpeg -i input.mp4 -c:v libx264 -preset slow -profile:v high -level 4.0 -bf 2 -coder 1 -pix_fmt yuv420p -b:v 6000k -r 30 -g 15 -threads 8 -pass 2 -c:a copy -movflags +faststart -t 00:01:00.1 output.mp4
Simulated "Third Pass" (experimental and usually unnecessary)
If you wanted to attempt a "third pass", it might involve re-encoding the output again to tweak very specific parts like reducing noise or adjusting bitrate further. Here’s how you might do it, though keep in mind this is not standard practice and might not provide any significant benefits:
ffmpeg -i output.mp4 -c:v libx264 -preset slower -profile:v high -level 4.0 -bf 2 -coder 1 -pix_fmt yuv420p -b:v 5500k -r 30 -g 15 -threads 8 -pass 1 -f mp4 -an -movflags +faststart -t 00:01:00.1 /dev/null
ffmpeg -i output.mp4 -c:v libx264 -preset slower -profile:v high -level 4.0 -bf 2 -coder 1 -pix_fmt yuv420p -b:v 5500k -r 30 -g 15 -threads 8 -pass 2 -c:a copy -movflags +faststart -t 00:01:00.1 final_output.mp4
This third phase is using a smaller bitrate and a different preset, hypothetically to refine the encoding, but it's likely to just add extra encoding time and potentially degrade quality due to generational loss without real benefits.
Conclusion: Multiple pass encoding is useful but typically limited to two passes. Experimenting beyond that often yields diminishing returns and can potentially degrade the video quality due to repeated compression cycles.