Skip to content

Instantly share code, notes, and snippets.

lg3bass / padVideosTo16:9
Last active May 31, 2022
ffmpeg to pad videos to 16:9
View padVideosTo16:9
ffmpeg -i PAN_17-1_Final.m4v -filter:v 'pad=max(iw\,ih*(16/9)):ow/(16/9):(ow-iw)/2:(oh-ih)/2' -aspect 16:9 PAN_17-1_Final_auto1.m4v
//works but calculates manually (pad=<width output>:<height output>:<x upper-left-corner>:<y upper-left-corner>
ffmpeg -i PAN_17-1_Final.m4v -filter:v 'pad=939:528:22:0' PAN_17-1_Final_PADTEST2.m4v
lg3bass / gist:8442225
Last active Nov 26, 2021
FFMPEG - extract srts from all .m4v files in a directory.
View gist:8442225
for FILENM in *; do ffmpeg -i $FILENM -vn -an -codec:s:0.1 srt ${FILENM/.m4v/}.srt; ffmpeg -i $FILENM -c copy ${FILENM/.m4v/}.mp4; done;
//convert all the videos to a low bandwidth version and place alongside the original video.
for FILENM in *; do ffmpeg -i $FILENM -crf 45 -movflags faststart -profile:v baseline -level 3.1 ${FILENM/.mp4/}_3play.mp4; done;
//*** make sure the original video doesn't have spaces in the file name.
//Extract all the .srt files
lg3bass / gist:93b9a24ce678bc1acf54
Last active Dec 23, 2020
MACOS>UNIX>GIT>Create Repository From Existing
View gist:93b9a24ce678bc1acf54
///NEW (2020-12-23)
1. Create a new repo on github. Make sure to not create a readme, licence, or git ignore. New repo MUST BE EMPTY!!!!
2. If you added NOTHING you will see the "Quick Setup" screen.
3. In your local repo (the folder you want to create the project from) run these commands in order:
LG3-MBP:ADSR lg3$ git init
LG3-MBP:ADSR lg3$ git add .
LG3-MBP:ADSR lg3$ git commit -m "enter a comment. What are you committing"
LG3-MBP:ADSR lg3$ git branch -M main
-- REF:
View jitter-jxs-notest.txt
//bind parmams cannot have "1" at the start of the var name.
//good: <param name="boxSize" type="float" default="0.4" />
//bad : <param name="1boxSize" type="float" default="0.4" />
lg3bass / gist:429fea9288c06471131d4a058cea1393
Created Aug 27, 2020
get directory size | archive files and folders on a mac
View gist:429fea9288c06471131d4a058cea1393
//zip -r -s MaximumSize FolderName/
zip -r -s 1g usheproduction-pearsoned-com
//Added Bonus: Get directory size and sort
lg3bass / gist:127befd3ca8e2d4ed33020cc435d34ec
Last active Aug 13, 2020
FFMPEG - convert (MAX)AVRECORDR > Instagram
View gist:127befd3ca8e2d4ed33020cc435d34ec
//one line combo magic. all the .mov p422 files in a directory
for FILENM in *; do ffmpeg -i $FILENM -c:v libx264 -c:a aac -vf format=yuv420p -crf 1 -movflags +faststart ${FILENM%.*}.mp4; done;
//To convert the .h264 (.mov) output, keeping the same codec,bitrate, etc.
//with faststart
ffmpeg -i -c copy -movflags +faststart output2.mp4
//no faststart
View gist:65f4c863ad8ffe951cadbccaaf7e5ea6
//Use FFprobe to get data.
//source (and other things to query.)
//get the bitrate on a list of files.
for FILENM in *.flv; do ffprobe -v error -show_entries format=bit_rate -of csv $FILENM; done;
lg3bass / gist:ad65309e79e8d9a730f9acef345856c7
Last active Apr 16, 2020
FFMPEG - Convert all videos in a directory (Examples)
View gist:ad65309e79e8d9a730f9acef345856c7
//Convert all videos in a directory FLV > M4V (don't care bout quality)
for FILENM in *; do ffmpeg -y -i $FILENM ${FILENM%.*}.m4v; done;
//Converts all legacy .mov files in a directory to .mp4
//"-max_muxing_queue_size" source:
for FILENM in *;do ffmpeg -y -i $FILENM -crf 5 -max_muxing_queue_size 400 ${FILENM%.*}.mp4;done;
lg3bass / gist:9faadde4f75f26f621f5bed9718ea367
Created Jan 28, 2020
Using CURL + GREP to get a link out of a webpage
View gist:9faadde4f75f26f621f5bed9718ea367
Unix command:
curl -s '' | grep -o 'script src="[^"]*"'
script src=""
lg3bass / Midi2MayaAnimation.mel
Last active Jan 19, 2020
MEL - Midi 2 Maya Animation
View Midi2MayaAnimation.mel [maya 2014]
#midi to animation script
import sys
import math
#put the file in X:/Program Files/Autodesk/Maya2011/Python/lib so you don't need to specify the path explicitly
import midiparser
import pymel.core as pm