Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansalemaos/ffmpeg_stream_to_numpy
ffmpeg stream to numpy arrays
https://github.com/hansalemaos/ffmpeg_stream_to_numpy
cv2 ffmpeg numpy python stream video
Last synced: 5 days ago
JSON representation
ffmpeg stream to numpy arrays
- Host: GitHub
- URL: https://github.com/hansalemaos/ffmpeg_stream_to_numpy
- Owner: hansalemaos
- License: mit
- Created: 2022-12-29T16:30:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-29T16:30:26.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T22:14:11.553Z (about 1 month ago)
- Topics: cv2, ffmpeg, numpy, python, stream, video
- Language: Python
- Homepage: https://pypi.org/project/ffmpeg-stream-to-numpy/
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# ffmpeg stream to numpy arrays
```python
# ffmpeg must be installed!
$pip install ffmpeg-stream-to-numpy
from ffmpeg_stream_to_numpy import NumpyVideo
import cv2
vi = NumpyVideo(
videofile=r"C:\Users\Gamer\Videos\dfbs4.mp4",
ffmpeg_param=(
"-re", # real speed
"-hwaccel",
"cuda",
"-c:v",
"h264_cuvid",
),
)for ini, i in enumerate(vi.play_video_ffmpeg()):
# do something here
cv2.imshow("test", i)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
if ini == 100:
vi.playvideo = False # stops the stream
cv2.destroyAllWindows()
```