1

When I try to encode a video file with a two pass in ffmpeg, the output file of the first pass is empty using vp9. Hence I can not proceed with the second part.

Code for the two-pass:

1.pass:

ffmpeg -y -s:v 3840x1920 -framerate 30 -i video_framerate_resolution.yuv -c:v libvpx-vp9 -crf 20
-pass 1 -an -f avi NULL && \

2.pass

ffmpeg -s:v 3840x1920 -framerate 30 -i video_framerate_resolution.yuv -c:v libvpx-vp9
-pass 2 -b:v 1000K -f avi out.avi

Any help would be greatly appreciated. Thanks.

MrTomHat
  • 25
  • 4

1 Answers1

2

You don't need to generate a file for the first pass. The purpose is simply to send the frames to the encoder so that it can log stats. However, you should skip the muxer.

So, Pass 1

ffmpeg -s:v 3840x1920 -framerate 30 -i video_framerate_resolution.yuv -c:v libvpx-vp9 -b:v 1000k -pass 1 -an -f null -

Pass 2

ffmpeg -s:v 3840x1920 -framerate 30 -i video_framerate_resolution.yuv -c:v libvpx-vp9 -pass 2 -b:v 1000K out.avi
Gyan
  • 85,394
  • 9
  • 169
  • 201
  • Thanks for the reply! I have tried your code, but the same yellow message appears again in the first pass: 'Output file is empty, nothing was encoded'. If I ignore it and proceed with the second part a red error message occur: 'Option framerate not found' – MrTomHat Jun 29 '17 at 14:50
  • Ah. The first is a warning, not an error. Ignore it. For the second, add `-f rawvideo` before `-i`. If it still doesn't work, paste the full console for pass 2. Add `-report` to log it. – Gyan Jun 29 '17 at 15:02