Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
A small Python module for saving and loading RGB and uint16 (depth) frames as H.264 encoded video
ffmpeg>=2.1
with libx264 enabled
conda remove ffmpeg
and conda install ffmpeg x264 -c conda-forge
ffprobe
(usually comes with ffmpeg)import numpy as np
from videoio import videosave, videoread
frames = np.random.random((20, 200, 400, 3)) # [framesNr, height, width, RGB]
# Save to video
videosave("out.mp4", frames)
# Load from video
frames = videoread("out.mp4")
from videoio import VideoReader
for frame in VideoReader("in.mp4"):
do_something_with(frame)
from videoio import VideoWriter
writer = VideoWriter("out.mp4", resolution=(400, 200)) # [width, height]
for i in range(100):
frame = get_frame()
writer.write(frame)
writer.close()
or
with VideoWriter("out.mp4", resolution=(400, 200)) as writer:
for i in range(100):
frame = get_frame()
writer.write(frame)
import numpy as np
from videoio import uint16save, uint16read
# Generate 20 random depth frames
depth_frames = (np.random.random((20, 200, 400)) * 65535).astype(np.uint16)
# Save
uint16save("out_depth.mp4", depth_frames)
# Load
depth_frames = uint16read("out_depth.mp4")
videosave("out.mp4", frames, lossless=True, preset="veryfast", fps=10.5)
frames = videoread("in.mp4", output_resolution=(100, 250))
(Works if the input video was created by videoio, other cases are not guaranteed)
frames = videoread("in.mp4", start_frame=100)
for frame in VideoReader("in.mp4", start_frame=100):
do_something_with(frame)
From pip:
pip install videoio
From source:
git clone https://github.com/vguzov/videoio.git
python setup.py install
FAQs
Module for saving and loading images and depth as H.264 video
We found that videoio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.