This Python script is designed to automate the process of converting video files to the h264 codec using FFmpeg. It performs the following steps:
- Get a list of video files: Scans a specified directory for video files with extensions '.mp4', '.mkv', and '.avi'.
- Get the encoding of the files: Utilizes FFprobe to determine the video codec of each file.
- Print encoding and file count: Displays the encoding and the number of files using that encoding.
- Filter out h264 encoded files: Removes files already encoded with h264 from the list.
- Convert non-h264 files to h264: Converts non-h264 files to h264 using FFmpeg with specified parameters.
- Python 3.x
- FFmpeg installed and added to system PATH
- Copy the convert.py file to the folder containing your video files
- Open a command prompt in the directory
- Run:
python convert.py