# sample测试用例 这是一个简单的 DCU视频编解码Python demo用例。 ## 环境要求 - **驱动**: 与MacCodecSDK版本一致 ### 软件 - **FFmpeg**: - `MacCodecSDK` - **Python 依赖**: - `ffmpeg-python` - **docker环境**: - `基于DTK2504镜像即可,本sample使用harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk26.04-0130-py3.10-20260202` ## 安装步骤 ### 1. 安装系统级 MacCodecSDK 确保 FFmpeg 已安装,可通过ffmpeg指令验证 ### 2. 安装 Python 依赖 ```bash pip install ffmpeg-python ``` ## 使用方法 运行脚本: ```bash python benchmark_cuda.py ``` ## 输出示例 ### 成功情况 ```text --- Starting CUDA Benchmark for ./sample_1920x1080_30fps_8bit.h264 --- [1] Testing CUDA Decode... Decode Success [2] Testing CUDA Encode (H264 NVENC)... Encode Success --- Benchmark Finished --- ```