From b4c22313c0ba28bb4b4f4dad4f0a28c2161cf6d2 Mon Sep 17 00:00:00 2001 From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674> Date: 星期二, 28 二月 2017 14:36:00 +0800 Subject: [PATCH] add amcd --- RtspFace/main.cpp | 73 ++++++++++++++++++++++-------------- 1 files changed, 45 insertions(+), 28 deletions(-) diff --git a/RtspFace/main.cpp b/RtspFace/main.cpp index bbedf4d..0ab3414 100644 --- a/RtspFace/main.cpp +++ b/RtspFace/main.cpp @@ -14,8 +14,9 @@ #include "PL_DlibFaceTrack.h" #include "logger.h" +#include <iostream> -Logger g_logger(stdout); +Logger g_logger(std::cout); int main(int argc, char** argv) { @@ -27,6 +28,7 @@ PipeLine::register_global_elem_creator("PL_RTSPServer", create_PL_RTSPServer); PipeLine::register_global_elem_creator("PL_H264Decoder", create_PL_H264Decoder); PipeLine::register_global_elem_creator("PL_AVFrameYUV420", create_PL_AVFrameYUV420); + PipeLine::register_global_elem_creator("PL_AVFrameBGRA", create_PL_AVFrameBGRA); PipeLine::register_global_elem_creator("PL_H264Encoder", create_PL_H264Encoder); PipeLine::register_global_elem_creator("PL_Queue", create_PL_Queue); PipeLine::register_global_elem_creator("PL_Scale", create_PL_Scale); @@ -75,8 +77,8 @@ { PL_Scale_Config config; - config.toWidth = 800; - config.toHeight = 600; + config.toWidth = 480; + config.toHeight = 360; PL_Scale* ple = (PL_Scale*)pipeLine.push_elem("PL_Scale"); bool ret = ple->init(&config); if (!ret) @@ -85,13 +87,25 @@ exit(EXIT_FAILURE); } } - + { - SensetimeFaceTrackConfig config; - //config.generate_face_feature = true; - PL_SensetimeFaceTrack* ple = (PL_SensetimeFaceTrack*)pipeLine.push_elem("PL_SensetimeFaceTrack"); - ple->init(&config); + PL_AVFrameBGRA_Config config; + config.convertTo = PL_AVFrameBGRA_Config::I420_TO_ARGB8888; + PL_AVFrameBGRA* ple = (PL_AVFrameBGRA*)pipeLine.push_elem("PL_AVFrameBGRA"); + bool ret = ple->init(&config); + if (!ret) + { + LOG_ERROR << "PL_AVFrameBGRA.init error" << std::endl; + exit(EXIT_FAILURE); + } } + + //{ + // SensetimeFaceTrackConfig config; + // //config.generate_face_feature = true; + // PL_SensetimeFaceTrack* ple = (PL_SensetimeFaceTrack*)pipeLine.push_elem("PL_SensetimeFaceTrack"); + // ple->init(&config); + //} //PipeLine pipeLine2; //{ @@ -126,26 +140,29 @@ // } //} - { - PL_H264Encoder_Config config; - PL_H264Encoder* h264Encoder = (PL_H264Encoder*)pipeLine.push_elem("PL_H264Encoder"); - bool ret = h264Encoder->init(&config); - if (!ret) - { - LOG_ERROR << "PL_H264Encoder.init error" << std::endl; - exit(EXIT_FAILURE); - } - } - - { - PL_RTSPServer* rtspServer = (PL_RTSPServer*)pipeLine.push_elem("PL_RTSPServer"); - bool ret = rtspServer->init(nullptr); - if (!ret) - { - LOG_ERROR << "rtspServer.init error" << std::endl; - exit(EXIT_FAILURE); - } - } + //{ + // PL_H264Encoder_Config config; + // config.av_opt_preset = "superfast"; + // config.av_opt_tune = "zerolatency"; + // config.avc_profile_str = "baseline"; + // PL_H264Encoder* h264Encoder = (PL_H264Encoder*)pipeLine.push_elem("PL_H264Encoder"); + // bool ret = h264Encoder->init(&config); + // if (!ret) + // { + // LOG_ERROR << "PL_H264Encoder.init error" << std::endl; + // exit(EXIT_FAILURE); + // } + //} + // + //{ + // PL_RTSPServer* rtspServer = (PL_RTSPServer*)pipeLine.push_elem("PL_RTSPServer"); + // bool ret = rtspServer->init(nullptr); + // if (!ret) + // { + // LOG_ERROR << "rtspServer.init error" << std::endl; + // exit(EXIT_FAILURE); + // } + //} while(true) { -- Gitblit v1.8.0