video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-09-26 1f005df2f3ff78458f332f9bf1cf2e78b6a8e8e4
csrc/buz/recorder.cpp
@@ -72,13 +72,16 @@
            out_ = new FormatOut(in_->getFPS(), "mp4");
            
            file_path_ = dir_ + "/" + sole::uuid4().base62() + ".mp4";
            auto ret = out_->JustWriter(in_->getFromatContext(), file_path_.c_str());
            int pid = getpid();
            file_path_ = dir_ + "/" + sole::uuid4().base62() + "-" + std::to_string(pid) + ".mp4";
            auto ret = out_->JustWriter(in_->allStreams(), file_path_.c_str());
            if (ret){
                logIt("start record file: %s", file_path_.c_str());
                return 0;
            }
            logIt("failed to start record: %s", file_path_.c_str());
            return -1;
        }