badd10de.dev

Video Production


Capture X11 desktop with ffmpeg

Capture an uncompressed region on the second monitor.

ffmpeg -f x11grab \
    -show_region 1 \
    -s 1024x768 \
    -r 30 \
    -i :0.0+2560,0 \
    -qscale 0 \
    -vcodec huffyuv \
    filename.avi

Encode a video to mp4 with the h264 codec

ffmpeg -i filename.avi -vcodec h264 -pix_fmt yuv420p -strict -2 filename.mp4

Convert a video to gif, changing the fps, speed it up 2x, adjusting the scale to 1024 and trimming the first second.

ffmpeg -ss 1 \
    -i filename.avi \
    -vf "fps=10,setpts=0.5*PTS,scale=1024:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \
    -loop 0 \
    filename.gif

Color grading

Normally you want to follow the following workflow:

  1. Color correction by adjusting the gamma, exposure and saturation (Using waveform, vectorscope and histogram).
  2. White balancing
  3. Applying desired style (i.e. teal + orange, LUTs, etc.)

Resources