First-Time Setup
Setting up your environment correctly is crucial for efficient and high-quality video encoding. This guide ensures that you start with a clean slate and have all necessary tools configured.
Getting a Clean Slate
If you’re on Linux, you can likely skip this step, as the system setup is typically clean. However, for Windows users, it is essential to remove old or conflicting installations of VapourSynth and Python before proceeding.
Steps to Clean Up Old Installations
- Uninstall Python:
- On Windows:
- Go to
Control Panel > Programs > Programs and Features
, locate Python, and uninstall all versions.
- On Linux/macOS:
sudo apt-get remove python3
- Uninstall VapourSynth:
- On Windows:
- Navigate to
Control Panel > Programs > Programs and Features
, locate VapourSynth, and uninstall it.
- Delete any VapourSynth-related entries in the system’s
PATH
variable.
- On Linux/macOS:
sudo apt-get remove vapoursynth
- Remove Leftover Directories:
- Check and delete the following directories (on Windows):
%APPDATA%/VapourSynth
%APPDATA%/Python
%LOCALAPPDATA%/Programs/VapourSynth
%LOCALAPPDATA%/Programs/Python
- Clean Environment Variables:
- Open System Properties > Environment Variables.
- Remove any entries related to old Python or VapourSynth installations from the
PATH
variable.
- Reboot Your System:
- After cleanup, restart your computer to ensure all changes take effect.
Here’s a list of essential tools for video encoding:
- Python (v3.12 or higher): Required for running VapourSynth scripts.
- VapourSynth: A frame server for filtering and processing video files.
- Encoders:
- x264: For H.264 encoding.
- x265: For H.265 encoding.
- FFmpeg: For demuxing, remuxing, and audio processing.
- MKVToolNix: To merge audio, video, and subtitles.
- Other Utilities:
Step 1: Install Python
- Download: Obtain Python 3.12+ from python.org.
- Install: During installation, select the option to add Python to the
PATH
variable.
- Verify Installation:
python --version
pip --version
- Upgrade pip:
python -m pip install --upgrade pip
Step 2: Install VapourSynth
- Download: Get VapourSynth from its GitHub page.
- Install:
- On Windows: Run the installer and select all required components.
- On Linux/macOS
- Add the deb-multimedia Repository (Required for VapourSynth):
- Visit deb-multimedia.org for instructions specific to your distribution.
Example for Debian-based Systems:
sudo apt update
sudo apt install -y wget
wget https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
sudo apt update
- Install VapourSynth:
After setting up the repository, you can install VapourSynth using the following command:
sudo apt-get install vapoursynth
- Verify Installation:
Step 3: Install Encoders
x264
- Download: Get the latest build from VideoLAN.
- Install: Place the binary in a folder added to your system’s
PATH
.
x265
- Download: Obtain the encoder from x265’s repository.
- Install: Extract the binary and update your
PATH
.
Step 4: Install FFmpeg
- Download: Visit FFmpeg’s website.
- Install: Add the
bin
folder to your PATH
.
- Download: Get the installer from MKVToolNix’s website.
- Verify Installation:
Verifying Your Setup
- Create a VapourSynth Script:
import vapoursynth as vs
core = vs.get_core()
clip = core.ffms2.Source("example.mkv")
clip.set_output()
- Run the Script:
vspipe --y4m script.vpy - | ffplay -
- Check Output: If the video plays, your setup is complete!
With a clean slate and the tools installed, you’re ready to explore advanced filtering and encoding techniques.