counter_enter_out = 0; #We know that the segments are in order, so we need to check they match and no match of the file names then our algorithm is more efficient
for k in range(len(file_segments_data['f2'])):
if orginal_video_name[:-4] in file_segments_data['f2'][k].decode('utf-8'):
if counter_enter_out == 0:
counter_enter_out = 1;
...
if counter_enter_out == 1:
break;
In the _videosegmentation function, you try to use a flag variable counter_enter_out to indicate whether segmentation for current video are over or not. However, above implementation is wrong and only the first video clip will be segmented from the video.
The correct way can be like this (i.e., you missed a else branch to break the for loop for the first if condition):
counter_enter_out = 0; #We know that the segments are in order, so we need to check they match and no match of the file names then our algorithm is more efficient
for k in range(len(file_segments_data['f2'])):
if orginal_video_name[:-4] in file_segments_data['f2'][k].decode('utf-8'):
if counter_enter_out == 0:
counter_enter_out = 1;
...
else:
if counter_enter_out == 1:
break;
In the _videosegmentation function, you try to use a flag variable
counter_enter_out
to indicate whether segmentation for current video are over or not. However, above implementation is wrong and only the first video clip will be segmented from the video.The correct way can be like this (i.e., you missed a
else
branch to break thefor
loop for the firstif
condition):