Simple python application for downloading a highlight from Twitch, adding a intro bumper, and endcard, and uploading it to Youtube
Click here to download TwitchTube
Make sure to download the appropriate version based on your operating system.
TwitchTube is a tool for editing and uploading Twitch highlights or videos, including adding a quick highlight, trimming, adding an intro, overlay or call-to-action video, and an endcard.
The graphic above demonstrates an example of how a timeline would look if all the options available in TwitchTube would work.
This is an example of a Twitch highlight before and after running it through TwitchTube with all options enabled. (You will need to click on the images to see the differences on Twitch and on Youtube)
Before | After |
---|---|
You can run TwitchTube two different ways. You can either use one of the prebuilt versions listed under releases, or you can download the source files and run the TwitchTube.py
.
The prebuilt releases include FFmpeg and are ready to use.
The source files do not include FFmpeg, if you already have FFmpeg on your machine and it is accessable via the FFmpeg
command then it will use your installed version of FFmpeg. If you do not have FFmpeg installed on your machine or it is accessable via a different path, then TwitchTube will automatically download FFmpeg on its own and store it in the AppData/Application Support folder.
NOTE FOR LINUX USERS: TwitchTube will not automatically install FFmpeg on Linux due to the number of variations of Linux Distros. However if you manually install FFmpeg and it is accessable via the FFmpeg
command then it will use your installed version of FFmpeg. Also tk
is required to be installed if it is not already.
Whether you are running TwitchTube via a prebuilt release or with the source files, the rest of the usage documentation remains the same.
Upon the first launch, TwitchTube will create an App Data folder to store credentials, temporary files, and intro, endcard, and overlay video files.
The App Data folder is located on MacOS at /Users/<username>/Library/Application Support/TwitchTube
on Windows at 'C:\Users\<username>\AppData\Local\ChrisJamesChamp\TwitchTube
and on Linux at /home/<username>/.local/share/TwitchTube
Every time you run TwitchTube, it will verify that the Twitch credentials on file are valid. If it's the first time running the application or the credentials are invalid, you will be prompted to enter a Twitch Client ID and an OAuth token. TwitchTube does not come with these credentials, so you will need to create an app and authorize it manually.
To get a client ID, you first need to go to https://dev.twitch.tv/ and create a Twitch Application. The application should have a redirect URL of https://twitchapps.com/tokengen/, which is required to get the OAuth token. Once you have created your Twitch Application, you will be given a client ID. For more information on how to do this, you can read the Twitch Dev docs at https://dev.twitch.tv/docs/api.
To get an OAuth token, go to https://twitchapps.com/tokengen/ and enter your client ID from the previous step. This will give you your OAuth token.
Once you have the client ID and OAuth token, enter them into TwitchTube when prompted, and then enter a valid Twitch channel from which you would like to grab videos. The application will confirm the channel you selected.
To avoid returning too many videos at once, TwitchTube will only get the most recent highlights from the selected channel. However, if the desired video is not listed, you can always choose "Other" (which is always the last option) and manually enter the URL of the Twitch video you want to use. For example: https://www.twitch.tv/videos/1703793089?filter=highlights&sort=time.
Before the video or the intro video, you can add a highlight. This is a quick snippet of the most action-packed part of the video that leaves the audience wanting more.
TwitchTube will ask you if you want to include a highlight. By default, the answer is "No," but you can type "Y" or "Yes" to add a highlight.
If you choose to add a highlight, you will be prompted to enter the start and end times of the highlight. For example, if you want the highlight to start at 00:59:22
, you would enter 59m22s
and if you want the highlight to end at 01:05:13
, you would enter 1h5m13s
.
If you want to change the in and/or out points of the video, you can trim it. If you want to change just the in point, enter a time greater than the length of the video when prompted for the new out point. If you want to change just the out point, enter 0s
when prompted for the new in point. Use the same syntax as the Highlight when entering times.
The Intro Video is a title card that appears at the beginning of the final video, similar to the MGM graphic with the lion roaring. TwitchTube will save a copy of the video file you select, so you only need to choose it once. Most video formats are accepted, and it is designed to accept an alpha channel for transitions at the beginning and end of the Intro Video. It is recommended to use a straight alpha channel, rather than premultiplied.
The resolution of the Intro Video should match the Twitch Video you are downloading. When selecting the Intro Video, TwitchTube will ask for two things: the length and offset of the Intro Video.
- The length is important as it needs to know the seconds before the out transition starts. So, if you have an Intro video that is 10 seconds long but the out transition starts at 8 seconds, you would enter 8. Always round down; if it starts at 8.5 seconds, still enter 8. If there is no out transition, then enter the total length of the Intro Video, rounding down. For example, if the total length is 5.8 seconds, enter 5.
- The offset is the duration of the in transition. If the transition is 3 seconds, then enter 3 seconds. If it is 2.5 seconds, then enter 3 seconds, rounded up. This is only used if a highlight is used. If no highlight video is chosen or if the offset is set to 0, the Intro video will start at the beginning.
Your settings for the Intro Video will be saved for future use, but they can be changed if necessary.
The Overlay video, or Call-to-Action (CTA) video, is designed to be an overlay added somewhere in the middle of your video, after the Intro Video and Highlight Clip (if they are being used). The overlay can remind users to like, follow, subscribe, etc.
This video is designed to have an alpha channel, and the content should already be placed on the screen where it should appear. Most video formats are accepted, and TwitchTube is designed to accept an alpha channel. It is recommended to use a straight alpha channel, rather than premultiplied.
The resolution of the Overlay video should match the Twitch Video you are downloading. The only option for the Overlay video is how many seconds into the video you would like it to play.
- This should be entered as a number of seconds.
- For example,
5
or120
. - The default is set to 15 seconds.
Your settings for the Overlay Video will be saved for future use, but they can be changed if necessary.
The Endcard video is played after the Twitch video finishes. Most video formats are accepted, and TwitchTube is designed to accept an alpha channel for transitions at the beginning of the Endcard Video. It is recommended to use a straight alpha channel, rather than premultiplied.
The resolution of the Endcard video should match the Twitch Video you are downloading. The only option for the Endcard video is the offset, which is the duration of the in transition.
- If the transition is 3 seconds, enter 3 seconds.
- If it is 2.5 seconds, enter 3 seconds, rounding up.
- This offset is only used if a highlight is used. If no highlight video is chosen or if the offset is set to 0, the Endcard video will start at the beginning.
Your settings for the Endcard Video will be saved for future use, but they can be changed if necessary.
Once the options are set, the video will begin rendering. The video will be rendered with the same resolution and frame rate as the original Twitch Video. It will be encoded with H.264
and have a .mp4
file extension, in the BT.709
colorspace.
Once the video has finished rendering, you will be prompted to Quality Check (QC) the resulting video. This is a good idea to ensure that everything rendered as intended.
If you choose to watch the resulting video, it will open in your system's default video viewing software. If you are satisfied with the results, you can confirm this. WARNING: If you choose not satisfied with the resulting QC of the video, TwitchTube will exit and the resulting video will be deleted, requiring you to start over.
Due to updated Terms and Policies that Google is now enforcing, TwitchTube can no longer automagically upload the video to youtube. However, TwitchTube will give you step by step instructions to manually upload your video and make the process as streamline and as easy as possible.
When uploading to Youtube, you'll have the option to set a title, brief and long description, keywords, and a category for your video.
- Title: By default, the title will be transferred from Twitch, but you can change it at this point.
- Brief Description: A short summary of the video, usually a paragraph or less.
- Long Description: A longer description that can include links to social media, or information that you want to include on multiple videos.
- Keywords: Add as many keywords as you'd like to help people find your video, they will be added to the video and to the end of the description with hashtags.
Note: Long Description can be edited by default and will open a txt file with the default text editor on your system. Make sure to save the file and close it, TwitchTube will confirm that you have saved the file just in case you forget. The Long Description will be placed just after the brief description with a bar or ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ separating the two.
After setting all the options, you will be asked where you would like to save a copy of your video. It is wise to select a destination such as the desktop or downloads folder so that you can easily navigate to the video file when uploading to Youtube. Navigate to https://studio.youtube.com/ and push the button to upload a new video. You can then select the Select Video button and navigate to your video file. While the video uploads, TwitchTube will provide you with the video title you chose, the video description, and keywords. In each step TwitchTube will automagically add these to your computer's clipboard making it as easy as possible. Just go to the youtube upload page and paste each item into the appropriate field in the upload form.
Thats It!