Skip to content

Instantly share code, notes, and snippets.

@wotupset
Forked from tulanght/4chan-webm-guide.md
Created September 14, 2021 08:52
Show Gist options
  • Save wotupset/cf6ee9409809d764a16bf0d40954e0c4 to your computer and use it in GitHub Desktop.
Save wotupset/cf6ee9409809d764a16bf0d40954e0c4 to your computer and use it in GitHub Desktop.

4chan Audio WebM Guide

Download FFmpeg https://www.ffmpeg.org/download.html FFmpeg is a command line tool, which means there is no GUI. You are going to have to input commands via the keyboard instead of clicking the mouse.

Current Limitations for WebM files on 4chan are:

Maximum file size is 4096KB.
Maximum duration is 300 seconds.
Maximum resolution is 2048x2048 pixels.
Audio streams allowed.

Convert a portion of a video file to WebM:

ffmpeg -i input.mkv -ss 00:00:10.000 -to 00:00:20.000 -c:v libvpx -c:a libvorbis -crf 4 -b:v 1500K -vf scale=1280:-1 -threads 4 -an output.webm

  • -i specifies the input file you want to transcode to webm.
  • -ss specifies the start position in number of seconds, or in hh:mm:ss[.xxx] format. You can obtain the timecode using your video player (T in VLC and Ctrl-G in MPC-HC).
  • -to specifies the end position in number of seconds, or again in hh:mm:ss[.xxx] format.
  • -c:v specifies the video codec to use. webm isn't actually an encoding type unto itself, but an audio/video container, like mkv. Nevertheless, you will almost always use libvpx for the video.
  • -crf sets CRF value. Must be from 4-63. Lower is higher quality. 10 is a nice starting point.
  • -b:v specifies the maximum allowed bit rate. Higher means better quality.
  • -vf scale=1280:-1 sets the output video width to 1280px. The height will be calculated automatically according to the aspect ratio of the input. Simply omit this parameter to keep the files original resolution.
  • -threads 4 tells FFmpeg to use multithreading. Enter the number of cores your processor has as a parameter, or set to 0 to use them all.
  • -c:a libvorbis specifies the audio codec for the output file.

Converting Animated gifs: ffmpeg -i input_gif.gif -c:v libvpx -crf 10 -b:v 500K output.webm

FFMpeg documentation: https://www.ffmpeg.org/ffmpeg.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment