I've seen a number of 2-pass encode examples and they often use the -an switch on the first pass. This seems to be because on the first pass only video data is sampled for the log file used by the second pass to create a more efficient encoding. I noticed this switch again when answering this question and I'm wondering if there is any effect whatsoever in using this switch on the first pass of a 2 pass encode.
Any effect at all?
Yes. Using the -an switch causes ffmpeg to skip processing the audio stream.
Any positive benefit?
Yes there is a measurable decrease in processing time.. I took a 60 second mp4 source clip to use for testing and issued the command
time ffmpeg -i input.mp4 -y -an -c:v libvpx -quality best -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 4 -pass 1 -f webm /dev/null
I obtained the following output:
Output file is empty, nothing was encoded
and then renamed the resulting log file an.log for comparison later.
I ran the command again without the -an switch as in
time ffmpeg -i input.mp4 -y -c:v libvpx -quality best -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 4 -pass 1 -f webm /dev/null
The resulting output was:
So it looks like it's a little bit faster to run the first pass with the -an
Any change to the 1st pass log file? No. As expected the log files are identical as running
diff
on them proves.