Empty3.app

septembre 2024
L M M J V S D
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Empty3 graphics library, calculator, image featuring app Rich features: The library offers a wide range of features for 3D rendering, including modeling, texturing, and lighting.

bonjour

tag

hello

 hallo

Encoder vos vidéos frame après frame, en Python

Bienvenue sur le site web des projets empty3.
Il y a beaucoup de références au sujet du nom du site, ici il s’agit de projets informatiques : bibliothèques, applications Java Desktop, mobile Android.
1 ) empty3-library-3d : bibliothèques de modélisation 3d et d’effets 2d pour les images et webcam, éventuellement à l’avenir vidéos.
2) Image Featuring FeatureApp : application Android de traitement d’images.

Le script:

import cv2
import numpy as np
import glob

img_array = []

# size = (1920, 1080)
# size = (1600, 720)
size = (320, 240)

frame = 0

filename_video_output = "cat01.avi"

print("Directory : ")
#filename = input()


#filename = filename.replace("\\", "\\\\")
print("Video name : ")
#filename_video_output = input()

# out = cv2.VideoWriter(filename_video, cv2.VideoWriter_fourcc(*'DIVX'), 50, size)

filename = ("C:\\Users\\manue\\EmptyCanvasTest\\one.empty3.tests.coursecheval.TestChatHumain\\FICHIERS_2024-02-05-20-51-20"+
            "\\*.JPG")
#filename = filename.replace("\\", "\\\\")

for filename_img in glob.glob(filename):
    img = cv2.imread(filename_img)
    if type(img) is not None:
        h, w, c = img.shape
        size = (w, h)

out = cv2.VideoWriter("output\\"+filename_video_output, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'), 30, size)

print("Construction du tableau d'images")

for filename_img in glob.glob(filename):
    img = cv2.imread(filename_img)
    if type(img) is not None:
        print("Frame ajoutée dans tableau" + filename_img)
        frame = frame + 1
        try:
            out.write(img)
        except:
            print("Image non correcte")

        print("Frame " + str(frame) + " encodée.")

out.release()

print("Terminé.")

print(filename_video_output)