Skip to content

Instantly share code, notes, and snippets.

@dlublin
dlublin / FFmpeg_HAP_Image_Sequence.txt
Last active Apr 13, 2021
Image sequence to HAP movie via ffmpeg
View FFmpeg_HAP_Image_Sequence.txt
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 Nov 19, 2017
GLSL fragment shader that performs YCoCg conversion and combines the colour and alpha planes for Hap Q Alpha frames.
View hapqalphaconversion.frag
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 Nov 19, 2017
GLSL shader that performs YCoCg conversion and can be used for drawing Hap Q frames.
View hapqconversion.frag
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 / ffmpeg-hap-readme.md
Created Apr 18, 2017
Encoding to Hap from the command line using FFmpeg
View ffmpeg-hap-readme.md

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 / amateur internet tendency
Created Oct 17, 2012 — forked from auremoser/amateur internet tendency
this gist compiles all of the most painfully perfect things prefaced with "amateur" as an adjective
View amateur internet tendency
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