How to select x264 preset when do ffmpeg 2-pass encoding is helpful for quality ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to select x264 preset when do ffmpeg 2-pass encoding is helpful for quality ?

littlebat
Hi,

I read the 2-pass encoding guide at:
https://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide#twopass

I found the guide use commands below as a two-pass example:

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

A question: If a slower preset is helpful for the quality at a
specified bitrate when do a 2-pass encoding with libx264 encoder?

For example: select "ultrafast" in pass 1 and "veryslow" in pass 2, or,
select "ultrafast" for both 2 passes?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: How to select x264 preset when do ffmpeg 2-pass encoding is helpful for quality ?

Lou Logan
On Mon, 7 Oct 2013 19:04:36 +0800
littlebat <[hidden email]> wrote:

> A question: If a slower preset is helpful for the quality at a
> specified bitrate when do a 2-pass encoding with libx264 encoder?

Sorry, but I don't quite understand the question.

> For example: select "ultrafast" in pass 1 and "veryslow" in pass 2, or,
> select "ultrafast" for both 2 passes?

You should use the same preset for both passes to avoid errors such as:
[libx264 @ 0x20ac580] different weightp setting than first pass (1 vs 2)

Note that the first pass should have "turbo" settings applied (disable
slower options generally not useful for first pass) unless x264 option
--slow-firstpass is used (maybe there are some exceptions).
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: How to select x264 preset when do ffmpeg 2-pass encoding is helpful for quality ?

littlebat
On Mon, 7 Oct 2013 09:43:27 -0800
Lou <[hidden email]> wrote:

> On Mon, 7 Oct 2013 19:04:36 +0800
> littlebat <[hidden email]> wrote:
>
> > A question: If a slower preset is helpful for the quality at a
> > specified bitrate when do a 2-pass encoding with libx264 encoder?
>
> Sorry, but I don't quite understand the question.

For example, a given video bitrate is 1024kbps, when do only one-pass
encoding, we select a slower preset will gain a better quality. But,
when I do the 2-pass encoding, if I select a slower preset in both the
first and second pass, if will I can still gain a better quality than
we use a faster preset in both the first and second pass? Or, the preset
is no influence on the quality in a 2-pass encoding?

I read the FFMpeg wiki page:
https://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide#twopass
It seems don't clarify this question.


> > For example: select "ultrafast" in pass 1 and "veryslow" in pass 2,
> > or, select "ultrafast" for both 2 passes?
>
> You should use the same preset for both passes to avoid errors such
> as: [libx264 @ 0x20ac580] different weightp setting than first pass
> (1 vs 2)
>
> Note that the first pass should have "turbo" settings applied (disable
> slower options generally not useful for first pass) unless x264 option
> --slow-firstpass is used (maybe there are some exceptions).
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user