Explorar o código

add debug log w 3

DevYK %!s(int64=3) %!d(string=hai) anos
pai
achega
6191ea8bb5
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      src/utils/video_similarity.cpp

+ 7 - 2
src/utils/video_similarity.cpp

@@ -52,7 +52,9 @@ int video_similarity_detection_start(long id, int force_keyframe,
         }
 
         int len = 0;
+        if (ctx->log) fprintf(ctx->log, "fingerprintFromFFAVFrame 1\n");
         const char *image_hash = fingerprintFromFFAVFrame(ctx->log, video_frame, &len);
+        if (ctx->log) fprintf(ctx->log, "fingerprintFromFFAVFrame exit \n");
         if (len > 64) {
             LOGE("size=%d \n", len);
         }
@@ -75,8 +77,9 @@ int video_similarity_detection_start(long id, int force_keyframe,
         if (ctx->log)fprintf(ctx->log, "image_hash  \n");
         if (image_hash)
             free((void *) image_hash);
-        if (ctx->log) fprintf(ctx->log, "image_hash 2 \n");
+        if (ctx->log) fprintf(ctx->log, "av_frame_free\n");
         av_frame_free(&video_frame);
+        if (ctx->log) fprintf(ctx->log, "av_frame_free 2\n");
     }
     if (ctx->log) fprintf(ctx->log, "loop exit \n");
     return 0;
@@ -206,10 +209,12 @@ const char *get_video_similarity_list(const char *inputjson) {
             sprintf(args, "/datalog/ffmpeg_opencv/%s.log", name);
             ((VideoSimilarityContext *) id)->log = fopen(args, "wb+");
             printf("args===%s \n", args);
-            fprintf(((VideoSimilarityContext *) id)->log, inputjson);
+            if (((VideoSimilarityContext *) id)->log)fprintf(((VideoSimilarityContext *) id)->log, inputjson);
         }
+        if (((VideoSimilarityContext *) id)->log)fprintf(((VideoSimilarityContext *) id)->log, "video_similarity_detection_start \n");
         video_similarity_detection_start(id, 0, AUDIO,
                                          &vs->clips);
+        if (((VideoSimilarityContext *) id)->log)fprintf(((VideoSimilarityContext *) id)->log, "video_similarity_detection_start exit \n");
         video_similarity_detection_close(id);
         ret_json = videoSimilarity2json(vs);
         delete vs;