Benigno's original webm guide
Warning
This might look convoluted and unnecessarily difficult, but it's worth it in the end.
Info
With this method you can memorize keybinds and make the process of creating clips of live streams in real time as fast as your computer can encode and as fast as you can think. In the process you can keep a backup of the whole match, a clip with audio to keep as record and a clip without audio to post on 5chins.
This guide requires you to use a terminal, know how to install streamlink and mpv on your computer, make a configuration file for both, and download two scripts for mpv, place them in the correct folder and make configuration files for both scripts.
Programs needed
mpv : Scriptable video player to watch, mark, crop and clip videos.
streamlink : Opens streams on mpv and records to a file as a backup.
mpv scripts needed
streamsave : to clip the stream as is, with audio and the same video format it is being streamed, to a file.
mpv-webm : to clip a webm from the saved file by streamsave, and encode it without audio so it can be posted on /sp/.
Optional user interface script
mpv-uosc : mouse friendly user interface that hides and reappears when your mouse gets far/near it's functions.
Optional program for youtube streams/videos
yt-dlp : makes streamlink and mpv able to play youtube streams, also lets you download youtube videos with metadata, subtitles, thumbnail, descriptions, etc. Regular videos will not open on streamlink, but will run on mpv and will let you directly use mpv-webm if you want to.
Keybinds
Almost every action has a keybind, memorizing keybinds makes the process faster and easier in the long run.
Browser
F12 : Open the developer console on a browser.
If you go to the network tab you can find the direct link to a video stream, it's usually the one with a .m3u8
extension somewhere in the link.
mpv
, and . : Go back and forth a single video frame.
The "," button goes back a frame, the "." button goes forward a frame.
l (aka lowercase L) : mark the start, end and then clear a loop on a video.
If you hit "l" once it marks the start, the second time it marks the end, the third time it clears all marks.
Useful for marking the start and end of the file saved by streamsave.
m : mute video.
If you mute before encoding the resulting webm will have no audio.
streamsave
CTRL+z : Save a marked segment to a file.
Save the loop previously marked as a separate file from the main one being recorded by streamlink.
mpv-webm
SHIFT+w : Open the encoding menu.
With the encoding menu open you can hit:
- "1" to mark the start of a clip, just seek on the video to the exact frame you want the clip to start with and press "1".
- "2" to mark the end of a clip, just seek on the video to the exact frame you want the clip to end with and press "2".
- "p" to preview the resulting webm.
- "e" to encode with your saved settings.
- "o" for more options like changing video codec, height to scale to, target file size, frame rate, etc. Press "Enter" to confirm settings.
- "c" to open the crop menu, where pressing "1" on the pixel your mouse is hovering will mark the upper left corner of the cropped zone, and "2" will mark the bottom right corner.
Step by step
- Find a stream that can be opened on mpv by streamlink. (Most of them work, it's trial and error. Some will give you error 403: Forbidden because they use some kind of authentication i don't know how to blend into a single url for streamlink to consume, if you find out how to please post in the thread)
- In a terminal you execute the command
streamlink 'link to the stream' --record /home/user/partidos/-{time:%Y%m%d%H%M%S}.ts
. This will create a new recording every time you open a stream, using a timestamp as filename. - Wait for something interesting to happen.
- Mark a segment using the "l" (aka lowercase L) button two times, it doesn't need to be precise/frame perfect because this wont be the final clip.
- Press CTRL+z to save the raw segment to a file you can work on.
- Open that file in a new mpv window.
- Mute the video.
- CTRL+w to open the encoding menu.
- Mark the start with the button "1" and the end with the button "2".
- Encode with "e" and hope it's size is less than 4mb (/sp/'s upload size limit).
- Post it.
If step 10 fails, then you need to either change the target filesize to a lower one, scale the video to a lower height than the original, or a combination of both until it's watchable and under 4mb.
Sometimes if the file saved by streamsave is already under 4mb you can change the target filesize to 0 (for constant quality) and make the encoding faster.
Configuration files
streamlink (.config/streamlink/config)
Info
--player-no-close
Streamlink by default closes as soon as the stream source ends so hooking it up to short videos is painful without --player-no-close.