{"id":45898,"library":"pynvvideocodec","title":"PyNvVideoCodec","description":"PyNvVideoCodec is NVIDIA's Python library for hardware-accelerated video encoding and decoding on NVIDIA GPUs. It wraps the NVIDIA Video Codec SDK and provides high-performance encode/decode operations directly from Python. Current version 2.1.0, requires Python >=3.8 and an NVIDIA GPU with supported drivers. Release cadence is irregular, tied to SDK updates.","status":"active","version":"2.1.0","language":"python","source_language":"en","source_url":"https://github.com/NVIDIA/pynvvideocodec","tags":["nvidia","gpu","video","encode","decode","hardware-acceleration"],"install":[{"cmd":"pip install pynvvideocodec","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for CUDA context management and memory transfers","package":"cuda-python","optional":false},{"reason":"Used for frame data arrays","package":"numpy","optional":false}],"imports":[{"wrong":"from pynvvideocodec import PyNvEncoder","symbol":"CreateDecoder","correct":"from PyNvVideoCodec import CreateDecoder"},{"wrong":"from pynvvideocodec import PyNvEncoder","symbol":"CreateEncoder","correct":"from PyNvVideoCodec import CreateEncoder"},{"wrong":"from pynvvideocodec import PyNvEncoder","symbol":"CreateTranscoder","correct":"from PyNvVideoCodec import CreateTranscoder"}],"quickstart":{"code":"from pynvvideocodec import PyNvEncoder, PyNvDecoder, EncodeConfig, DecodeConfig\nimport numpy as np\n\n# Encode example\nenc_config = EncodeConfig(\n    codec='h264',\n    width=1920,\n    height=1080,\n    framerate=30,\n    bitrate=5000000\n)\nencoder = PyNvEncoder(enc_config)\nframe = np.zeros((1080, 1920, 3), dtype=np.uint8)\nencoded = encoder.encode(frame)\n\n# Decode example\ndec_config = DecodeConfig(codec='h264', width=1920, height=1080)\ndecoder = PyNvDecoder(dec_config)\ndecoded = decoder.decode(encoded)\nprint('Success')","lang":"python","description":"Basic encode and decode a single frame. Requires an NVIDIA GPU with proper drivers."},"warnings":[{"fix":"Ensure a CUDA context is active (e.g., via cuda-python or PyTorch) before creating any PyNvEncoder or PyNvDecoder.","message":"CUDA context must be initialized before creating encoder/decoder. Failure results in segmentation fault.","severity":"breaking","affected_versions":"all"},{"fix":"Replace 'from nvidia.video_codec import ...' with 'from pynvvideocodec import ...'.","message":"The module path changed from 'nvidia.video_codec' to 'pynvvideocodec' in v2.0.0. Old imports break.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always pass an EncodeConfig to PyNvEncoder and DecodeConfig to PyNvDecoder.","message":"EncodeConfig and DecodeConfig are required; missing them causes AttributeError or silent failure.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.1.0':38 '3.8':41 'acceler':11,64 'cadenc':50 'codec':24 'current':36 'decod':15,61 'direct':33 'driver':48 'encod':13,60 'encode/decode':31 'gpu':45,58 'gpus':18 'hardwar':10,63 'hardware-acceler':9,62 'high':29 'high-perform':28 'irregular':52 'librari':7 'nvidia':4,17,22,44,57 'oper':32 'perform':30 'provid':27 'pynvvideocodec':1,2 'python':6,35,40 'releas':49 'requir':39 'sdk':25,55 'support':47 'tie':53 'updat':56 'version':37 'video':12,23,59 'wrap':20","created_at":"2026-06-07T12:57:16.696990+00:00","updated_at":"2026-06-07T12:57:16.696990+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}