How to download and cut tournament videos with mpv:

Written by Jed for Modern Tetris Organizing

Hey. This is a guide on how to download and cut/clip your tournament videos. This guide assumes you're on Windows and don't have mpv/ffmpeg. This guide also works with Mac and Linux, let me know if I should make a guide for those systems. Check out the "Why" section if you want to know why I am making you install all this stuff. Everything provided is free and open source software. If you're concerned about the programs, you can review the code yourself (Links to the programs are embedded in the "Why" section).

Let's begin.

START OF GUIDE

Setup

  1. Install Chocolatey:
    1. Search for Windows PowerShell on your computer, right click on the program and run it as an administrator(Visual example)
    2. Paste the following command in PowerShell: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    3. Wait for the program to install. If prompted, type and enter "Y".
    This will install Chocolatey, which is a tool that will help us with then next step. You can close PowerShell if you'd like.
  2. Open the Command Prompt (cmd) as an administrator and paste the commands (Installing required programs):
    1. Type cmd in Windows search, right click on the program and run it as an administrator (Visual example)
    2. Paste the following command: choco feature enable -n=allowGlobalConfirmation && choco install ffmpeg && choco install mpv (REQUIRED - Type this one first. Type "Y" if prompted).
    Once the programs are installed, you can close Command Prompt if you'd like.
  3. Download and install the video cutting script (cut-video.lua and input.conf)
    1. Download cut-video.zip: Click here to download
    2. Search for mpv on your Windows Search bar, right click on the program and open file location (Visual Example. This will open up your mpv folder
    3. Move cut-video.zip to the mpv folder and extract its contents there. The folder script and the file input.conf should now be in your mpv folder. You can delete cut-video.zip after extraction if you'd like
  4. Setup is done

Downloading VODs

Twitch

  1. Download the latest version of TwitchDownloader: Click here to access the download page. (Download the file that says TwitchDownloaderGUI-[VersionNumber]-Windows-x64.zip)
  2. Extract the zip file to a folder of your choosing
  3. Open TwitchDownloaderWPF.exe and click on the blue VOD Download button
  4. Find the link to the VOD you want to download (for example, here is the link for the TETR.IO Cup 15 VOD)
  5. Paste the link of the VOD you want to download in the VOD Link/ID section.
  6. Click the Get Info button and choose the highest quality possible
  7. Click Download and the VOD will begin to download

YouTube

  1. Download the latest version of MediaDownloader: Click here to access the download page. (Download the file that says MediaDowloader-[VersionNumber].setup.exe)
  2. Run the MediaDowloader-[VersionNumber].setup.exe file and install MediaDownloader
  3. Open MediaDownloader
  4. Find the link of the VOD you want to download (for example, here is the link for the TETR.IO Cup 15 korean restream VOD)
  5. Paste the link of the VOD you want to download in the Enter URL section
  6. Click the Download button and the video will begin to download

Cutting Videos

  1. Open the VOD in mpv
  2. Move to where you want your clip to start
  3. Press Control + Left Arrow. A yellow prompt called Start will appear (Visual Example)
  4. Move to where you want your clip to end
  5. Press Control + Right Arrow. A yellow prompt called End will appear (Visual Example)
  6. Press Control + Enter to clip the video. A yellow prompt called Processing will appear. Once the prompt disappears, the video is clipped.
  7. The video will be exported to the folder that you opened the VOD from. The default video title convention is [Video name]_[Start Time]-[End Time].[extension]. For example, if I have a video file called tc15.mp4 and I have a start time of 03:33:02 and 03:50:20, then the video will be called tc15_03.33.02-03.50.20.mp4.
  8. That's it. The script will reset back to normal after the clip is exported. Cut as many times as you wish!

END OF GUIDE

No need to read anything beyond here if you have followed the instructions. The rest is just question answering.

Troubleshooting

The programs are not installing/I get an error from chocolatey
That probably means you didn't open PowerShell or cmd in admin mode. Make sure it's in admin mode and try again.
If you have a firewall, make sure that Chocolatey/PowerShell/Command Prompt has access to the internet (you can turn it off after installation).

My computer doesn't have PowerShell
Windows 10/11 normally comes with PowerShell (Windows PowerShell or PowerShell 7, etc.) If you don't have it, you can install it from the official PowerShell GitHub: https://github.com/PowerShell/PowerShell#get-powershell

My computer can't open .zip files
Windows 10/11 normally comes with a native archive extractor (i.e, a program that can open and extract .zip files). If you don't have one, you can use a free and open source program like 7-Zip to extract the files

Why

Why should I use this guide and not just simply use my video editing software?
You don't have to use the guide. You are free to cut your videos however you like. That being said, I can list some benefits of using this instead of a conventional video editor like Premiere, Vegas, or even a free one like Kdenlive:

  1. It's free, safe, and compatible on pretty much every modern operating system. All of the programs are very lightweight too so they are relatively low on resources in comparison to a conventional video editor. Can pretty much run on a potato.
  2. Videos are generated very fast, and lose no quality. The script uses FFmpeg to cut the videos without re-encoding. This means that videos are generated in a few seconds and lose no quality from the source.
  3. It's simple to use. It's only three commands (Start, End, Enter). Can't get much easier than this.

What is Chocolatey, and why do I have to install it?
Chocolatey is a package (software) manager for Windows. It's used to install and update packages. Chocolatey is the easiest way that I know of to install FFmpeg to your PATH (Windows Environment Variables). I find it to be a lot less annoying to tell people to just install chocolatey and then to install FFmpeg than just writing out a long and drawn out explanation of how to install ffmpeg on your PATH manually. It's also useful to install the other programs in the guide.

What is FFmpeg, and why do I have to install it?
FFmpeg is a powerful media library that allows for the manipulation of audiovisual formats. The reason why you have to install FFmpeg is because it's required for the script we use to cut the videos.

What is mpv, and why do I have to install it?
mpv is a media player based on mplayer. The reason why you have to install is because the script that is used to cut the videos is made for mpv. If someone wants to provide me an example with a different media player (like VLC), let me know. But yeah, you have to install it because the script only works with mpv.

What is cut-video.lua/input.conf, and why do I have to install it?
cut-video.lua is a Lua script that gives mpv the functionality of cutting videos. It is the most essential part of the entire guide since without it you can't clip. input.conf is a standard mpv configuration file that assigns the hotkeys to the script. It is required according to the GitHub description, and therefore included in the guide. cut-video.zip is a zip file I created that puts both of these files in the proper place (i.e, cut-video,lua in the scripts folder and input.conf on the outside). I did this as a convenience to make installation easier and explanations shorter. If you are concerned about the security of the zip file, here is an analysis of it.

What is TwitchDownloader, and why do I have to install it?
TwitchDownloader is a download tool that allows for the saving of VODs, Clips, and other content on the Twitch platform. It is the latest tool that I recommend for downloading Twitch videos (previously I recommended TwitchLeecher, which has ceased development). TwitchDownloader is optional to download. If you are not interested in download Twitch videos or have another way to download them, you can skip downloading it.

What is MediaDownloader, and why do I have to install it?
MediaDownloader is a download tool that allows for the saving of YouTube videos, clips, and shorts on the YouTube platform. MediaDownloader is a GUI front end to yt-dlp and youtube-dl. I personally don't use this tool, instead I just run yt-dlp directly from the command line. The reason why I chose MediaDownloader is because it's more friendly towards people who are not used to the command line. It is optional.

Hey, I'm confused/need help. Where do I go?

If you need help installing or have questions about this guide, ping @tsdjed in the #production-help channel in Modern Tetris Organizing.
Thanks, and I hope this is useful for you. If you find something wrong with the guide/improvements, reach out to tsdjed on Twitter or Discord.

Edit

Pub: 22 Jun 2023 18:40 UTC

Views: 226