Discussion:
[FFmpeg-user] h264 presets and bitrate
maxime louvel
2010-07-15 11:28:47 UTC
Permalink
Hi,

I'm trying to encode with video presets of h264.
What I've understood is that I should use :

-vpre slow -vpre baseline

where slow is related to the quality of the output stream (hq will lead
better results for instance)
and baseline is the targeted profile, thus it set the features available to
the encoder.

But what I don't understand is at which value should I set the bitrate.
If I don't set it, it uses the default value of 200k which is way too small
(and the output stream has an higher bitrate).

Should I set the bitrate to an higher value ? something way too high ? or is
there a way to find the good value ?

thanks,

maxime
--
Maxime Louvel
+33 6 85 91 05 30
3 rue charreton
38000 Grenoble
France
Phil Rhodes
2010-07-15 11:43:05 UTC
Permalink
Post by maxime louvel
I'm trying to encode with video presets of h264.
So am I, I can never get them to work...

The only way I can get the -b parameter to work is with something like:

ffmpeg -i whatever.avi -crf 22 -b 2000k whatever.mp4

I don't really know what the presets do but some of them make it very
difficult to set bitrates - the -crf parameter has some sort of impact on
what's going on but it's difficult to characterise and doesn't seem to be
explained anywhere. I think it's a secret...

P
belcampo
2010-07-15 11:51:17 UTC
Permalink
Post by Phil Rhodes
Post by maxime louvel
I'm trying to encode with video presets of h264.
So am I, I can never get them to work...
ffmpeg -i whatever.avi -crf 22 -b 2000k whatever.mp4
I don't really know what the presets do but some of them make it very
difficult to set bitrates - the -crf parameter has some sort of impact
on what's going on but it's difficult to characterise and doesn't seem
to be explained anywhere. I think it's a secret...
When using ConstantQuality with several options will result in DIFFERENT
bitrates according to the source-file.
TalkingHeads will use very low and
Sports will use very high bitrates.

So bitrate ain't of any use given 'I want a certain quality'.
Remember however that order of options, last option may/will overide a
former one.
Post by Phil Rhodes
P
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
belcampo
2010-07-15 11:54:28 UTC
Permalink
Post by maxime louvel
Hi,
I'm trying to encode with video presets of h264.
-vpre slow -vpre baseline
It's one or the other, or partially the last vpre will override the 1st
Post by maxime louvel
where slow is related to the quality of the output stream (hq will lead
better results for instance)
and baseline is the targeted profile, thus it set the features available to
the encoder.
But what I don't understand is at which value should I set the bitrate.
If I don't set it, it uses the default value of 200k which is way too small
(and the output stream has an higher bitrate).
Should I set the bitrate to an higher value ? something way too high ? or is
there a way to find the good value ?
thanks,
maxime
Jason Garrett-Glaser
2010-07-22 22:21:04 UTC
Permalink
Post by belcampo
Post by maxime louvel
Hi,
I'm trying to encode with video presets of h264.
-vpre slow -vpre baseline
It's one or the other, or partially the last vpre will override the 1st
No, baseline is intended to be used after a normal preset -- it will
override parts of it to make it baseline-compatible.

You can and are supposed to use multiple presets.

Dark Shikari
belcampo
2010-07-23 06:36:09 UTC
Permalink
Post by Jason Garrett-Glaser
Post by belcampo
Post by maxime louvel
Hi,
I'm trying to encode with video presets of h264.
-vpre slow -vpre baseline
It's one or the other, or partially the last vpre will override the 1st
No, baseline is intended to be used after a normal preset -- it will
override parts of it to make it baseline-compatible.
You can and are supposed to use multiple presets.
But then you have to fully understand what the presets do, otherwise you
won't know in which order to place them.

belcampo
Post by Jason Garrett-Glaser
Dark Shikari
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Goga777
2010-07-23 07:21:03 UTC
Permalink
Post by belcampo
Post by Jason Garrett-Glaser
Post by belcampo
Post by maxime louvel
I'm trying to encode with video presets of h264.
-vpre slow -vpre baseline
It's one or the other, or partially the last vpre will override the 1st
No, baseline is intended to be used after a normal preset -- it will
override parts of it to make it baseline-compatible.
You can and are supposed to use multiple presets.
But then you have to fully understand what the presets do, otherwise you
won't know in which order to place them.
when does it need to use -vpre baseline and -vpre main ?
FFmichael
2010-07-25 01:26:52 UTC
Permalink
Post by Goga777
Post by belcampo
Post by Jason Garrett-Glaser
Post by belcampo
Post by maxime louvel
I'm trying to encode with video presets of h264.
-vpre slow -vpre baseline
It's one or the other, or partially the last vpre will override the
1st
Post by Jason Garrett-Glaser
No, baseline is intended to be used after a normal preset -- it will
override parts of it to make it baseline-compatible.
You can and are supposed to use multiple presets.
But then you have to fully understand what the presets do, otherwise you
won't know in which order to place them.
when does it need to use -vpre baseline and -vpre main ?
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
There are three common types of profiles: baseline, main and high.

All of the other encoding presets are quality settings whilst these three
constrain the profile.

So, to answer your question, if you use main and baseline, you will get
baseline. you should only use one of these if you need to limit your output
profile. The other way to do it is to read the specs and create your own
presets/commandlines which adhere to these profile limits. This is difficult
but rewarding if you really want to understand what you are doing. Many of
the explanations of these settings are owned by MPEG-LA so it might cost you
some money;-)

I personally think that the presets are great for the many users who do not
want to understand all of the
intricacies of what is a very complicated set of "tools" and not a single
format.

Michael

p.s. to a previous responder, middle posting is better than top posting but
still not great.
--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/h264-presets-and-bitrate-tp2289994p2301347.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.
Goga777
2010-07-15 12:44:23 UTC
Permalink
http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/

have a look please
may be it will helpful
Continue reading on narkive:
Loading...