This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, subprocess, sys | |
| # usage: extract_highlights.py <path-to-video> <path-to-timestamps> | |
| # timestamps file format: | |
| # hh:mm:ss bla bla bla | |
| before_secs = 5 # secs to include before clip timestamp | |
| after_secs = 25 # -"- after -" ... 5+25 = 30 sec clip | |
| safe_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -0123456789." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add this to to your .zshrc, then you can do `path file` to get the full path to that file, requires python | |
| path() { python -c "import os;print(os.path.realpath(\""$1\""))" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Requires ffmpeg and ffprobe | |
| # Thanks to ffmpeg command from https://stackoverflow.com/a/51439554 | |
| delete_original = True # delete the original file? | |
| sub_lang = ".eng" | |
| import os, subprocess, sys, shutil | |
| file = os.path.abspath(sys.argv[1]) # input file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Requires ffmpeg and ffprobe | |
| # Thanks to ffmpeg command from https://stackoverflow.com/a/51439554 | |
| delete_original = True # delete the original file? | |
| import os, subprocess, sys, shutil | |
| file = os.path.abspath(sys.argv[1]) # input file | |
| if not os.path.isfile(file): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Requires ffprobe and other-transcode (https://github.com/donmelton/other_video_transcoding) available in path | |
| # Suffixes video info eg: video.mp4 ---> video (h264 720p 3000kbps).mp4 | |
| import sys, os, shutil, re | |
| import subprocess | |
| import json | |
| import datetime | |
| from subprocess import DEVNULL | |
| # settings ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tested working 15 Jun 2020, irssi version 1.2.2 | |
| (Update: still works October 2023!) | |
| This is a TLDR version of https://blog.crunchprank.net/connecting-to-twitch-chat-via-irssi/ | |
| Get your OAuth token (password) here: https://twitchapps.com/tmi/ | |
| # Network setup: | |
| /network add -nick YOUR_TWITCH_USERNAME Twitch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # If you never disabled shadows before there will be an error on your | |
| # first run because the disable-shadow key does not exist yet | |
| current=$(defaults read com.apple.screencapture disable-shadow) | |
| if [ "$current" -eq "1" ] | |
| then | |
| echo "Shadows are disabled, Enabling them..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| import os | |
| # input your times | |
| # HH:MM:SS.FFF | |
| video_length = "00:06:42.984" | |
| start_time = "00:00:20.649" | |
| end_time = "00:06:05.899" | |
| fps = 60 | |
| outfile = 'time.srt' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import subprocess | |
| import sys | |
| import hashlib | |
| import webbrowser | |
| from PIL import Image | |
| import tempfile | |
| def md5string(string): # https://stackoverflow.com/a/5297483 | |
| return str((hashlib.md5(string.encode('utf-8')).hexdigest())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| REM just do: gifit.bat video.mp4 | |
| REM and go on with your life | |
| REM needs ffmpeg | |
| ffmpeg -i "%1" -filter_complex "[0:v]scale=480:-1:lanczos,split [a][b];[a] palettegen [p];[b][p] paletteuse" "%~n1.gif" |