Skip to main content

ffmpeg stream to numpy arrays

Project description

ffmpeg stream to numpy arrays

# 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()

    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffmpeg_stream_to_numpy-0.10.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ffmpeg_stream_to_numpy-0.10-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file ffmpeg_stream_to_numpy-0.10.tar.gz.

File metadata

  • Download URL: ffmpeg_stream_to_numpy-0.10.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for ffmpeg_stream_to_numpy-0.10.tar.gz
Algorithm Hash digest
SHA256 32cc5b38aa65cd9ecb8d2e206457ad09e1090fc0602b6b35126e8354b7dc94b8
MD5 a1a6ba3070260a3bc96cbebb981e9961
BLAKE2b-256 7c55b9e928bfacc332685249869021beb072c90bf003e05a04885ef9fec0cf9c

See more details on using hashes here.

File details

Details for the file ffmpeg_stream_to_numpy-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for ffmpeg_stream_to_numpy-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 591801e796c8911ad2d8ae7c596bff8c0e3b830eab39924a366d61308ef5e38e
MD5 40b0c87ec307c6531f64d18e0f1d26e0
BLAKE2b-256 dcb82ca7957d7f8aaa600c5488e390e1bff8cb9543de3ca96b68ec506423f7c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page