今日已更新 84 条资讯 | 累计 37333 条内容
关于我们

标签:#ffmpeg

找到 15 篇相关文章

AI 资讯

Frame-accurate FFmpeg trimming without re-encoding the whole file

TL;DR -c copy can only cut on keyframes, so your 12.4s trim starts wherever the last keyframe was. We'll build a smart-trim script that probes keyframe positions with ffprobe , re-encodes only the head and tail fragments, stream copies everything between them, and concatenates the three. Frame accurate output, encoding cost proportional to two GOPs instead of the whole file. Tested with FFmpeg 9.0 "Lei" (released 2026-08-04) and Node 22.x. The JS is ESM, so put "type": "module" in your package.json before running any of it. Everything here also works on FFmpeg 7.x and 8.x; nothing we use is new. The problem, in two commands 🎬 # fast, and wrong ffmpeg -ss 12.4 -i input.mp4 -t 20 -c copy fast.mp4 ffprobe -v error -show_entries format = start_time,duration -of default = nw = 1 fast.mp4 # start_time=0.000000 # duration=20.388000 <- we asked for 20, starting at 12.4 The clip is long by the distance from our requested start back to the previous keyframe, and every frame in it is shifted earlier than the user asked for. Stream copy moves compressed packets without decoding them. Most frames in a compressed stream only describe the difference from their neighbors, so the only place you can start is a keyframe. FFmpeg snaps back to the nearest preceding one, and your clip starts early. # accurate, and slow on a long source ffmpeg -ss 12.4 -i input.mp4 -t 20 -c :v libx264 -crf 20 -c :a aac slow.mp4 We want the accuracy of the second and roughly the cost of the first. 1. Look at your keyframes first Before writing any code, find out how bad the problem is for your content: ffprobe -v error -select_streams v:0 \ -show_entries packet = pts_time,flags \ -of csv = print_section = 0 input.mp4 | grep 'K' | head -20 0.000000,K__ 2.002000,K__ 4.004000,K__ 6.006000,K__ Two second GOPs here, so worst-case error is about two seconds. Screen recorders and some camera output emit keyframes on scene change only, and there the gaps can be 30 seconds or more. That distribution is the real spe

2026-08-27 原文 →
AI 资讯

Whole-Ad Product Swap: Deterministic Planning First, Model Only Where Forced

Variant Multiplier already let an editor swap one section of a winning ad and keep the rest. The next request from a real production job — replacing product SL-603 with SL-808, a different hearing-aid SKU, across an entire finished ad — was a different shape of problem. It's not "change one section," it's "change every mention of the product, everywhere it appears, while keeping literally everything else the same." Two direct quotes from the editor drove the whole five-PR arc: the transcript editing was too rigid for word-by-word changes, and separately, "the music, voice, etc. should retain the same, we should keep the quality the same, and not make it do a lot of changes." If a re-render can degrade something the editor explicitly asked to keep untouched, the render path is wrong for the job — no matter how good the model is. The cheap fix first: let editors actually edit PR #67 shipped before any product-swap work started, because it was the cheap, high-value half of the same feedback: "I am just able to select word by word here but I am not really able to change the whole sentence a lot easier," and separately, "I'm able to double click on these words and then just type it in." Both were UI gaps in the transcript editor, not pipeline gaps — selecting by sentence or scene instead of only by word, and retyping a line verbatim instead of only substituting individual words. Shipping this first, standalone, meant the harder product-swap work that followed didn't also have to carry an unrelated UX fix in its diff. A product catalog the tool never had PR #69, stacked directly on top of the transcript work, is pure groundwork with no user-visible feature of its own: a product catalog, because Variant Multiplier had no concept of "a product" at all before this. The editor's own framing made the requirement explicit: "have a product selection right here, for Pro Bluetooth, for [the other SKU], and maybe other tons of products" going forward. The catalog data itself is mai

2026-08-26 原文 →
AI 资讯

Building a Video Thumbnail Generator Service with Go and FFmpeg Workers

