video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-09-27 0c98249d381d6e56c78d6e752a49e768a4c4d22e
csrc/buz/recorder.cpp
@@ -74,7 +74,16 @@
            
            int pid = getpid();
            file_path_ = dir_ + "/" + sole::uuid4().base62() + "-" + std::to_string(pid) + ".mp4";
            auto ret = out_->JustWriter(in_->getStream(AVMEDIA_TYPE_VIDEO), in_->getStream(AVMEDIA_TYPE_AUDIO), file_path_.c_str());
            auto v = in_->getStream(AVMEDIA_TYPE_VIDEO);
            if (!v){
                return -2;
            }
            AVStream *a = in_->getStream(AVMEDIA_TYPE_AUDIO);
            if (!audio){
                a = NULL;
            }
            auto ret = out_->JustWriter(v, a, file_path_.c_str());
            if (ret){
                logIt("start record file: %s", file_path_.c_str());
                return 0;