Skip to content

Instantly share code, notes, and snippets.

@dlublin
dlublin / ffmpeg-hap-readme.md
Created April 18, 2017 13:40
Encoding to Hap from the command line using FFmpeg

Encoding to Hap from the command line using FFmpeg

For users who prefer working with a command line or need to access advanced encoding settings for Hap the popular FFmpeg library can be used to work with Hap movies.

  1. If this is your first time using FFmpeg you may need to install it on your system, or compile it from source. In either case be sure that Snappy is enabled as part of the binary. If you already have FFmpeg on your system with Snappy enabled, you can skip this step.

    You can check that your version of FFmpeg can encode Hap using

    ffmpeg -encoders | grep hap
    
@dlublin
dlublin / FFmpeg_HAP_Image_Sequence.txt
Last active April 13, 2021 13:33
Image sequence to HAP movie via ffmpeg
This is based on the tips from,
http://hamelot.io/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video/
and adapted it to this line to export to HAP directly from a tif sequence,
"ffmpeg -r 30 -f image2 -s 1920x1080 -i test%02d.tif -vcodec hap -pix_fmt rgba test.mov"
(without quotes of course)
- i is where you set the pattern for the image sequence naming,
(where the %02d means that zeros will be padded until the length of the string is 2 i.e 01…20…30… and so on. If no padding is needed use something similar to pic%d.png or %d.png)
-r is the framerate (fps)
-s is the resolution
@dlublin
dlublin / hapqalphaconversion.frag
Created November 19, 2017 21:07
GLSL fragment shader that performs YCoCg conversion and combines the colour and alpha planes for Hap Q Alpha frames.
uniform sampler2D cocgsy_src;
uniform sampler2D alpha_src;
const vec4 offsets = vec4(-0.50196078431373, -0.50196078431373, 0.0, 0.0);
void main()
{
vec4 CoCgSY = texture2D(cocgsy_src, gl_TexCoord[0].xy);
vec4 theAlpha = texture2D(alpha_src, gl_TexCoord[0].xy);
@dlublin
dlublin / hapqconversion.frag
Created November 19, 2017 21:05
GLSL shader that performs YCoCg conversion and can be used for drawing Hap Q frames.
uniform sampler2D cocgsy_src;
const vec4 offsets = vec4(-0.50196078431373, -0.50196078431373, 0.0, 0.0);
void main()
{
vec4 CoCgSY = texture2D(cocgsy_src, gl_TexCoord[0].xy);
CoCgSY += offsets;
@dlublin
dlublin / amateur internet tendency
Created October 17, 2012 20:01 — forked from auremoser/amateur internet tendency
this gist compiles all of the most painfully perfect things prefaced with "amateur" as an adjective
amateur amateur (META)
I like the idea of being an amateur at something you just are, native, not like a vocation...amateur adult also fits in this category. how about amateur parent, amateur mammal, amateur bipedal creature
or puns #duh: amature amateur *tweeting this*
oxymoronic or redundant ones are good too. ex: amateur demolitions expert; amateur waffle enthusiast, amateur hobbyist
amateur CERN fellow
amateur astronaut