Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.07k stars 1.51k forks source link

Fix GPU h264_nvenc encoding not working. #2121

Open xiaomofa opened 4 months ago

xiaomofa commented 4 months ago
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
make
sudo make install

git clone https://github.com/FFmpeg/FFmpeg.git
./configure --prefix=/usr/local/ffmpeg --enable-shared --disable-static --disable-doc  --enable-gpl --enable-libx264 --enable-cuda --enable-cuvid
make
sudo make install

ffmpeg -decoders | grep cuvid

# Transcoding h264 video with GPU
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i test.mp4 -c:v h264_nvenc  -y test-gpu.mp4

# Transcoding using CPU decoding and GPU encoding.
ffmpeg -i test.mp4 -c:v h264_nvenc -y test-gpu.mp4

Reference: https://trac.ffmpeg.org/wiki/HWAccelIntro#NVENC

coveralls commented 4 months ago

Coverage Status

coverage: 81.89% (-0.01%) from 81.904% when pulling e79854124cc70b90758a69c84b5458867b4dbef7 on xiaomofa:fix-gpu-h264_nvenc into bc8d1a831d2d1f61abfdf1779e8df95d523947a5 on Zulko:master.

Paillat-dev commented 4 months ago

I bump this 👍