惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Securelist
AI
AI
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threat Research - Cisco Blogs
T
Tenable Blog
G
GRAHAM CLULEY
腾讯CDC
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AWS News Blog
AWS News Blog
D
Docker
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Latest news
Latest news
L
LINUX DO - 热门话题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
L
LangChain Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
Cloudbric
Cloudbric
Attack and Defense Labs
Attack and Defense Labs
量子位
爱范儿
爱范儿
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
J
Java Code Geeks
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
N
Netflix TechBlog - Medium
博客园 - 司徒正美
I
InfoQ
WordPress大学
WordPress大学
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News

Jeff Geerling

Adding a backup Internet WAN on my OPNsense Router Open Sauce and GPS time were my summer AI Antiseptics QuadRF can spot drones and see WiFi through my wall The Special Value Pi 4 was extremely short-lived Framework You can finally power on a Mac remotely I tested every IP KVM in my Homelab It's hard to justify buying a Framework 12 Tuning in FM Radio on a 3D Printer Heatbed I patched iozone for better disk benchmarks on modern macOS News about Raspberry Pi 6 and Microcontroller Development Wi-Wi Is Wireless Time Sync at 1 nanosecond Bambu Lab is abusing the open source social contract HomePod mini feels like magic, but it's just good timing SBC Clusters are a terrible value, but they're fun anyway Raspberry Pi Connect may control Windows soon New 10 GbE USB adapters are cooler, smaller, cheaper An Arm Mainboard for the Framework Laptop Build your own Dial-up ISP with a Raspberry Pi DRAM pricing is killing the hobbyist SBC market Bring back MiniDV with this Raspberry Pi FireWire HAT Using FireWire on a Raspberry Pi The best laptop Apple ever made Restoring an Xserve G5: When Apple built real servers Can the MacBook Neo replace my M4 Air? A PTP Wall Clock is impractical and a little too precise I built a pint-sized Macintosh Expert Beginners and Lone Wolves will dominate this early LLM era
Quickly apply LUTs (color grading) with ffmpeg
jeff@jeffgee · 2026-06-26 · via Jeff Geerling

This is a quick post, mostly for my own reference.

I've avoided LUTs and 'Log' video footage for years1, mostly because of the extra tiny bit of workflow involved. Like RAW photos, 'Log' footage retains the video sensor's full dynamic range, so you can pull more color and luminance information out of the footage later.

But unlike photography, where RAW has been a thing for decades, and many workflows 'just work' without me having to 'grade' every individual photo, in video precious few consumer apps handle Log footage gracefully. You generally end up with a muddy grey mess.

I don't want to launch DaVinci Resolve or Final Cut Pro to process every video I shoot. Especially if I am recording in Log for a particular reason, but forget to switch back to 'normal' mode and shoot more clips later.

Jeff graded and ungraded

The difference is stark2, as illustrated by this clip (above) I was shooting with my kids around the house with my DJI Osmo Pocket 4. I just picked it up and was testing it, and I realized I still had it in '10-bit D-Log' mode after I imported the footage to my computer.

I didn't want to go through launching Final Cut Pro just to grade a half-dozen clips to put them into our family video library, so I turned to ffmpeg, after seeing this mention of the built-in lut3d filter.

ffmpeg for LUTs

The full ffmpeg command I'm using is:

ffmpeg \
  -i /Users/jgeerling/Downloads/DJI_20000219193052_0005_D.MP4 \
  -vf "lut3d=osmo-vivid.cube" \
  -c:v hevc_videotoolbox \
  -profile:v main10 \
  -b:v 30M \
  -pix_fmt p010le \
  -tag:v hvc1 \
  -c:a copy \
  DJI_0005_D_converted.mp4

Some of those flags will only work on a Mac, where Apple's hardware H.265 video encoder is present. The main thing is -vf "lut3d=osmo-vivid.cube", which is the path to a .cube file for your specific camera/footage.

In this case, I'm using the DJI Osmo Pocket 4 'vivid' LUT3.

If you'd like to modify the ffmpeg flags to target your own hardware's H.264 or H.265 acceleration, just grab the command above and run it through your favorite LLM. After a couple decades using ffmpeg, it still feels like AP Calculus 2 trying to remember all the various flags and abbreviations :D

I'd love there to be a standard for 'LUT sidecars'. Apple, BlackMagic, Sony, and others do embed LUT data in video files... but there's no standard, so you need DaVinci Resolve for Blackmagic camera clips, QuickTime for iPhone clips... and in the end, most non-pro apps will just show a muddy video file if you don't process it like I'm doing with ffmpeg. Sigh.

Given a particular .cube file, here's how you can apply the LUT to all the MP4 files in a given folder:

#!/bin/bash
CUBE="osmo-vivid.cube"
DIR="video_files"

files=("$DIR"/*.MP4)
total=${#files[@]}
count=0

for input in "${files[@]}"; do
    [ -e "$input" ] || continue
    ((count++))
    echo "Processing file $count of $total: $(basename "$input")"
    
    ffmpeg -i "$input" -vf "lut3d=$CUBE" -c:v hevc_videotoolbox -profile:v main10 -b:v 30M -pix_fmt p010le -tag:v hvc1 -c:a copy "${input%.MP4}_converted.mp4"
done

Put the path to your .cube file in CUBE, and the path to a directory with a bunch of ungraded .MP4 files in DIR. Save the script, make it executable, and run it!