Check video
Par pepin le dimanche, mai 24 2020, 16:24 - Python - Lien permanent
Pour faire un check video, une solution simple et basique est d'extraire les images toutes les "x" frames et d'en faire un montage style bobine analogique
ffmpeg -i input.mp4 -vf scale=320:240 -r 1/120 bobine_%04d.jpeg
puis on peut faire un montage horizontal de ces images avec les commandes d'imagemagick ou avec le script python suivant :
#!/usr/bin/env python3 import sys import glob from PIL import Image try: imgs = [ Image.open(i) for i in sys.argv[1:] ] except: sys.exit(0) Image.MAX_IMAGE_PIXELS = 100000000 # handling very large images widths, heights = zip(*(i.size for i in imgs)) dst_width = sum(widths) dst_height = max(heights) new_im = Image.new('RGB', (dst_width, dst_height)) new_im.paste(imgs[0],(0,0)) offset=0 for i in range(1,len(imgs),1): offset+=imgs[i-1].size[0] # update offset new_im.paste(imgs[i],(offset,0)) new_im.save('output_horizontal_montage.jpg')
Ce script est aisément modifiable pour vaire un montage vertical.