Spaces:
Sleeping
Sleeping
Download test/test_writer.py from AutoFramingSoftware/afs-backend: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/spaces/AutoFramingSoftware/afs-backend/resolve/main/test/test_writer.py
- Command line
-
hf download hf://spaces/AutoFramingSoftware/afs-backend/test/test_writer.py
-
curl -L -o test_writer.py https://huggingface.co/spaces/AutoFramingSoftware/afs-backend/resolve/main/test/test_writer.py
363 Bytes
| import cv2 | |
| import numpy as np | |
| try: | |
| fourcc = cv2.VideoWriter_fourcc(*'avc1') | |
| out = cv2.VideoWriter('test_avc1.mp4', fourcc, 5.0, (640, 480)) | |
| for i in range(10): | |
| frame = np.random.randint(0, 255, (480, 640, 3), dtype=np.uint8) | |
| out.write(frame) | |
| out.release() | |
| print("avc1 SUCCESS") | |
| except Exception as e: | |
| print(f"FAILED: {e}") | |