Every video card on our category grids was hotlinking a 1280x720 JPEG from a third-party CDN and then letting CSS scale it down to about 320 device-independent pixels. That is roughly 90 KB of wasted transfer per card, 24 cards per page, across eight regional page variants that each carry their own cache key. Mobile LCP on the busiest category pages sat at 4.1s, and the largest single contributor was an image we did not host, could not resize, and could not re-encode to WebP. The fix was not clever CSS. It was owning the frame. We built a small Go service that takes a source video (a partner preview MP4, or a poster frame that arrives at the wrong dimensions), pulls a representative frame with FFmpeg, encodes it at three widths in WebP, and writes the result to a content-addressed path the front end links directly. That service now feeds the same multi-region cron that runs TrendVidStream , and the generated files ride the same FTP mirror as the rest of the deploy. What follows is the part that actually mattered: the FFmpeg invocations, the Go concurrency model that keeps a 2-core build box from melting, and how a stateless Go daemon hands work to a PHP 8.4 + SQLite front end that cannot run a daemon at all. Why this is not a PHP job Our front end is PHP 8.4 on LiteSpeed shared hosting with SQLite (FTS5 for search) as the only datastore. It is a genuinely good fit for a read-heavy discovery site: no database server to babysit, page cache on disk, cron jobs pulling regional feeds every 2-7 hours depending on the site. It is a terrible fit for thumbnail extraction: Shared hosting caps max_execution_time at 180s. A cold FFmpeg decode of a 4-minute 1080p preview can burn 20-40s. Do 200 of them in one cron tick and you are wearing a hard timeout. shell_exec is frequently disabled, and when it is not, you get one process per request with no way to bound total concurrency. There is no shared memory between PHP requests, so two cron ticks racing on the same video ID will ha

2026-08-19 原文 →
AI 资讯

Four Ways My Unattended Video Pipeline Died Overnight — and How I Made It Heal Itself

The morning after I lost my job, my Mac finished and filed an ASMR video. Nobody asked it to. It just ran. In the first post, I walked through the structure of the pipeline itself — ComfyUI × FFmpeg × the Freesound API, generating long-form ASMR videos with nothing but free tools. This second post covers the other half: putting that pipeline on macOS launchd so it fires at a fixed time every day, and the self-healing logic that gets the script past the "cold start" problem, where you boot the Mac and ComfyUI simply isn't running. Two numbers do most of the work here: the ComfyUI startup wait went from 180 seconds to 600, and the Freesound download timeout went from 90 seconds to 240. Before those changes, mornings failed 2–3 days a week. Why this setup works The ceiling on manual work Making a single 30-minute ambient ASMR video carefully takes 2–3 hours of hands-on time. Tuning image-generation prompts, layering the BGM, checking the loop points, building the thumbnail, filling in YouTube metadata — each step is small, but they stack up. Trying to hold 30 videos a month means 60–90 hours of pure labor. I attempted it while holding a side job, and it collapsed in two weeks. That was the first time I understood that "scaling output" isn't about moving your hands faster — it's about building a state where output accumulates without your hands at all. When I was laid off and my income went to zero, the first thing I rebuilt was this environment . Own an environment, not a workflow The essence of automation is constructing, exactly once, a mechanism where output keeps growing while you do nothing. That's precisely what daily.sh delivers: when the script finishes, ~/Desktop/ASMR/<date>_<theme>/ lands atomically with the video, thumbnail, youtube.md, and still image all in place. I just check it the next morning. Whether I step away mid-generation or I'm asleep, the files keep piling up. One line in the code embodies the whole philosophy: # 冪等性は「その日に1本でもあればskip」(1日1本・テーマ違

2026-08-16 原文 →
AI 资讯

Claude Code can make videos: it records the app, narrates with ElevenLabs, and syncs audio to video automatically

