From 25aa12643351c69b3a5afff481aa29583acf1472 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期六, 01 四月 2017 15:32:29 +0800
Subject: [PATCH]
---
RtspFace/PL_H264Encoder.cpp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/RtspFace/PL_H264Encoder.cpp b/RtspFace/PL_H264Encoder.cpp
index 2af9e3e..68c502c 100644
--- a/RtspFace/PL_H264Encoder.cpp
+++ b/RtspFace/PL_H264Encoder.cpp
@@ -18,8 +18,8 @@
resetPTS(false),
bytesBufferImageWidth(0), bytesBufferImageHeight(0),
avc_bit_rate(1*1024*1024*8), //1Mbit
- avc_fps(25), avc_gop(25), avc_max_b_frames(0), avc_profile(FF_PROFILE_H264_MAIN),
- av_opt_preset("superfast"), av_opt_tune("")
+ avc_fps(25), avc_gop(25), avc_max_b_frames(0), avc_profile(FF_PROFILE_H264_BASELINE),
+ av_opt_preset("superfast"), av_opt_tune(""), avc_profile_str("")
{
// av_opt_tune: zerolatency
}
@@ -135,13 +135,16 @@
in->pAVCodecContext->time_base.den = in->config.avc_fps;
in->pAVCodecContext->gop_size = in->config.avc_gop;
in->pAVCodecContext->max_b_frames = in->config.avc_max_b_frames;
- in->pAVCodecContext->profile = in->config.avc_profile;
in->pAVCodecContext->pix_fmt = AV_PIX_FMT_YUV420P;
if (!in->config.av_opt_preset.empty())
av_opt_set(in->pAVCodecContext->priv_data, "preset", in->config.av_opt_preset.c_str(), 0);
if (!in->config.av_opt_tune.empty())
av_opt_set(in->pAVCodecContext->priv_data, "tune", in->config.av_opt_tune.c_str(), 0);
+ if (!in->config.avc_profile_str.empty())
+ av_opt_set(in->pAVCodecContext->priv_data, "profile", in->config.avc_profile_str.c_str(), 0);
+ else
+ in->pAVCodecContext->profile = in->config.avc_profile;
if(avcodec_open2(in->pAVCodecContext, avCodec, NULL) >= 0)
{
--
Gitblit v1.8.0