In [3]:
from google.colab import drive
drive.mount('/content/drive')


Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&response_type=code&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly

Enter your authorization code:
··········
Mounted at /content/drive

In [1]:
!pip install vidstab


Collecting vidstab
  Downloading https://files.pythonhosted.org/packages/27/5b/6961161c44ef0593c18fbb155ec05bf5f5084ad47d322f1b244b677724b0/vidstab-1.7.3-py2.py3-none-any.whl
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from vidstab) (1.18.1)
Collecting progress
  Downloading https://files.pythonhosted.org/packages/38/ef/2e887b3d2b248916fc2121889ce68af8a16aaddbe82f9ae6533c24ff0d2b/progress-1.5.tar.gz
Requirement already satisfied: imutils>=0.5.2 in /usr/local/lib/python3.6/dist-packages (from vidstab) (0.5.3)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from vidstab) (3.2.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->vidstab) (2.4.6)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->vidstab) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->vidstab) (1.1.0)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->vidstab) (0.10.0)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/dist-packages (from python-dateutil>=2.1->matplotlib->vidstab) (1.12.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from kiwisolver>=1.0.1->matplotlib->vidstab) (45.2.0)
Building wheels for collected packages: progress
  Building wheel for progress (setup.py) ... done
  Created wheel for progress: filename=progress-1.5-cp36-none-any.whl size=8074 sha256=ada8279fc24a8edd96dc66ccfc7ce3c1045e36781c8b104901b6a9dcf5e9f31e
  Stored in directory: /root/.cache/pip/wheels/6c/c8/80/32a294e3041f006c661838c05a411c7b7ffc60ff939d14e116
Successfully built progress
Installing collected packages: progress, vidstab
Successfully installed progress-1.5 vidstab-1.7.3

In [0]:
from vidstab import VidStab

In [5]:
#replace with your path on your Google Drive
%cd "//content/drive/My Drive/kontext/deold/"


/content/drive/My Drive/kontext/deold

In [8]:
!mkdir 1
!mkdir 2


mkdir: cannot create directory ‘1’: File exists

In [7]:
# Using defaults
for vid in ['bp3','bp4','bp5','szf']:
    stabilizer = VidStab()
    stabilizer.stabilize(input_path='raw/'+vid+'.mp4', output_path='1/'+vid+'.mp4')
    print(vid,'stabilized')


bp3 stabilized
bp4 stabilized
bp5 stabilized
szf stabilized

In [0]: