Skip to content

Instantly share code, notes, and snippets.

View nik1806's full-sized avatar
🎯
Focusing

Nikhil Paliwal nik1806

🎯
Focusing
View GitHub Profile
from moviepy.video.io.VideoFileClip import VideoFileClip
import os
def extract_audio(video_path, output_audio_folder):
# Create output folder if it doesn't exist
if not os.path.exists(output_audio_folder):
os.makedirs(output_audio_folder)
# Load the video clip
video_clip = VideoFileClip(video_path)

Working with Slurm (GPU cluster)

1. Setup the working environment

  1. Download miniconda installer from https://docs.conda.io/en/latest/miniconda.html.
  2. Move to /netscratch/$USER and copy install_miniconda.sh there.
  3. Execute the file using: ./install_miniconda.sh. This will install a basic conda environment
  4. Create custom conda env: conda env create --file environment.yml.
# https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10
sudo apt install python3.10-venv
sudo apt install python3.10-dev
sudo apt install python3.10-minimal
sudo apt install python3.10-distutils
cd ~ && mkdir pyenvs && cd pyenvs