video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2022-07-21 f346559ee07016172cab40b7fca5b2c5e09df899
csrc/wrapper.cpp
@@ -204,11 +204,22 @@
        int64_t file_rebootime = 0;
        int64_t file_frame = 0;
        using namespace std;
        const string gb_suffix[] = {"/StreamType=2", "/StreamType=3", ""};
        const size_t gb_size = sizeof(gb_suffix) / sizeof(string);
        int gs_idx = 0;
        string url = input_url_;
        while(!stop_stream_.load()){
            auto in = init_reader(input_url_.c_str());
            if (gb_){
                if (input_url_.find("/StreamType=") == string::npos)
                    url = input_url_ + gb_suffix[gs_idx];
                logIt("======>>input real url %s\n", url.c_str());
            }
            auto in = init_reader(url.c_str());
            
            if (!in) {
                logIt("ERROR: init_reader! url: %s\n", input_url_.c_str());
                logIt("ERROR: init_reader! url: %s\n", url.c_str());
                sleep(2);
                continue;
            }