/colab-ffmpeg-cuda

FFmpeg build with CUDA support for Linux (especially for Google Colab)

Primary LanguageShell

colab-ffmpeg-cuda

FFmpeg build with CUDA support for Ubuntu (especially for Google Colab) with pre-built required binaries.


Set Up

Important: You have to change the runtime type and use GPU hardware accelerator. If you have not done it, check it below:

  1. Clone the repository
# You need to prepend a `!` to execute a shell command in Goole Colab or Jupyter
!git clone https://github.com/fritolays/colab-ffmpeg-cuda.git
  1. Copy all the pre-built binaries from ./colab-ffmpeg-cuda/bin/ to /usr/bin/ (Recommended)
!cp -r ./colab-ffmpeg-cuda/bin/. /usr/bin/
  1. Check the installed ffmpeg version
!ffmpeg -version
# Congratulations, ffmpeg with cuda support is installed!

Is it not working?

If you are having trouble with the pre-built binaries, buid the binaries from scratch (It may take more than half an hour)

!chmod +x ./colab-ffmpeg-cuda/build
!./colab-ffmpeg-cuda/build --build

There you go, ffmpeg with the required binaries should be installed to /usr/bin.


Change Runtime Type (Hardware Accelerator)

  1. Go to Runtime on top-left options

Goto runtime

  1. Then go to Change runtime type

Goto runtime -> Change runtime type

  1. Set Hardware accelerator type to GPU

Goto runtime -> Change runtime type -> Set hardware accelerator type to GPU