Skip to content

Instantly share code, notes, and snippets.

View bertrandom's full-sized avatar

Bertrand Fan bertrandom

View GitHub Profile
$ mkvinfo Seinfeld.S01E01.The.Seinfeld.Chronicles.mkv
...
|+ Segment tracks
...
| + A track
| + Track number: 3 (track ID for mkvmerge & mkvextract: 2)
| + Track UID: 17434673961305370787
| + Track type: subtitles
| + Lacing flag: 0
| + Codec ID: S_TEXT/UTF8
convert data/frames/S03E11/270.gif -gravity south -font Helvetica -pointsize 14 -stroke '#000C' -strokewidth 3 -annotate 0 '"These pretzels are\nmaking me thirsty"\n' -stroke none -fill white -annotate 0 '"These pretzels are\nmaking me thirsty"\n' data/annotate/S03E11/270.gif
var timestampMs = transform.convertTimeToTimestamp(line.endTime) - transform.convertTimeToTimestamp(line.startTime);
line.duration = transform.convertTimestampToTime(timestampMs);
var moment = require('moment');
module.exports = {
convertTimeToTimestamp: function (time) {
return moment.utc(time, "HH:mm:ss,SSS").set({'year':1970, 'month':0, 'date':1}).valueOf();
},
#!/bin/bash
start_time=$3
duration=$4
palette="/tmp/palette.png"
filters="fps=15,scale=320:-1:flags=lanczos"
ffmpeg -v warning -ss $start_time -t $duration -i $1 -vf "$filters,palettegen" -y $palette
1
00:00:01,266 --> 00:00:03,366
Do you know what this is all
about? Why we're here?
2
00:00:03,400 --> 00:00:06,366
To be out. This is out.
[AUDIENCE LAUGHS]
$ mkvinfo Seinfeld.S01E01.The.Seinfeld.Chronicles.mkv
...
|+ Segment tracks
...
| + A track
| + Track number: 3 (track ID for mkvmerge & mkvextract: 2)
| + Track UID: 17434673961305370787
| + Track type: subtitles
| + Lacing flag: 0
| + Codec ID: S_TEXT/UTF8
void setup() {
background(255, 255, 255);
size(1120, 860);
translate(50, height - 15);
scale(0.1,-0.1);
frameRate(30);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bertrandom
bertrandom / gist:7508762
Created November 17, 2013 03:38
Resize a bunch of images to exactly 640x480 with black borders if they don't fit the dimensions
ls *.jpg | xargs -n1 sh -c 'convert $0 -resize 640x480 -background "#000000" -gravity center -extent 640x480 fixed/$0'