-
- def extract_image_from_video(video_input, name_output, timestamps):
- ret = "Error"
- try:
-
- index=0
- select_filter = "-filter:v \"select="
- for ttp in timestamps:
- select_filter += "\'lt(prev_pts*TB\,"+str(ttp)+")*gte(pts*TB\,"+str(ttp)+")"
- index=index+1
-
- if(index < len(timestamps)):
- select_filter += " + "
- else:
- select_filter += "\'\""
-
- print('select_filter is: '+ select_filter)
-
- print(video_input)
- print(timestamps)
- print("\n\t Extracting video frame from file {} at timestamps {}\n").format(video_input, timestamps)
- print("exiting")
-
- return ret
- except ValueError:
- return("Oops! error...")
-