Skip to main content

Python interface for nvcodec. Encode/Decode H264 with Nvidia GPU Hardware Acceleration.

Project description

NvCodec - Python

Require

  • cuda >= 11.2
  • numpy >= 1.7
  • python >= 3.6
  • gcc >= 7.5
  • make >= 4.1

Install

pip install pynvcodec

Usage

0. Init PyNvCodec

from nvcodec import VideoSource, VideoDecoder, VideoEncoder

1. Use VideoSource

source = VideoSource("rtmp://RTMP_URL")
h264_data = source.read()

2. Use VideoDecoder

decoder = VideoDecoder()
# output OpenCV format frame
frames = decoder.decode(h264_data)
# output SDL format frame
frames = decoder.decode(h264_data, 1)

3. Use VideoEncoder

encoder = VideoEncoder(width, height)
h264_data = encoder.encode(frame)

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

pynvcodec-0.0.6.tar.gz (116.6 kB view hashes)

Uploaded Source

Supported by

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