From 9a23458a2d0b879e96ede0b94beb4f8c547bed16 Mon Sep 17 00:00:00 2001 From: Klaatu Date: Fri, 9 Sep 2016 12:05:08 +1200 Subject: [PATCH] ffmpeg combine, add sqlite3 --- cheat/cheatsheets/ffmpeg | 7 +++++-- cheat/cheatsheets/sqlite3 | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 cheat/cheatsheets/sqlite3 diff --git a/cheat/cheatsheets/ffmpeg b/cheat/cheatsheets/ffmpeg index 2d8fec6..daa7a68 100644 --- a/cheat/cheatsheets/ffmpeg +++ b/cheat/cheatsheets/ffmpeg @@ -4,13 +4,16 @@ ffmpeg -i path/to/file.ext # Convert all m4a files to mp3 for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -vn -b:a 320k "${f%.m4a}.mp3"; done -# Convert video +# Convert video from .foo to .bar # -g : GOP, for searchability -ffmpeg -i input.ext -vcodec vp9 -acodec libopus -b:v 21000k -b:a 320k -g 150 -threads 4 output.ext +ffmpeg -i input.foo -vcodec bar -acodec baz -b:v 21000k -b:a 320k -g 150 -threads 4 output.bar # Convert image sequence to video ffmpeg -r 18 -pattern_type glob -i '*.png' -b:v 21000k -s hd1080 -vcodec vp9 -an -pix_fmt yuv420p -deinterlace output.ext +# Combine video and audio into one file +ffmpeg -i video.ext -i audio.ext -c:v copy -c:a copy output.ext + # Listen to 10 seconds of audio from a video file # # -ss : start time diff --git a/cheat/cheatsheets/sqlite3 b/cheat/cheatsheets/sqlite3 new file mode 100644 index 0000000..a3215b9 --- /dev/null +++ b/cheat/cheatsheets/sqlite3 @@ -0,0 +1,20 @@ +# create database and launch interactive shell +sqlite3 example.db + +# create table +sqlite3 example.db "CREATE TABLE Os(ID INTEGER PRIMARY KEY, Name TEXT, Year INTEGER);" + +# insert data +sqlite3 example.db "INSERT INTO 'Os' VALUES(1,'Linux',1991);" + +# list tables +sqlite3 example.db ".tables" + +# view records in table +sqlite3 example.db "SELECT * FROM 'Os';" + +# view records in table conditionally +sqlite example.db "SELECT * FROM 'Os' WHERE Year='1991';" + +# view records with fuzzy matching +sqlite3 ~/example.db "SELECT * FROM 'Os' WHERE Year like '19%';" \ No newline at end of file