video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-11-13 64fed650d429fdbdfa4011956a2c057dd0348914
libcffmpeg.c
@@ -153,12 +153,12 @@
}
// for encoder
cencoder wrap_fn_create_encoder(void *lib, const int w, const int h, const int fps, const int br, const int scale_flag, const int gi){
cencoder wrap_fn_create_encoder(void *lib, const int w, const int h, const int fps, const int br, const int scale_flag, const int gi, const int fmt, const char *file){
    if (!fn_create_encoder){
        fn_create_encoder = (lib_cffmpeg_create_encoder)dlsym(lib, "c_ffmpeg_create_encoder");
        release_if_err(fn_create_encoder, lib);
    }
    return fn_create_encoder(w, h, fps, br, scale_flag, gi);
    return fn_create_encoder(w, h, fps, br, scale_flag, gi, fmt, file);
}
void wrap_fn_destroy_encoder(void *lib, const cencoder h){
@@ -177,7 +177,7 @@
    
    uint8_t *out = NULL;
    const int flag = fn_encode(hdl, (uint8_t*)in, w, h, &out, out_size, key);
    if (flag > 0 && out != NULL) {
    if (flag == 0 && out != NULL) {
        return out;
    }
    *out_size = 0;