2,553
社区成员




static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
{
AVCodecContext *c;
AVStream *st;
int br = 100000;
st = av_new_stream(oc, 0);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
exit(1);
}
c = st->codec;
c->codec_id = codec_id;
c->codec_type = AVMEDIA_TYPE_VIDEO;
/* put sample parameters */
c->flags &= ~CODEC_FLAG_QSCALE;
c->rc_max_rate=br;
c->rc_min_rate=br;
c->bit_rate = br;
c->rc_buffer_size=br;
c->rc_initial_buffer_occupancy = c->rc_buffer_size*3/4;
c->rc_buffer_aggressivity= (float)1.0;
c->rc_initial_cplx= 0.5;
c->thread_count = 1;
/* resolution must be a multiple of two */
c->width = 352;
c->height = 288;
c->time_base.den = STREAM_FRAME_RATE;
c->time_base.num = 1;
c->gop_size = 500;
c->pix_fmt = STREAM_PIX_FMT;
c->max_b_frames = 0;
// some formats want stream headers to be separate
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
return st;
}
[libx264 @ 003D6700] Default settings detected, using medium profile
[libx264 @ 003D6700] using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisali
gn LZCNT
[libx264 @ 003D6700] profile High, level 1.3
[libx264 @ 003D6700] 264 - core 115 r2008 4c552d8 - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deb
lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m
e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro
ma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_c
ompat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 we
ightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=
0 rc_lookahead=40 rc=cbr mbtree=1 bitrate=100 ratetol=1.0 qcomp=0.60 qpmin=0 qpm
ax=69 qpstep=4 vbv_maxrate=100 vbv_bufsize=100 nal_hrd=none ip_ratio=1.40 aq=1:1
.00
if (!x4->preset)
check_default_settings(avctx);
if (x4->preset || x4->tune) {
if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) < 0)
return -1;
}