Skip to content

Instantly share code, notes, and snippets.

@Orangestar12
Orangestar12 / ffmpeg.md
Last active Sep 25, 2021
quick ffmpeg cheat sheet
View ffmpeg.md

These are a few quick easy ffmpeg command lines that can be used to make oft-used video formats. I use them a lot so I wrote them down in a txt file but I converted it to markdown to upload here and access on all my pcs.

Feel free to use 'em. I've gathered them through superuser posts, wiki trawls, and personal experience.

General notes

  • Add -movflags faststart to make mp4 files have their headers at the beginning of the file, allowing them to be streamed (i.e. played even if only part of the file is downloaded).
  • The MP4 container supports MP3 files, so if libfdk_aac isnt available (it's the only good AAC enc) use libmp3lame.
    • Update: unless you're uploading them to Twitter. Twitter doesn't like MP4 files with MP3 audio. Fall back to AAC and provide a higher quality alternative somewhere else.
  • For MP4 files, use -preset X to use MP4 enc presets, like slow or superfast. (veryfast or fast is ok)
View MAKE A WEBPAGE SCARED AND FRIGHTENED.js
function SHOUTIFIER(nodelist) {
if ('childNodes' in nodelist && nodelist.childNodes.length != 0) {
for (x of nodelist.childNodes) {
SHOUTIFIER(x);
}
}
else {
if ( nodelist.textContent == '') { return; }
nodelist.textContent = nodelist.textContent.replace(/[a-zA-Z0-9]/ig, 'A');
}
@Orangestar12
Orangestar12 / irv.py
Last active Feb 21, 2016
It's relatively slow but it works.
View irv.py
# -*- coding: utf-8 -*-
import csv
Filename = input('CSV Filename:')
with open(Filename, newline='') as csvdata:
csvFile = csv.reader(csvdata)
csvList = []
for row in csvFile:
csvList.append(row)
View WADParser.py
#!/usr/bin/env python3
import struct
import re
class Wad(object):
"""Encapsulates the data found inside a WAD file"""
def __init__(self, wadFile):
"""Each WAD files contains definitions for global attributes as well as map level attributes"""