I'm a solo builder. I needed a 2-minute product demo for ClinTrialFinder — a free tool I built that matches cancer patients to clinical trials. I can fumble through OBS and iMovie, but I'm not proficient — and Claude Code does it faster. So I asked Claude Code — an agentic coding tool — to make it. And it did: a narrated walkthrough where the voiceover lands exactly on the on-screen action. I never opened a screen recorder. I never opened a video editor. I never manually lined up a single caption to a single frame. Here's the video it produced . This post is about the three things the agent did to make it — because I think that combination is new. 1. It recorded the app — no screen recording Instead of me screen-capturing a session by hand, the agent wrote a Playwright script that drives the real, live web app : it opens the site, fills out the 10-step patient wizard with a synthetic case, submits, and records the finished results page — all headless, straight to video. That means no manual take, no re-shooting when I fumble a click, no "oops the mouse jittered." The recording is code , so it's deterministic and repeatable. When the product changes, the agent re-runs the script and out comes a fresh clip. It even injected a fake cursor that glides between elements, because a headless recording has no real mouse pointer. 2. It generated the narration — no microphone I didn't record a voiceover. The agent wrote the narration script, then called the ElevenLabs text-to-speech API to synthesize it in a clean, consistent voice. If I want to change a line, it edits the text and regenerates that clip in seconds — no re-recording, no "let me find a quiet room," no matching my tone across takes. // the agent calls ElevenLabs per narration phrase const res = await fetch ( `https://api.elevenlabs.io/v1/text-to-speech/ ${ VOICE } ` , { method : ' POST ' , headers : { ' xi-api-key ' : KEY , ' Content-Type ' : ' application/json ' }, body : JSON . stringify ({ text , model_id : '

2026-08-15 原文 →
AI 资讯

