Skip to content

Instantly share code, notes, and snippets.

@NeoChen1024
Last active April 14, 2022 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NeoChen1024/0d12d63b545717ed781e63a20cbbf1de to your computer and use it in GitHub Desktop.
Save NeoChen1024/0d12d63b545717ed781e63a20cbbf1de to your computer and use it in GitHub Desktop.
Encode very low bitrate video / audio (H.265 / OPUS)
#!/bin/sh
VB="16k"
VBV="24k"
AB="8k"
time nice -n 20 ffmpeg -i "$1" -c:a libopus -ac 1 -b:a "$AB" -c:s srt -c:v libx265 -preset:v veryslow -profile:v main -x265-params "strict-cbr=1" -b:v "$VB" -minrate:v "$VB" -maxrate:v "$VB" -bufsize "$VBV" -vsync vfr -r 10 -filter:v "format=yuv420p,scale=-1:180,pad=ceil(iw/2)*2:ceil(ih/2)*2" "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment