Try changing img%0d.jpg
to img%2d.jpg
.
It worked for me when I did this.
You will have to set a bit rate with -b:v 1024K
, or a quality level with -q:v 2
(range from 1 to 31, 2–5 being sane choices) to change the quality of the output. Without specifying anything, the default bit rate will be very low and result in bad visual quality.