owned this note
owned this note
Published
Linked with GitHub
# Standard procedure to process livestream videos
As the team that is in charge of publishing content through our social media channels we usually have to take time (or ask the design team for help) to process live streamed events (e.g.: Flock / Nest / Hatch with Fedora), which usually takes a lot of time to do manually, first to download all of the videos, then to manually cut them all up and then to upload it all back. So we decided on a standard procedure to do it for future events, in order to ease the work for our contributors, specially for beginners.
The tools you'll need:
* [yt-dlp](https://github.com/yt-dlp/yt-dlp) (if you prefer to use the command line) / [Parabolic](https://flathub.org/apps/org.nickvision.tubeconverter) (if you'd rather use an interface);
* [Sponsorblock](https://sponsor.ajay.app/) (optional, but will spare you a lot of work later on);
* [Inkscape](https://inkscape.org/) and its [Next Generator extension](https://gitlab.com/Moini/nextgenerator) for working with the video thumbnails.
## 1. Create the video chapters and separate the breaks
First, you'll need to tag the timecodes for all of the talks in the video. This is by far the most time consuming part of the whole process.
We recommend Sponsorblock to do so, first because it offers a nice interface, and second because you don't need admin access to the event or project's YouTube channel to tag everything. The extension maintains a public database that people can use (usually to remove ads inside of videos, but in our case, we use it to remove breaks between talks).
### 1.1 Using Sponsorblock
First, **press the shortcut `;` or click the icon shaped like a play button inside a shield**, which the extension creates right in the lower right corner of your video player, along the other video controls, to create a segment.
If you hover over the button, another button with an "i" icon should appear. If you click it, a sidebar with all of the video's segments and a couple of options should appear, which we'll use later:


From there you can click one of the three icons that takes its place:

The first one (from here on called Open Submission Menu), with the shape of an arrow, opens the submission menu, where you can see a summary of all the segments you created, edit them and upload them to the database.
The second one (from here on called Cancel Created Segment), with the X shape, cancels the segment you started creating.
The third one (from here on called End Segment Now), with the stop symbol, marks the end of the segment you created.
Now that you started a segment, find the point of the video you'd like to end your segment (be it a break or a talk) and **either press `;` again or click the End Segment Now button**.
After that, **click the Open Submission Menu button**, so you can choose a category. The ones we will use are "Chapter" and "Intermission/Intro Animation", the former for the Chapters we will later use to export to YouTube and the latter to have the breaks automagically cut up.

You can upload segments one by one or *en masse* by **clicking the "Submit" button in the lower right corner**, the latter of which we recommend, so that you can more easily double check and edit everything.
The end result should make your video's timeline look like this:

**Now, open the extension sidebar, and select the option to export segments.**

### 1.2 Adding the chapters to YouTube
YouTube uses a different format than Sponsorblock to define timestamps, so **you'll need to reformat the output before you (or the YouTube channel admin) adds them to the video**. For example, here's the output of one of Flock to Fedora 2023's streams:
```
0:00.000 - 12:22.000 Intermission
12:22.436 - 27:25.232 Keynote: Fedora Mentor Summit kickoff and reflection on mentoring in Fedora community
27:25.232 - 2:00:26.540 Panel: Mentoring and mentorship best practices in Fedora
2:00:26.540 - 4:58:40.000 Intermission
4:58:40.742 - 5:31:21.672 Why You Should Join a Community
5:31:21.672 - 5:55:26.775 Intermission
5:55:26.775 - 6:40:51.611 State of Fedora (without stream issues this time lol)
6:40:51.611 - 7:33:59.086 Intermission
7:33:59.086 - 8:15:25.041 Conference closing
```
...you only need the starting timecode formatted in `hours : minutes : seconds`, so it should look like this:
```
0:00 Event Starting
12:22 Keynote: Fedora Mentor Summit kickoff and reflection on mentoring in Fedora community
27:25 Panel: Mentoring and mentorship best practices in Fedora
2:00:26 Break
4:58:40 Why You Should Join a Community
5:31:21 Break
5:55:26 State of Fedora (re-recorded due to stream issues the first time)
6:40:51 Break
7:33:59 Conference closing
```
But after doing it, you (or again, the YouTube channel admin) just need to **add the timecodes to the video's description** and they should appear in the video for everyone (even people that don't use Sponsorblock). You'll need it for...
## 2. Downloading the talks and spltting them up
### 2.1 Using yt-dlp
**`cd` into the folder you want to save the video in and run the command:**
`yt-dlp --sponsorblock-mark all --sponsorblock-remove all --split-chapters $VIDEO_LINK`
...where $VIDEO_LINK is the link of the video you want to download. It should download and automagically remove all of the breaks and split the video based on its chapters.
### 2.2 Using Parabolic
> NOTE: This only currently works in the app's beta release, as [we've recently helped with the feature requests needed for the app to achieve this](https://github.com/NickvisionApps/Parabolic/issues/551).
First, **open the app and** either use the keyboard shortcut `Ctrl+,` or click the hamburger menu on the top right and select "Preferences" to **open the preferences menu**.

After that, **turn the "Use SponsorBlock for YouTube" option on**:

Now, close the preferences, **click the "Add Download" button, paste the link to the video you want to download and click the "Validate" button**:

It will present you with a page containing download options. In there, **click the "Advanced Options" option**:

In there, **turn the "Split Chapters" option on**:

After all of that, select your preferred download options, your destination folder and **click "Download"**. You should have all of your talks properly split up by their chapters in your desired folder, ready to upload by the time your download ends.
## 3. Creating the thumbnails
Thanks to the work of the design team, we now have a way to [automate the process of thumbnail creation](https://gitlab.com/fedora/design/team/tutorials/inkscape-automation) as much as possible. This part will be a quick summary of the tutorial, but for the full thing in detail, check them out!
First, **create a spreadsheet** in your preferred app for that (we recommend [LibreOffice](https://flathub.org/pt-BR/apps/org.libreoffice.LibreOffice)), you just need to have something that outputs a proper .CSV file.
In it, **create two columns, one with the name of the talk and another with the name of the presenter(s). The first line of each column should have a variable name to use later on.**
It should end up looking something like this:
| TalkName | PresenterNames |
| -------- | -------- |
| Why Fedora is the Best Linux | Colúr and Badger |
| The Best Talk You Ever Heard | Dr. Ver E. Awesome |
| ... | ... |
**Save that file with the .csv termination.**
Now, **open Inkscape and start creating the design of your thumbnail template**, taking into consideration some of the important rules of design, like [visual hierarchy](https://en.wikipedia.org/wiki/Visual_hierarchy), [color theory](https://en.wikipedia.org/wiki/Color_theory) (specially taking into consideration your project's colorscheme).
After you have a basic layout of the template, it's time to prepare your template for the information.
**First, change the talk name to %VAR_TalkName%** (change TalkName by whatever variable name you decided to use in your .CSV file);
**Now change the presenter name to %VAR_PresenterNames%.**
You'll probably have to edit the text box sizes in order to account to longer talk names and multiple presenters, trial and error will probably be your friend here.
Once you have a result you are comfortable with **go to `Extensions > Export > NextGenerator`, add the path to your spreadsheet in "CSV file", define your preferred file format to export and path to export your files to, set "File name Pattern" to %VAR_TalkName and, finally, click "Export".** Your files should be good to go in an instant!
## What we'd still like to automate
### Chapter creation
Sponsorblock helped a lot to ease the burden when it comes to chapter creation (as it used to be limited to people with direct admin access to the channel), but it's still a lot of manual work that we'd like to ease.
### Captions
YouTube automatic captions have gotten better with the years, but are still not perfect, and the situation doesn't get better when you select the option to automatic translate them. This doesn't paint a great picture for us, as a global project, to alienate potential contributors that don't speak english, but we understand that manually transcripting entire events and then translating those captions is a massive undertaking, and we current don't have ideas on how to automate that process.
### Intro
Having an intro before your talk isn't the best for viewer retention but if it is short enough it can be a good way to show the branding of your project and your event. We'd like to have a way where you can automatically add the intro video to the beginning of a plethora of videos at once and add a transition between the intro and the video.
### End Cards
One thing you can do for your events is having different artwork for the event opening and the breaks in between talks, and use the latter as a place to add end cards to your video (which helps a lot with continuous viewership of your channel's content).
We'd like to have an alternative for cases where this isn't planned ahead, where it'd work similarly to the intro case, but with an image file to the end of the video (and be able to define a number of seconds that image would be shown).