FFmpeg parameter settings, avcodeccontext settings, h264 Profile

Source: Internet
Author: User

C-> profile = ff_profile_h1__main;

 

FFMPEG and x264 Encoding Guide parameter description: http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide

Preset is related to encoding speed and quality

Av_opt_set (c-> priv_data, "preset", "slow", 0); current presets in descending order of speed are:Ultrafast,Superfast,Veryfast,Faster,Fast,Medium,Slow,Slower,Veryslow,Placebo.

Priv_data belongs to the setting domain specific to each encoder and is set with av_opt_set.

 

How to Set fixed bit rate encoding

CBR (constant bit rate)

There is no native CBR mode, but you can "simulate" a constant bit rate setting by tuning the parameters of ABR, like

ffmpeg -i input -c:v libx264 -b:v 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v

In this example,-BufsizeIs the "Rate Control Buffer" so it will enforce your requested "average" (4000 K in this case) When SS each 1835 K worth of video. so basically it is assumed that the receiver/end player will buffer that much data so it's OK to fluctuate within that much.

Of course, if it's all just empty/black frames then it will still serve less than that has bits/s (but it will raise the quality level as much as it can, up to the CRF level ).

 

Only setting bit_rate is the average bit rate, which may not be controlled

C-> bit_rate = 400000;
C-> rc_max_rate = 400000;
C-> rc_min_rate = 400000;

[Libx264 @ 00c70be0] vbv maxrate specified, but no bufsize, ignored

Set C-> rc_buffer_size = 200000.

After such control, the encoding quality is obviously poor...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.