I built a friendlier FFmpeg with 36 verbs and a TUI (and it's one line to install)

Mediax: FFmpeg's Cooler Cousin 🚀 FFmpeg is powerful, but the syntax? A nightmare. So I built Mediax. 36 intuitive verbs. Interactive TUI. One-line install. Convert, compress, trim, crop, rotate, add watermarks... all with simple commands. bash mediax convert input.mov output.mp4 mediax compress large.mp4 small.mp4 --quality medium mediax trim video.mp4 clip.mp4 --start 00:01:30 --duration 10 Just run mediax for the interactive terminal interface. One-line install curl -sSL https://raw.githubusercontent.com/robert-sarah/mediax/main/install.sh | sh Built with Go Single binary — no dependencies Cross-platform: Windows, macOS, Linux Open source (MIT) 36 verbs for everything Conversion: convert, compress, gif Audio: extract-audio, mute, volume, replace-audio Video: trim, crop, resize, rotate, flip, concat, split Effects: speed, reverse, blur, sharpen, fade-in, fade-out Advanced: watermark, subtitle, thumbnail, template, batch Examples Resize for Instagram mediax template video.mp4 insta_video.mp4 --platform instagram Extract audio from 1:30 to 1:40 mediax extract-audio video.mp4 clip.mp3 --start 00:01:30 --duration 10 Detect video issues mediax wtf video.mp4 Why I built it I was tired of copying FFmpeg commands from Stack Overflow and breaking files because I forgot a flag. Mediax makes FFmpeg accessible for beginners and faster for pros. Try it today Repo: github.com/robert-sarah/mediax Contributions welcome! 🙏

2026-08-09 原文 →
开源项目

🛠️ How to Run a Privacy-First, Browser-Based Stream Downloader (FlowPick) — A Hands-On Tutorial

Hey folks 👋 If you've ever wanted to save a video lecture, a livestream replay, or a podcast episode for offline listening, you've probably run into the usual options: sketchy "online video parser" websites that ask you to paste your link into their server, or desktop apps that want you to sign up and upload stuff. Neither feels great when the whole point is your content. I went looking for something better and ended up working with FlowPick — an open-source, privacy-first media downloader that runs entirely in your browser. No uploads, no accounts, no telemetry. Everything (sniffing, downloading, merging, transcoding) happens client-side with FFmpeg compiled to WebAssembly. In this tutorial we'll: Clone and run FlowPick locally Download our first HLS ( .m3u8 ) and DASH ( .mpd ) stream Build and deploy it Poke at the internals so we can customize it If you just want to try it without installing anything, there's a hosted version at https://flowpick.net (more below). The full source is on GitHub: https://github.com/ezwebtools/flowpick . 🔗 Repo: https://github.com/ezwebtools/flowpick · Live tools: https://flowpick.net A 30-second primer: what are HLS and DASH? Before we touch code, two words you'll see everywhere in this space: HLS (HTTP Live Streaming) uses a .m3u8 manifest that lists small .ts (or fMP4) segments. Common for live streams and a lot of video platforms. DASH (Dynamic Adaptive Streaming over HTTP) uses a .mpd manifest; video and audio usually travel as separate .m4s tracks. YouTube and Bilibili lean on this. The key idea: the "video" isn't one file. It's a playlist pointing at dozens (sometimes hundreds) of tiny segments. A downloader's job is to fetch all the segments, decrypt them if needed, and stitch them back into one playable file. That's exactly what FlowPick does — in the browser. What FlowPick is, in one paragraph FlowPick is a Nuxt 4 app that ships in two shapes: A browser extension that sniffs media from the current tab's network requests. An

2026-07-26 原文 →
AI 资讯

AI-Enabled Security Researchers Discover How a Crafted Video Can Provide Attackers Access to Your PC

JFrog Security Research revealed "PixelSmash," a vulnerability in the FFmpeg media framework, allowing for Remote Code Execution and Denial of Service attacks. Present for sixteen years, it affects numerous applications using the MagicYUV decoder. Exploitation requires only a crafted media file. Users are advised to check for the vulnerability and apply patches or disable the decoder if necessary. By Olimpiu Pop

2026-07-26 原文 →
AI 资讯

How I make ffmpeg hit an exact file size (the bitrate math nobody explains)

Every few weeks I hit the same wall: I have a 300 MB screen recording, and something on the other end wants it under 8 MB . Discord, an email attachment, a bug tracker, a form that silently rejects anything bigger. The usual advice is "just use HandBrake" or "run ffmpeg with a lower CRF." But CRF doesn't take a target size — it takes a quality knob . So you export, check the size, it's 11 MB, nudge the knob, export again, now it's 5 MB and looks like a potato, nudge back… It's a binary search you run by hand, one full encode per guess. The thing is, hitting an exact size isn't a guessing game at all. It's arithmetic you can do before you encode. I ended up wrapping that arithmetic into a little Rust CLI ( DeepShrink ), but the math is the interesting part, and almost nobody writes it down. So here it is. The one insight everything rests on File size is (roughly) bitrate × duration . A bitrate is bits per second. A duration is seconds. Multiply them and the seconds cancel, leaving bits — the size of the file. That's it. That's the whole trick. Normally you treat bitrate as the input and size as whatever falls out. Flip it around: fix the size, measure the duration, and solve for the bitrate. You know the duration (ffprobe will tell you), and you know the size you want (the platform's limit). The only unknown is the bitrate — and now it's a single division away. bitrate = size_in_bits / duration_in_seconds Everything below is just this equation with the real-world messiness added back in. Building the budget, step by step Say I want a 60-second clip to fit Discord's 8 MB limit. 1. Turn the target size into bits. Sizes are in bytes, bitrate is in bits, so multiply by 8. (I'll use 1 MB = 1,000,000 bytes here to keep the mental math clean; if your platform means mebibytes, same method, different constant.) target_bits = 8_000_000 bytes × 8 = 64_000_000 bits (64 Mbit) 2. Reserve a little for container overhead. An .mp4 isn't pure video and audio — there's a container, a m

2026-07-19 原文 →
AI 资讯

Probing FFmpeg's av1_vulkan encoder: does your GPU actually support it?

TL;DR FFmpeg 8.x includes av1_vulkan , the first cross-vendor GPU AV1 encoder in mainline FFmpeg. We'll probe whether your GPU + driver actually expose AV1 encode, run a first working encode, benchmark it against SVT-AV1 on your own content, and talk about which jobs deserve it. 📦 Code: github.com/USER/repo (replace before publishing) Until FFmpeg 8.0 ("Huffman", released August 2025), GPU AV1 encoding meant picking a vendor: av1_nvenc for NVIDIA RTX 40+, av1_amf for AMD, av1_qsv for Intel Arc. Three code paths, three sets of flags, three driver stacks. The Vulkan Video encode work gives FFmpeg one encoder that reaches all three vendors through the standard VK_KHR_video_encode_av1 extension. The catch: driver support is a lottery. Plenty of capable hardware sits behind drivers that don't expose the encode extension yet. So before any pipeline decisions, we probe. 1. Check what you're running You want FFmpeg 8.x (8.1.2 is current as of late June 2026) built with Vulkan support, plus the vulkaninfo tool from the Vulkan SDK / vulkan-tools package. $ ffmpeg -version | head -1 ffmpeg version 8.1.2 Copyright ( c ) 2000-2026 the FFmpeg developers $ ffmpeg -hide_banner -encoders | grep vulkan V....D av1_vulkan AV1 ( Vulkan ) ( codec av1 ) If av1_vulkan doesn't appear, your build wasn't compiled with --enable-vulkan (distro packages vary; the BtbN static builds and most 8.x distro packages include it). 2. Probe the driver for AV1 encode 🔍 The encoder existing in FFmpeg means nothing if the driver doesn't expose the extension. This is the step that separates "should work" from "works": $ vulkaninfo | grep -iE "video_encode_(av1|queue)" VK_KHR_video_encode_av1 : extension revision 1 VK_KHR_video_encode_queue : extension revision 12 You see Meaning Both extensions listed You can encode AV1 via Vulkan 🎉 Only video_encode_queue Driver does Vulkan encode, but not AV1 (maybe H.264/H.265 only) Neither Driver too old, or GPU lacks an AV1-capable video engine Rough hardware floor: the

2026-07-08 原文 →
AI 资讯

How to Use FFmpeg with Pipedream (No Timeout Errors, No Binary Setup)

Originally published at ffmpeg-micro.com If you've tried running FFmpeg inside a Pipedream workflow, you've probably hit one of two walls: the step timed out before processing finished, or the FFmpeg binary wasn't available. These are the most common complaints in Pipedream community threads, and neither has a clean workaround. Why FFmpeg Breaks in Pipedream Pipedream workflows run Node.js steps with a 30-second default execution timeout . Paid plans extend that to 300 seconds. But even five minutes isn't enough to transcode most videos. A 10-minute 1080p file can take 3-8 minutes to process depending on the codec and output settings. Longer videos or higher-quality encodes blow past that limit every time. The timeout kills your step mid-execution. No partial output. No graceful failure. Just a dead workflow. Then there's the binary problem. FFmpeg isn't available in Pipedream's runtime environment. Developers on the Pipedream community forums have tried downloading the static binary at runtime, setting PATH variables, and running chmod inside a Node.js step. Some of these hacks work intermittently. Most break the next time Pipedream updates its execution environment. And even if you solve both problems, Pipedream steps have memory constraints that make video processing unreliable. A single high-resolution transcode can exhaust available RAM and crash silently. The Fix: Call an FFmpeg API Instead The timeout issue goes away when you stop running FFmpeg inside the workflow. Make an HTTP request to an external API instead. The API processes the video on its own infrastructure with no time limit. Your Pipedream step sends the request, gets back a job ID, and moves on. FFmpeg Micro processes video through a standard REST API, so any Pipedream HTTP step can call it. No marketplace plugin to install. No binary to configure. Just a POST request and a polling loop. This is different from tools like Rendi or Renderio.dev that require a native Pipedream marketplace integratio

2026-07-07 原文 →
AI 资讯

How to Use FFmpeg with Swift (No Installation Required)

Originally published at ffmpeg-micro.com You need server-side video processing in your Swift app. Maybe you're building a Vapor backend that transcodes user uploads, a macOS utility that batch-converts media files, or a command-line tool that generates thumbnails. FFmpeg is the standard tool for the job, but getting it into a Swift project isn't as simple as adding a package dependency. Running FFmpeg from Swift with Process Swift's Foundation framework provides the Process class for running external commands. If FFmpeg is installed on the machine, you can shell out to it directly: import Foundation let process = Process () process . executableURL = URL ( fileURLWithPath : "/opt/homebrew/bin/ffmpeg" ) process . arguments = [ "-i" , "input.mp4" , "-c:v" , "libx264" , "-crf" , "23" , "-preset" , "medium" , "-c:a" , "aac" , "-b:a" , "128k" , "output.mp4" ] let pipe = Pipe () process . standardOutput = pipe process . standardError = pipe try process . run () process . waitUntilExit () let data = pipe . fileHandleForReading . readDataToEndOfFile () let output = String ( data : data , encoding : . utf8 ) ?? "" print ( output ) guard process . terminationStatus == 0 else { fatalError ( "FFmpeg failed with exit code \( process . terminationStatus ) " ) } This works on macOS and Linux. Install FFmpeg with brew install ffmpeg on macOS or apt-get install ffmpeg on Ubuntu, point executableURL at the binary, and you're running. But you own that FFmpeg install on every machine. On Linux servers, you're managing the binary across deploys. On macOS CI runners, you're adding Homebrew steps to your build pipeline. And on iOS, Process doesn't exist at all. Processing Video via Cloud API (No FFmpeg Install) Skip the local binary entirely. FFmpeg Micro exposes full FFmpeg capabilities through a REST API. Send a video URL, pick your settings, get processed video back. If you're familiar with how this works in Node.js or Kotlin , the pattern is identical. Here's the basic flow using URLSe

2026-07-07 原文 →
AI 资讯

Benchmark NVENC vs CPU transcoding (and find your real break-even) with FFmpeg

📦 Code: github.com/USER/nvenc-vs-cpu-bench - replace before publishing TL;DR A GPU encodes faster than a CPU, but "faster" and "cheaper" are different claims. We'll build a small FFmpeg + VMAF harness that times software (libx264/SVT-AV1) against hardware (h264_nvenc/av1_nvenc), then plug the results into a dollars-per-encoded-minute formula so you find your break-even instead of trusting a benchmark blog. We're using FFmpeg 7.1.x (current stable line) and an NVIDIA GPU with NVENC. Same approach works for Intel QSV ( *_qsv ) and AMD AMF ( *_amf ) if you swap the encoder names. Why this isn't obvious NVENC is a fixed-function hardware block, not "the GPU doing x264 in parallel." It's extremely fast and barely touches the CPU, but it exposes fewer rate-control knobs and gives up a little compression efficiency versus a slow software preset. The gap has narrowed a lot, but it's still there at the quality-obsessed end. So the decision is per-job, and it comes down to one number: dollars per encoded minute = (instance $/hr) ÷ (minutes encoded/hr) . GPU instances cost more per hour but encode many streams in parallel, so the answer depends on whether you can keep the encoder saturated. Let's measure instead of argue. 1. Set up the encoders Three contenders. One representative source file (use real footage, not a synthetic clip). # software H.264, quality-leaning preset ffmpeg -y -i source.mp4 -c :v libx264 -preset slow -crf 21 -an out_cpu.mp4 # NVENC H.264, quality-tuned ffmpeg -y -hwaccel cuda -i source.mp4 -c :v h264_nvenc -preset p6 -tune hq \ -rc vbr -cq 23 -an out_gpu.mp4 # AV1: software (SVT-AV1) vs hardware (needs Ada / RTX 40+) ffmpeg -y -i source.mp4 -c :v libsvtav1 -preset 6 -crf 30 -an out_svtav1.mp4 ffmpeg -y -hwaccel cuda -i source.mp4 -c :v av1_nvenc -preset p5 -cq 30 -an out_av1nvenc.mp4 💡 Tip: -preset p1 (fastest) through -preset p7 (slowest/highest quality) for NVENC. p6 / p7 is where it competes on quality; p1 - p3 is where it competes on raw throughput.

2026-07-06 原文 →
AI 资讯

FFmpeg HDR to SDR tone mapping that doesn't look washed out (2026)

TL;DR Converting HDR10 to SDR with a naive FFmpeg command gives you grey, washed-out video. The fix is tone mapping. We will detect HDR with ffprobe , run two working tone-map chains ( zscale on CPU, libplacebo on GPU) in FFmpeg 8.0, compare operators, and batch it. Test the commands on your own build before shipping. 📦 Code: github.com/USER/hdr-to-sdr, replace before publishing If you have ever run an HDR clip through your normal pipeline and gotten back something flat and foggy, this post is for you. The bug is that HDR and SDR are different color systems, and "just converting" reinterprets one as the other. We will use FFmpeg 8.0 "Huffman" (8.0.2 is current as of May 2026). Why naive conversion fails HDR10 SDR Transfer function PQ (SMPTE ST 2084) gamma 2.4 / BT.1886 Color primaries Rec.2020 (wide) BT.709 (narrow) Peak luminance ~1,000 to 4,000 nits ~100 nits A command that ends in -pix_fmt yuv420p with no tone mapping reads PQ-encoded, Rec.2020 values as if they were SDR. The gamut gets crushed with no intelligence and the brightness curve is misread. Hence the fog. 1. Detect whether a file is even HDR 🔍 Do not tone-map SDR files. Check first: # detect transfer characteristics and primaries ffprobe -v error -select_streams v:0 \ -show_entries stream = color_transfer,color_primaries,color_space \ -of default = noprint_wrappers = 1 input.mkv HDR10 content reports something like: color_space = bt2020nc color_transfer = smpte2084 color_primaries = bt2020 If color_transfer is smpte2084 (PQ) or arib-std-b67 (HLG), you have HDR and you need to tone-map. If it says bt709 , leave it alone. 2. The libplacebo path (GPU, my default) 🚀 libplacebo is the Vulkan-accelerated filter in FFmpeg 8.0. It follows the ITU tone-mapping recommendations and handles the color conversions internally, so the command is short: ffmpeg -i input.mkv \ -vf "libplacebo=tonemapping=bt.2390:colorspace=bt709:color_primaries=bt709:color_trc=bt709:format=yuv420p" \ -c :v libx264 -crf 20 -c :a copy \ ou

2026-07-06 原文 →
AI 资讯

Server-Side WebRTC Noise Reduction with Pion, FFmpeg, and RNN Models

This is a sanitized engineering note about server-side audio noise reduction for WebRTC calls. Source article: https://www.lodan.me/posts/server-side-webrtc-noise-reduction-pion-ffmpeg-rnn/ What the prototype tests The goal is not to replace WebRTC's built-in audio processing. The narrower test is: receive a WebRTC Opus track with Pion read RTP packets in OnTrack decode Opus payloads to PCM pipe raw PCM into FFmpeg apply the arnndn RNN noise reduction filter validate the output as a file before considering real-time forwarding Why this boundary matters RTP, Opus, PCM, and FFmpeg raw audio input are different boundaries. If the PCM format is wrong, FFmpeg may still produce a file, but the result should not be trusted. For example, if the Go side writes int16 PCM, the FFmpeg input format should be reviewed as s16le , not casually treated as s32le . Production concerns The prototype is useful because it isolates the audio path, but production use needs more work: buffering and latency CPU and memory isolation FFmpeg process lifecycle model choice packet loss and jitter RTP timestamps audio/video sync whether the processed audio is returned to WebRTC or only recorded The full article has diagrams and the longer explanation: https://www.lodan.me/posts/server-side-webrtc-noise-reduction-pion-ffmpeg-rnn/

2026-05-30 原文 →