video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2020-09-01 d9952f61a53b693a75490e4932d7136e14e7dc08
csrc/wrapper.cpp
@@ -45,6 +45,7 @@
    ,audio_(false)
    ,gb_(0)
    ,cpu_(0)
    ,devid_(-1)
    ,run_dec_(false)
    ,run_stream_(true)
    ,run_rec_(false)
@@ -66,6 +67,7 @@
    ,audio_(false)
    ,gb_(0)
    ,cpu_(0)
    ,devid_(-1)
    ,run_dec_(false)
    ,run_stream_(true)
    ,run_rec_(false)
@@ -108,8 +110,9 @@
        prop.url_ = input;
        prop.rtsp_tcp_ = true;
        prop.gpu_acc_ = !cpu_;
        prop.gpu_index_ = devid_;
       std::unique_ptr<FormatIn> in(new FormatIn(prop.gpuAccl()));
       std::unique_ptr<FormatIn> in(new FormatIn(prop, prop.gpuAccl()));
       int flag = -1;
        if (gb_){
            flag = in->openGb28181(input, NULL);
@@ -222,7 +225,7 @@
            bool exist = access(input_url_.c_str(), 0) == 0;
            if (exist){
                wTime <<= 1;
                wTime += wTime/2;
                file_rebootime++;
            }
@@ -233,10 +236,6 @@
                if (in->readPacket(&data->getAVPacket()) != 0){
                    logIt("read packet error, id: %lld", id);
                    break;
                }
                if (exist){
                    // 记录解码的文件有多少帧
                    file_frame++;
                }
                // 非音视频
                if (in->notVideoAudio(&data->getAVPacket())){
@@ -263,7 +262,9 @@
                id++;
                //本地文件太快sleep一下
                if (exist){
                if (exist && in->isVideoPkt(&data->getAVPacket())){
                    // 记录解码的文件有多少帧
                    file_frame++;
                    usleep(wTime);
                }