Nikhil Wagh
Nikhil Wagh

Reputation: 1498

How to install package ffmpeg in google colab

I'm trying to use Google Colab to do something. Particularly I want to use ffmpeg package to create a video from a image.

But ffmpeg doesn't seems to be working fine.

The output of this (in the last block) was supposed to be 400 400 instead of 0 0

frame_width = int(cap.get(3))
frame_height = int(cap.get(4))
print frame_width, frame_height

The same code is working fine with Azure notebooks and also on my local machine.

What can be the reason for it? And how to rectify that?

Upvotes: 10

Views: 21817

Answers (2)

DanTremonti
DanTremonti

Reputation: 11

As mentioned here, the following commands worked for me:

! add-apt-repository -y ppa:savoury1/ffmpeg4
! apt-get -qq install -y ffmpeg

Upvotes: 0

korakot
korakot

Reputation: 40828

You need to install ffmpeg first:

!apt install ffmpeg

Upvotes: 16

Related Questions