Skip to content

Instantly share code, notes, and snippets.

wuziq / Timer.cpp
Created May 21, 2021 — forked from mcleary/Timer.cpp
C++ Timer using std::chrono
View Timer.cpp
#include <iostream>
#include <chrono>
#include <ctime>
#include <cmath>
class Timer
void start()
wuziq /
Created Dec 14, 2020 — forked from bennylope/
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

wuziq / git diff patch between
Created Nov 13, 2020 — forked from patkujawa-wf/git diff patch between
If you want to get the difference between two branches as a diff patch
View git diff patch between

If you want to get the difference between two branches, say master and branch-name, use the following command: git diff master..branch-name

If you want that same diff in a patch, because patches are handy, just add the output redirect: git diff master..branch-name > branch-name.patch

If you need to import that patch into something like Crucible then you'll need to get rid of the a and b prefixes that git adds: git diff --no-prefix master..branch-name > branch-name.patch

wuziq /
Created Sep 2, 2018 — forked from mikoim/
YouTube recommended encoding settings on ffmpeg (+ libx264)
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low output
wuziq /
Created Aug 23, 2017 — forked from neilpa/
Use ffmpeg to convert raw Android camera frame buffers
# Assuming the raw byte[] buffer from onPreviewFrame was written at $1
# Need preview size since we dumped to a raw file w/out header info
# Converting to JPEG
ffmpeg -f image2 -vcodec rawvideo -s $SIZE -pix_fmt nv21 -i $INPUT out.jpeg
# Converting to PNG
wuziq / .vimrc
Last active Aug 29, 2015 — forked from rocarvaj/.vimrc
View .vimrc
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)