我正在编写一个小工具,它将视频转换为原始 h264 文件。这些文件稍后将由 SIP 电话播放。我有以下代码:
eccx->pix_fmt = PIX_FMT_YUV420P;
eccx->width = VIDEO_FRAME_WIDTH;
eccx->height = VIDEO_FRAME_HEIGHT;
eccx->time_base.num = 1;
eccx->time_base.den = VIDEO_FRAMES_PER_SEC;
eccx->max_b_frames = 0;
eccx->rtp_payload_size = VIDEO_RTP_PAYLOAD_SIZE;
eccx->bit_rate = VIDEO_BIT_RATE;
eccx->rc_max_rate = VIDEO_BIT_RATE;
eccx->rc_buffer_size = VIDEO_BIT_RATE * 2;
eccx->flags |= CODEC_FLAG_QP_RD;
eccx->flags |= CODEC_FLAG_LOW_DELAY;
eccx->flags |= CODEC_FLAG_QSCALE;
eccx->flags |= CODEC_FLAG_EMU_EDGE;
eccx->mb_decision = FF_MB_DECISION_SIMPLE;
switch(video){
case H263:
break;
case H263P:
eccx->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
break;
case H264:
av_dict_set(&options, "vprofile", "baseline", 0);
eccx->flags2 = CODEC_FLAG2_FASTPSKIP;
eccx->profile = FF_PROFILE_H264_BASELINE;
eccx->level = 13;
break;
}
当我执行这个程序时,我从 libx264 得到以下输出:
[libx264 @ 0x10fad60] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
[libx264 @ 0x10fad60] profile Main, level 1.3
为什么这仍然是主要配置文件,尽管我已将其明确设置为基线?
此外,如果有人可以添加一些注释,哪种 h264 设置对 SIP 电话有用,我会非常酷。非常感谢!