Using FFmpeg with GPU Hardware Acceleration on Google Colab

You can install ffmpeg:

!apt install ffmpeg
!sudo apt-get install mkvtoolnix 
!pip install vcsi

Then use command like:

!ffmpeg -v error -stats -hwaccel cuvid -i input -c:v h264_nvenc -crf 17 -preset medium -max_muxing_queue_size 1024 -c:a aac -strict 2 output

Please note: Please use h264_nvenc for H264 encoding, hevc_nvenc for H265 encoding at GPU runtime or libx264 at CPU runtime.

Leave a Reply

Your email address will not be published. Required fields are marked *