Skip to content

Instantly share code, notes, and snippets.

View protrolium's full-sized avatar

Ꮹανiη Ꮐaмвoα protrolium

View GitHub Profile
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@protrolium
protrolium / QLAB-scripting.md
Last active May 2, 2024 05:24
QLab + Applescript to control Applications & Panasonic Projectors over LAN

QLab + Applescript commands for Projector & Application Boot-Up/Shut-Down Routine

Boot Up Sequence

Open Projector Manager app

tell application "Terminal"
   delay 0.5
   do script "open -a Projector Manager"
   delay 0.5
   tell application "Terminal to quit"
end tell
@protrolium
protrolium / YouTube API — getting video thumbnail
Created February 5, 2014 19:57
YouTube API — getting video thumbnail
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
@protrolium
protrolium / wget.md
Last active March 8, 2024 01:46
wget commands

Download Only Certain File Types Using wget -r -A

You can use this under following situations:

  • Download all images from a website
  • Download all videos from a website
  • Download all PDF files from a website

$ wget -r -A.pdf http://url-to-webpage-with-pdfs/

@protrolium
protrolium / terminal-gif.md
Last active February 15, 2024 09:09
convert images to GIF in Terminal

Install ImageMagick

brew install ImageMagick

Pull specific region of frames from video file w/ ffmpeg

ffmpeg -ss 14:55 -i video.mkv -t 5 -s 480x270 -f image2 %04d.png

  • -ss 14:55 gives the timestamp where I want FFmpeg to start, as a duration string.
  • -t 5 says how much I want FFmpeg to decode, using the same duration syntax as for -ss.
  • -s 480x270 tells FFmpeg to resize the video output to 480 by 270 pixels.
  • -f image2 selects the output format, a series of still images — make sure there are leading zeros in filename.
@protrolium
protrolium / renoise-keyboard-shortcuts.md
Last active February 8, 2024 02:03
Renoise : Keyboard Shortcuts

Renoise 3.0

Keyboard Shortcuts OS X 10.10.5

play from playhead position
shift space bar

toggle FOLLOW in pattern view [custom keybinding]
option esc

toggle global loop [custom keybinding]

@protrolium
protrolium / youtube-dl.md
Last active December 24, 2023 19:08
youtube-dl syntax

youtube-dl will output in the current directory

To list available formats

youtube-dl --list-formats URL

To download an entire user/channel

youtube-dl -citw ytuser:<USER> or

@protrolium
protrolium / rsync.md
Last active December 24, 2023 19:05
rsync methods

using rsync

$ rsync -avE --progress /source/ /destination

  • -v --verbose
  • -a --archive (preserve all attributes)
  • -n --dry-run
  • -E, --executability (preserve executability)
  • --delete This tells rsync to delete extraneous files from the receiving side (files that aren't on the sending side), but only for the directories that are being synchronized.
@protrolium
protrolium / monty-ffmpeg.md
Last active December 24, 2023 19:03
using ffmpeg to add sound to youtube videos

quick/dirty process to merge audio streams

create initial video offset
ffmpeg -ss 0:00 -t 0:00 -i input.mp4 output.mp4

exctract audio from new output.mp4
ffmpeg -i output.mp4 -f mp3 -ab 192000 -vn output.mp3

merge the two audio files
ffmpeg -i output.mp3 -i audio2.mp3 -filter_complex amerge -ac 2 -c:a libmp3lame -q:a 4 merged.mp3

@protrolium
protrolium / img2pdf.md
Created May 16, 2022 19:07
working command for turning dir of jpegs into pdf

$ img2pdf --first-frame-only *.jpg -o document.pdf