video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2020-03-25 01d9022b47e5e20f39ca1115d334c43774378dfc
csrc/wrapper.cpp
@@ -234,6 +234,10 @@
                    logIt("read packet error, id: %lld", id);
                    break;
                }
                if (exist){
                    // 记录解码的文件有多少帧
                    file_frame++;
                }
                // 非音视频
                if (in->notVideoAudio(&data->getAVPacket())){
                    continue;
@@ -261,8 +265,6 @@
                //本地文件太快sleep一下
                if (exist){
                    usleep(wTime);
                    // 记录解码的文件有多少帧
                    file_frame++;
                }
            }
@@ -271,13 +273,17 @@
            if (exist) {
                // 三次一帧都没解出来,退出
                if (file_frame == 0 && file_rebootime < 3){
                    logIt("libcffmpeg.so-> run %lld time, current frames %lld", file_rebootime, file_frame);
                    continue;
                }
                // 最小需要解出多少帧
                if (file_frame < min_duration_ * fps_){
                    logIt("libcffmpeg.so-> run %lld time, current frames %lld, mind %d, fps: %d",
                     file_rebootime, file_frame, min_duration_, fps_);
                    continue;
                }
                logIt("libcffmpeg.so-> local file %s run %lld time, all frames %lld", input_url_.c_str(), file_rebootime, file_frame);
                logIt("libcffmpeg.so-> local file %s run %lld time, all frames %lld, mind %d, fps: %d",
                    input_url_.c_str(), file_rebootime, file_frame, min_duration_, fps_);
                file_finished_ = true;
                break;
            }