Skip to content

Instantly share code, notes, and snippets.

View psenough's full-sized avatar

Filipe Cruz psenough

View GitHub Profile
@psenough
psenough / convert_all_flv_to_mp4.bat
Created June 23, 2017 01:43
batch script to use ffmpeg to convert all flv files into mp4
for %%f in (*.flv) do (
ffmpeg -i "%%~nf.flv" -vcodec copy -acodec copy "%%~nf.mp4"
)
# cut
ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 cut.mp4
# ffwd video and audio 10x
ffmpeg -i input.mkv -filter:v "setpts=0.1*PTS" -filter:a "atempo=10.0" output.mkv
# ffwd video only
ffmpeg -i input.mkv -filter:v "setpts=0.1*PTS" -an output.mkv
# convert to DNxHD
@psenough
psenough / to1425.sh
Created June 23, 2017 01:55
convert squared image to 1425x1425 jpg
#!/bin/bash
sips -z 1425 1425 "$1" -s format jpeg --out "00_1425.jpg"
@psenough
psenough / to300.sh
Created June 23, 2017 01:56
convert squared image to 300x300 jpg
#!/bin/bash
sips -z 300 300 "$1" -s format jpeg --out "00_300.jpg"
@psenough
psenough / to44100.sh
Created June 23, 2017 01:57
convert audio file to 44100khz 256kbps mp3 using ffmpeg
#!/bin/bash
ffmpeg -i "$1" -vn -ar 44100 -ac 2 -b:a 256k -f mp3 "44100_${1}"
@psenough
psenough / to_wavs.sh
Created June 23, 2017 01:58
convert all mp3s and oggs in a directory to wav files using ffmpeg
#!/bin/bash
for filename in *.mp3
do
ffmpeg -i "$filename" -vn -ar 44100 -ac 2 -f wav "$filename.wav"
done
for filename in *.ogg
do
ffmpeg -i "$filename" -vn -ar 44100 -ac 2 -f wav "$filename.wav"
@psenough
psenough / towav.sh
Created June 23, 2017 02:00
convert a file to wav format of 44100khz using ffmpeg
#!/bin/bash
ffmpeg -i "$1" -vn -ar 44100 -ac 2 -f wav "44100_${1}.wav"
@psenough
psenough / better-watch2gether.user.js
Last active August 30, 2017 16:18
tampermonkey userscript to improve watch2gether usability
// ==UserScript==
// @name Better Watch2Gether
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world! or atleast improve watch2gether usability a bit
// @author ps
// @match http://www.watch2gether.com/rooms/*
// @match https://www.watch2gether.com/rooms/*
// @downloadURL https://gist.github.com/psenough/65a990c7c845c31a8e128577fb78850b/raw/
// @require https://code.jquery.com/jquery-2.1.4.min.js
@psenough
psenough / dnxhd.bat
Created August 8, 2017 23:35
convert 1080p files with weird encoding to a davinci resolve friendly format
ffmpeg -i "in.mov" -vf format=yuv422p,scale=-1:1080,pad=1920:1080:(ow-iw)/2:0 -r 24000/1001 -c:v dnxhd -b:v 115M "out.mov"
@psenough
psenough / pixelscamp 2017 quiz answers
Created September 5, 2017 01:16
pixelscamp 2017 quiz answers
https://quiz.pixels.camp/challenge/2017-1-tick-tock-8e50a5ab-d59e82c126ab7660/steps/0-start.html
myst
ubik
grim fandango
foundation
street fighter alpha
contact
jet set willy
solaris