<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Katz Sakai on Medium]]></title>
        <description><![CDATA[Stories by Katz Sakai on Medium]]></description>
        <link>https://medium.com/@ksakai?source=rss-4ba93b09062------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hLhQ0n54vH4-8vRJOaoNCQ.jpeg</url>
            <title>Stories by Katz Sakai on Medium</title>
            <link>https://medium.com/@ksakai?source=rss-4ba93b09062------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 01:53:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ksakai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[VideoLAN Developer Days 2026 Rome Report Part 3 (en)]]></title>
            <link>https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-en-baf2a528d152?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/baf2a528d152</guid>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[videos]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[meetup]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 12:39:04 GMT</pubDate>
            <atom:updated>2026-11-15T06:14:46.135Z</atom:updated>
            <content:encoded><![CDATA[<h4>Day 3: Conference Day: inside FFmpeg, the browser, and the gaps in specifications (Oct 18, 2026)</h4><p>From 16 to 18 October 2026, <a href="https://www.videolan.org/videolan/events/vdd26/">VideoLAN Developer Days 2026 (VDD26)</a> was held at Sapienza University of Rome, Italy. VDD is an open-source multimedia technology conference that VideoLAN holds every autumn, and this was the fifteenth edition. The main conference ran across Saturday and Sunday, with the Friday before serving as a community day, when a game was played on foot around Rome. This report summarises the talks and lightning talks given on the third day, Sunday.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vovFeSd8xE5y1VQ0ewHqYg.jpeg" /></figure><p>Reported by <a href="https://www.linkedin.com/in/takesato/">Takesato Hayashi</a> &amp; <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a></p><h3>Executive Summary</h3><h4>Session 1 — libavconv</h4><ul><li>Putting together video conversion code from the libraries takes effort, so developers still use the FFmpeg CLI for transcoding. Anton extracted the CLI’s core functionality over about 700 commits into the library libavconv.</li><li>Processing is built as a directed acyclic graph, and hooks can be attached to any node. For inputs whose resolution changes mid-stream, there are three approaches: rebuild the filter graph, convert ahead of it, or pass the change through to the output.</li><li>The bundled libavgrab treats screen and audio capture as nodes in the processing graph. The privileged work needed for KMS (reading kernel framebuffers directly) is isolated in a helper, so the whole video pipeline need not run as root.</li></ul><h4>Session 2 — Lightning Talk: News from Librempeg project</h4><ul><li>Librempeg is a project derived from FFmpeg. It is distinguished by growing support for video formats used on game consoles and old audio coding methods that FFmpeg does not handle.</li><li>This year the focus was on audio: the libsoxr resampler and the resample filter were replaced, and channel-count limits in audio filters were reviewed. The panning audio filter now supports slice threading.</li><li>More decoders for game formats and more ADPCM variants were added, along with a THP muxer and video encoder. Future work includes correction files for lossless decoding and seeking support in audio filters.</li></ul><h4>Session 3 — What’s new in libswscale?</h4><ul><li>The libswscale rewrite aims to handle the 10,000 video data conversions that arise from about 100 pixel formats through a single path. A plain instruction sequence is generated at runtime, the optimiser merges it, and SIMD executes it.</li><li>Micro-operations carry information such as value ranges. That lets the code choose the best instructions for the environment at runtime. All 10,000 combinations are enumerated at build time and the needed instructions are generated automatically.</li><li>Conversion is 4.5 times faster than the old libswscale as a geometric mean over all pixel formats, up from 3.4 times the year before. RGBA upscaling is five times faster, and greyscale to RGB is 30,000 times faster.</li></ul><h4>Session 4 — AArch64 Assembly Tips and Tricks</h4><ul><li>The best code differs from CPU to CPU. Martin recommended measuring on several machines, noted that efficiency cores still leave room for tuning, and warned against copying x86 SIMD code as it is.</li><li>Performance is decided by how instructions are scheduled. Loads are slow, so reduce dependencies on their results and line up independent work. On cores that can only execute in order, scheduling matters especially.</li><li>He also presented counterintuitive optimisations. Continuing to accumulate into the same register helps greatly on some cores but not on others. Changing a single load instruction made code three times faster. He also gave examples of 9% to 13% from a dav1d loop reordering, three times from changing a partial load, and 3.37 times when combined.</li></ul><h4>Session 5 — Streamed CABAC decode for HEVC</h4><ul><li>With high-bitrate HEVC, a large I-frame takes a long time to reach the decoder over the network, and may then only be decodable serially. A conventional decoder implementation sits idle without using the CPU in the meantime.</li><li>To reduce that waiting, Kieran implemented three things: a task manager that distributes work across threads, an API that returns video frames in batches, and a scheme that decodes CABAC as packets arrive.</li><li>Together they deliver frames 130 milliseconds earlier than the conventional implementation. The largest gain came not from CABAC streaming but from moving to the API that returns frames in batches.</li></ul><h4>Session 6 — vlc.js revisited</h4><ul><li>Descript had two engines for compositing and rendering video edits: one for the browser and one for headless Chromium on servers. Because every rendering difference had to be fixed in two places, it is replacing both with a single Rust engine.</li><li>Rendering is written in Rust with wgpu, running the same code on WebGPU in the browser and on Vulkan or Metal natively. Small rendering differences between GPUs are managed by setting tolerances and running regression tests.</li><li>The rewrite to Rust is progressing with help from LLMs, and the core is nearly complete.</li></ul><h4>Session 7 — Extending GDB for Multimedia Developers</h4><ul><li>Alexandra made it possible to run Valgrind from inside GDB. When Valgrind detects a memory error, execution stops and variables and the stack can be inspected in GDB. The plan is to allow starting it with just target valgrind.</li><li>She also prototyped source-tracking breakpoints, which follow a breakpoint to its new location when the source is edited and rebuilt. The feature is still experimental.</li><li>Using GDB’s Python API, she implemented ftrace-next, which records kernel function calls, and drgn_why_sleeping, which shows the kernel stack of a sleeping thread.</li></ul><h4>Session 8 — Real-Time Motion Estimation and Frame Interpolation in libplacebo</h4><ul><li>John, who joined Google Summer of Code, implemented GPU-based motion estimation and frame interpolation in libplacebo. He built evaluation tools first and measured interpolation accuracy on footage with motion vectors.</li><li>Motion estimation builds a luma pyramid and runs a small search starting from the previous frame’s motion. It runs at 2,000 frames per second, with accuracy comparable to existing real-time methods.</li><li>Interpolation limited to global motion is very fast but leaves ghosting where several motions coexist. Future work includes confidence measures for motion estimation and trying an AI-based approach such as RIFE.</li></ul><h4>The Derek Challenge</h4><ul><li>The Derek Challenge is a contest for media files that exploit gaps in specifications. Entries fall into two kinds: files that conform to the specification yet cannot be played, and files that break it yet somehow play.</li><li>Entries included audio readable as both MP3 and AAC, an AVI containing Opus, and a file that is C source and also video.</li><li>The winner was Niklas’s “63 layers of hell”, a 63-layer MV-HEVC file with a 63×63 dependency matrix. Reading it requires computing a transitive closure in O(n³), and no player could play it.</li></ul><h4>Lightning Talks</h4><ul><li><strong>Vship</strong>: computes quality metrics close to how people perceive pictures, at high speed on the GPU. It runs SSIMULACRA2 and CVVDP eight to ten times faster than the CPU versions, and Vulkan support lets it run on Mac, Intel and AMD GPUs.</li><li><strong>Tokyo Video Tech</strong>: a video engineers’ community founded in 2018. It supported VDD Tokyo in 2019 and publishes activity reports on Medium. The next event is on 25 November, and speakers are being sought.</li><li><strong>edge264</strong>: an H.264 decoder written with C vector extensions instead of assembly. It is about 20% faster than FFmpeg and supports WebAssembly and Clang SIMD, with formal verification using CBMC under way.</li><li><strong>CEA-608</strong>: the 1980s captioning specification is still in use. Devin built a test suite to check conversion from 608 to IMSC 1, found bugs in how existing libraries handle caption data, and fixed them.</li><li><strong>Downscale-Aware ProRes Decoding</strong>: speeds up processing by not decoding high-frequency components that are not needed when shrinking 4K ProRes to 1080p and other sizes. It is twice as fast at 1080p, 5.5 times at 540p and 14 times at 270p, with almost identical PSNR.</li><li><strong>Four views. One Bitstream</strong>: Rafael wrote an AV2 encoder overnight, compiled it to WebAssembly and made encoding and decoding work in a browser. It showed that experiments with a new codec can be tried in the browser alone, without a dedicated application.</li><li><strong>librist</strong>: the RIST reference implementation shipped seven releases in a year. It added browser support, a new profile that drops GRE, fast reconnection with authentication, and Prometheus metrics.</li><li><strong>SRS</strong>: an MIT-licensed media server. It accepts streams over WebRTC, RTMP, SRT and others, delivers them over HLS, FLV and more, and supports large-scale delivery through origin and edge clusters. Media over QUIC and Enhanced RTMP v2 are in its sights.</li></ul><h3>Session 1 — libavconv — ffmpeg CLI turned into a library</h3><p>by Anton Khirnov (<a href="https://kyber.tech/">Kyber</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hohbIQFl_DhAHkZjesfdg.jpeg" /></figure><p>FFmpeg has its libraries, and there are similar projects such as GStreamer. Even so, when developers write video conversion code, many of them call the FFmpeg command-line tool as their backend. Anton Khirnov, who maintained that command-line tool for years, saw this as a gap between what the libraries offer and what users actually want, and built libavconv to fill it. libavconv is part of the Kyber project, but it depends on none of Kyber’s other software and works on its own. The talk covered the processing-graph API, handling of stream parameter changes, and the bundled capture library libavgrab.</p><h4>Why the CLI wins even when libraries exist</h4><p>Anton first laid out why the ffmpeg CLI keeps being used. One reason is the complexity of the libraries. Multimedia itself is complex, so the libraries ask users for fine-grained settings. In many cases, that much freedom is not needed. It is enough to leave the details to the library and let it run with sensible defaults.</p><p>The other reason is that connecting the libraries properly is itself difficult. AVFormat handles reading and writing files, AVCodec handles encoding and decoding, and AVFilter handles data conversion. Bridging those three used to be considered simple, but it no longer is. Twenty years ago, perhaps; not now, Anton said.</p><p>The ffmpeg CLI takes care of that glue on the user’s behalf. It looks like a simple wrapper, but it is in fact a large and sophisticated program. That is exactly why people choose the CLI as their backend rather than the libraries, in Anton’s view. So he asked whether the functionality the CLI provides could be offered as a library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xosd4-MdYPrSYiDhi_ArYA.jpeg" /></figure><h4>Extracting it from the CLI over 700 commits</h4><p>The answer was libavconv. It was not split off in one go; it was carved out gradually over about 700 commits. The history shows what was extracted and in what order. The split proceeded as one continuous piece of work, and the tests passed at every stage.</p><p>What moved into libavconv was the scheduler, the communication between components, and the core of each component. The scheduler decides which processing runs on which thread. The components are demuxers (pulling audio and video data out of a file), muxers (writing that data into a container), decoders, encoders and filters. Communication between components is complex as well, and it went into the library too.</p><p>What stayed in the CLI was command-line parsing and the construction of the processing graph from the given options and input. The CLI serves a very wide range of uses, and parsing alone carries considerable complexity. That part therefore stayed on the CLI side. In addition, narrowly targeted features that did not belong in a library are implemented in the CLI through hooks, described later.</p><p>The repository’s Git history connects to FFmpeg’s history up to a certain point, but it is not an FFmpeg fork: after the split, everything except the CLI and libavconv was removed. It does not vendor FFmpeg’s source and applies no patches. libavconv simply uses FFmpeg’s API in the ordinary way, so it can be linked against your own build of FFmpeg. Building the CLI inside an FFmpeg source tree passes the tests except for two, he said. libavconv itself is built to hold no global state, though some external libraries do, and that part cannot be fully kept.</p><h4>Building the processing graph through an API</h4><p>The API constructs the flow of processing as a directed graph. Anton showed a remuxing example short enough to fit on one slide. Remuxing swaps the container without re-encoding.</p><p>First, allocate a context that represents the whole processing graph. The context is a container that holds the state. Next, create a demuxer and open a file. This part takes work: read the global header, and if there is none, read a little of the content to probe the format and find out which streams it contains. Then, for each stream the demuxer holds, create a muxer and a corresponding stream, and connect the two through the connection API. Finally, start it and wait for it to finish.</p><p>More complex uses make the graph larger. Sources include, besides demuxers, capture through libavgrab, filter graphs with internal data generators, user nodes that feed data into the graph from their own thread, and data sources that hand data in by calling the API from the main thread. There are two kinds of sink: a muxer that writes encoded data, and a data sink that takes data produced by the graph out to the caller. Decoders, encoders and filters can be connected freely between sources and sinks, as long as the result has no cycles.</p><h4>Replacing streams through hooks</h4><p>Any node can carry hooks. A hook is a callback invoked on events such as a packet being received, a frame being sent, or a parameter changing. It can inspect the packet or frame, modify it, insert new ones or drop it. Because the graph runs asynchronously, the libav contexts behind it, such as AVCodecContext and filter graphs, are normally out of reach; hooks can access them.</p><p>The CLI uses hooks to implement rather complex features, such as treating bitmap subtitles as a video stream, or manipulating timestamps. Anton judged that turning those into library features would not be appropriate.</p><h4>Handling streams whose resolution changes mid-stream</h4><p>The size of the picture, the pixel format, or the number of audio channels can change partway through a stream. libavfilter cannot cope with such changes. Nor is libavfilter alone in this: within FFmpeg, no component other than decoders can handle parameter changes at runtime, Anton explained. Real inputs do change, however. libavconv offers three ways to deal with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hxQ889du0sI4L4JQc0B9g.jpeg" /></figure><p>The first is the method the ffmpeg CLI uses. When input parameters change, it destroys the whole filter graph and rebuilds it, keeping the output parameters. Nothing downstream of the filter graph, usually the encoder, sees a change. This works, but it loses all state in the filter graph. Counters, metadata and anything else worth keeping are gone.</p><p>The second inserts a conversion step before the filter. When input parameters change, the data is converted back to the original parameters before being fed in. The filter graph never sees a change, so no reset is needed. This, too, is not optimal in other situations.</p><p>The third rebuilds the filter graph but does not hold the output parameters fixed. The change reaches the output, and the encoder is flushed and recreated. Anton gave the typical Kyber case: resizing a window while capturing it. There, it matters that the size change travels all the way to the muxer or other sink.</p><h4>Where it differs from GStreamer</h4><p>Several people asked whether he had simply reinvented GStreamer. Anton admitted that in a sense he had, but explained that the FFmpeg world and the GStreamer world barely overlap.</p><p>libavconv belongs to the FFmpeg world. That makes it a good fit when you want direct access to FFmpeg objects such as AVFrame and AVPacket. FFmpeg has leaned towards transcoding since its origins, while GStreamer leans towards playback, in Anton’s impression. Decoding an arbitrary file dropped on the program is easier in the FFmpeg world, he said.</p><h4>Capturing screens and audio with libavgrab</h4><p>libavgrab is the bundled library that replaces libavdevice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QD9h1mq09JOwQsQ3JAXuSw.jpeg" /></figure><p>libavdevice provides muxers and demuxers that treat devices through the AVFormat API, so that a window, camera or microphone can be handled as a demuxer. Anton sees problems with that design. Device output in particular is a poor fit for the muxer API and is not usable in practice, he said. The input side is less bad: a desktop capture can be treated like a file. Even there, AVFormat reads data through callbacks whereas capture APIs return frames, so the two shapes do not match. How to pack frames into packets is still under discussion. Adding hardware acceleration makes it harder still. Parameter changes are not supported either: enlarge a window and the capture returns only part of it; shrink it and the capture stops.</p><p>libavgrab is a library dedicated to libavconv and serves the same role as libavdevice for screen and audio capture. It implements libavdevice-equivalent functionality using only libavconv’s public API. To use it, first create a provider, roughly the equivalent of a connection to the display server, whose contents depend on the target. Query the provider for a list of sources: desktops, screens, windows, microphones, cameras and so on. The list can change over time. Bind the chosen source to a capture, and the capture becomes a node in the processing graph that can be connected like a demuxer or decoder.</p><p>Several providers exist. On Windows there is DXGI, DirectX-accelerated desktop capture, and audio including microphones and loopback (capturing sound being played). On Unix-like systems there are X11, Wayland, PulseAudio, v4l2 for cameras, and KMS, which reads framebuffers directly from the kernel. ScreenCaptureKit for macOS is nearly done and under review, expected upstream within a few weeks. A GStreamer provider exists for those who really need to capture the output of a GStreamer pipeline.</p><p>The KMS implementation is one of the most elaborate parts of libavgrab. It is used both as a standalone provider and inside X11 and Wayland. X11 capture works but only through software, with no GPU assistance. On Wayland, which capture method works depends on the environment and is not guaranteed; KDE requires portals, the mechanism by which a desktop environment grants permission. KMS reads the screen buffer managed by the kernel directly, so it does not depend on the desktop environment. In exchange, it gets no cooperation from the software managing the screen, so it is not guaranteed to be stable in every environment.</p><p>KMS can read the screen contents as they are. If anyone could use it, they could look at other people’s screens, so KMS requires root privileges. On Debian, the whole application using KMS traditionally had to run as root, which is unsafe: a task that only needs to grab the screen is given permission to operate the entire system. libavgrab ships a small helper program and gives it file capabilities (a Linux mechanism for granting specific privileges to an executable). libavgrab launches the helper to fetch the framebuffer from KMS, so the processing graph itself does not run as root.</p><h4>Remaining work and Q&amp;A</h4><p>Going forward, the scheduler will become more dynamic, allowing the graph topology to change at runtime. Users will also be able to insert arbitrary nodes. A stable release and more capture backends are planned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QlM3tFR24REa_lF-4w28rw.jpeg" /></figure><h4>Summary</h4><p>libavconv is the core of the ffmpeg CLI turned into a library. Splitting it out over 700 commits shows where the line falls between what the library handles and what the CLI handles. The three ways of handling parameter changes, and hooks that keep narrowly targeted features on the CLI side, are how the library stays general while the CLI keeps its breadth. Once capture of screens and audio can be handled in the same graph, applications will be able to bring the ffmpeg CLI’s role inside their own process instead of calling it as a child process.</p><h3>Session 2— Lightning Talk: News from Librempeg project</h3><p>by Paul B Mahol (<a href="https://github.com/librempeg/librempeg">Librempeg</a>)</p><p>Librempeg is a project derived from FFmpeg, and its distinguishing feature is that it has kept adding support for video formats used in game consoles and for old audio coding methods that FFmpeg does not handle. In a five-minute lightning talk, Paul described what had changed since the previous VDD, his approach to audio work, and what he plans next.</p><ul><li>Links: <a href="https://github.com/librempeg/librempeg">Librempeg</a></li></ul><h4>Putting audio first and replacing the resampler</h4><p>Paul began with the replacement of the audio resampling code. He removed resampling through libsoxr and the resample filter, and replaced them with better methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jki8vukCXRUv0CdcETqjfA.jpeg" /></figure><p>He also reviewed the channel-count limits imposed by audio filters. The panning filter, which distributes audio across channels, now supports slice threading (splitting one frame across several threads).</p><p>Librempeg prioritises work on audio, and Paul explained that he gives audio filters higher priority than video filters.</p><h4>Adding more formats for games</h4><p>Among the additions since the previous VDD, he presented several new filters. The decoders have grown to cover a wide range of formats used in games, and support for ADPCM variants (a family of methods that code the differences between audio samples) has been added. Muxers and encoders not available elsewhere have also joined, he said.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ELiKldpApfH9-RM7bqMGw.jpeg" /></figure><p>One he singled out was THP, a video format used on game consoles. He implemented a THP muxer and video encoder, so that THP can now be written as well. THP is used in many games and on many platforms.</p><h4>Resampling quality</h4><p>Paul also touched on an audio resampling algorithm he had improved. He demonstrated upsampling of a sweep signal, whose frequency changes over time, with no aliasing.</p><p>The algorithm was published as a permissively licensed Python script and was then adopted by several projects in Rust, C++, Python and elsewhere. Paul said it gives better audio quality than FFmpeg’s libswresample. A look at the Hydrogen Audio forum will turn up projects that use it, he said.</p><h4>Remaining work</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64w3_WBZ3PWybFWMfnRBiQ.jpeg" /></figure><p>He listed as future work support for correction files used in lossless decoding for some formats, finishing unfinished filters, and adding seeking support to audio filters. For pixel-format conversion, he also plans to replace software processing in libswscale with processing in libavfilter.</p><h3>Session 3— What’s new in libswscale?</h3><p>by Niklas Haas</p><p>FFmpeg handles about 100 pixel formats, and converting from any one to any other gives roughly 10,000 combinations. The old libswscale gained speed by providing a dedicated processing path for each commonly used combination. Niklas Haas has been rewriting it so that a single path handles any combination, and he reported on how it has changed since he introduced the work at the previous VDD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*syQ-fGZ_ztz_K90kr0jS-g.jpeg" /></figure><h4>The design until last year</h4><p>The old libswscale was a collection of hand-written processing paths, one per pixel format. Coverage of format combinations was uneven, and bugs, vulnerabilities and performance all varied from one pixel format to another.</p><p>Niklas’s goal was to remove that hand-written, format-specific code and build one path that accepts any input pixel format and produces any output pixel format. The path has three stages. First, the calculations needed to convert pixel formats are laid out as a plain sequence of instructions, one after another. At this stage speed is not the aim; the priority is that every combination works correctly. Next, the instructions are combined wherever the result stays the same, so that fewer steps are needed. Finally, the sequence is executed with SIMD instructions. The details were left to the previous talk; this one covered what had changed since.</p><h4>Micro-operations as an intermediate layer</h4><p>The big change over the past year was an internal rebuild. Instead of executing optimised instructions directly on the CPU, the design inserts an intermediate layer called micro-operations. High-level instructions are translated into lower-level instructions that sit closer to the hardware and are easier to implement. Each micro-operation carries precomputed information, such as the range its values fall in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rg_OL_AdisbqXxqqgwU9fg.jpeg" /></figure><p>Take conversion from YUV to RGB as an example: a matrix operation with scaling, shifts and level-adjustment coefficients mixed in. x86 has fused multiply-add (FMA), which in some situations is faster than separate multiply and add. It can only be used, however, if the result can be proven identical; otherwise output would differ between platforms. Because micro-operations carry value-range information, the translation stage can decide, component by component, whether the intermediate result of a fused multiply-add fits within a 24-bit mantissa (the part of a floating-point number that holds its significant digits). Components that provably fit are turned into fused multiply-adds; those that do not stay as separate multiply and add.</p><h4>Collecting instructions from 10,000 combinations</h4><p>The number of micro-operation variants becomes enormous, and implementing them all by hand is not realistic. Niklas therefore added an exhaustive enumeration at build time. For all 10,000 pixel-format combinations, the build works through every conceivable operation, including upscaling, downscaling and 3D lookup tables (three-dimensional tables describing colour mappings). It gathers every micro-operation that appears along the way and writes them into an auto-generated header as macros. Because FATE (FFmpeg’s regression test suite) performs the enumeration, it is reproducible and its correctness can be checked. Each backend then only has to implement those macros and need not care about the individual instruction combinations.</p><p>Separating out the intermediate layer also brought more backends: code can now be generated for LLVM IR, ARM NEON (ARM’s SIMD instructions) and x86. Checkers for tests are generated automatically as well, so each kernel can be verified. The high-level side no longer needs to know the low-level implementation, and the low-level side no longer needs to know the high-level concerns.</p><h4>Scaling as just another graph node</h4><p>With the rewrite, libswscale can now handle scaling itself. Niklas followed the principle of treating every filter as a node in the processing graph. The high-level side only inserts a filter operation where it is needed and leaves the implementation to the translation into micro-operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HpDGV3GzWCEdYa7f0CIJ8w.jpeg" /></figure><p>At runtime, an arbitrary filter graph is broken into independent subgraphs, each mapped to a hardware implementation. Different subgraphs can be assigned to different backends. C fallbacks have been reduced to cases that truly need them; everything else runs in SIMD. One can, for example, downsample chroma with x86 AVX2, upscale in the next subgraph, and convert to RGB in the one after that.</p><h4>More formats and integer arithmetic</h4><p>Support for input formats has grown to include palettes and lookup tables, and now covers almost all of them, he said. An integer arithmetic path was added as well. The implementation originally computed in floating point, and last year some questioned whether that would hold up. Floating point is faster overall, but cases remain where integer arithmetic is faster. Because the micro-operation layer exists, integer paths can be generated automatically from almost the same code as the floating-point paths. Support for 32-bit-per-channel pixel formats was added too.</p><p>For ARM64, Ramiro Polla implemented the NEON backend, which Niklas rates as faster than the old x86 code (SSE4). Ramiro is also working on a JIT backend that compiles instruction sequences to SIMD at runtime. There is also work on generating SPIR-V (the intermediate representation used by Vulkan) at runtime.</p><h4>Benchmarks</h4><p>Across all pixel formats, the geometric mean is 4.5 times faster than the old libswscale. Last year it was 3.4 times, so the gap widened over the year. Upscaling RGBA is about five times faster. Previously, scaling had to go through a common pixel format first and could not operate on packed data (pixels stored contiguously). The new implementation removes that constraint, so the time spent converting to an intermediate pixel format disappears entirely. Upscaling from YUV420 to 422 and 444 is a common conversion that had no dedicated optimisation, and the new design makes it faster as a matter of course.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CyUeTvxY0bEQuyo4-zoCKA.jpeg" /></figure><p>Converting greyscale to RGB does not even require moving data: all colour components can simply reference the same data. A speedup of 700 times last year became 30,000 times this year, he said.</p><h4>Towards production use</h4><p>Asked whether it is ready for production, Niklas answered “almost”. It is currently available only when a flag is enabled, and he hopes to stabilise it within one or two months. The plan is to stabilise it once the test framework is in place and he is confident that everything is covered. He is also asking users for feedback from real use.</p><p>Some cases are still slower than the old method. Converting YUV420 to RGBA goes through a floating-point intermediate buffer before reformatting, which costs time; that path is being fixed and should be at least as fast as before once done. The other case is the quality-reducing shortcuts the old libswscale used to gain speed, such as lowering rounding precision or duplicating pixels instead of upscaling. Those are not implemented yet.</p><h4>Summary</h4><p>The libswscale rewrite has moved close to its goal of handling any pixel format through one path. The micro-operation layer and the build-time sweep through all combinations together deliver both broader format coverage and a 4.5-fold speedup.</p><h3>Session 4 — AArch64 Assembly Tips and Tricks</h3><p>by Martin Storsjö</p><p>Over the past year, a growing number of new contributors have written NEON code for ARM64 (AArch64). Martin Storsjö gathered the advice he has given individually in reviews, and added optimisations that even experienced developers find surprising. The talk does not teach how to write assembly; it explains how to make decisions when writing ARM64 code, starting from CPU architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZlWnx8uLFh__k0a88HhEQ.jpeg" /></figure><h4>The best code differs from CPU to CPU</h4><p>The hard part of optimisation is that instruction timing differs from CPU to CPU. Tune for one CPU and the result may be optimal there but much worse on another. If you have several machines, Martin said, measure on them in parallel and look for a balance between changes that speed one up and slow another down.</p><p>Some of the tweaks he suggests in review show no difference on a large Apple Silicon core yet matter on other CPUs. Not every developer needs a dozen test devices, however; a handful of rules of thumb is enough, he said.</p><p>Small cores and efficiency cores in particular, such as Cortex-A53 and A55, leave plenty of room for tuning. Vendors publish optimisation guides full of instruction timings, but Martin said he does not read them. Rather than memorise numbers, he finds it more practical to develop a feel for which operations are fast and which are slow.</p><h4>With NEON, transcribe C faithfully</h4><p>NEON (ARM’s SIMD instructions) does not call for the tricks you may know from x86. Look at the C code and write the same operation in assembly; the instruction set is complete, so no clever workarounds are needed, he said.</p><p>What helps is instructions that combine several operations. There are instructions that round and saturate (clamp a value to a lower and upper bound) at once, MLA for multiply and accumulate, and an instruction that converts signed 16-bit values to 8-bit pixels while rounding. Adding a constant and then shifting right is often rounding, and can be replaced by a dedicated rounding shift. There is even an instruction that keeps a 16-bit multiply result at 16 bits.</p><p>If an x86 SIMD implementation already exists, it is fine to look at it, but do not copy its control flow. x86 has addressing idioms such as indexing from the end of a range, which differ from ARM64’s addressing modes. To learn idiomatic NEON, he recommended reading small NEON functions in FFmpeg.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gXbYQ9PuHZwTCKWlQXpRA.jpeg" /></figure><p>Before submitting a patch, measure it. If it is not faster than the existing C implementation, adding assembly has no value. SVE (scalable vector extensions) currently offers little benefit, he said: until very recently the available SVE2 instructions were limited to 128-bit widths, and writing for variable length gives up the opportunity to unroll loops.</p><h4>Instruction scheduling decides performance</h4><p>Martin called instruction scheduling “my personal favourite topic” and explained it from first principles.</p><p>CPUs once executed one instruction at a time. In the 1990s they became superscalar, able to start several instructions at once. When one instruction uses the result of another, it cannot start until that result is ready. Loads from memory are slow, and instructions that use a loaded value must wait.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NwhqCewUuy2d4t-kV4o55Q.jpeg" /></figure><p>So issue independent loads first, then line up the calculations that use them. How many instructions can start at once differs by core, and the number of execution units is limited. Code with broken dependency chains runs faster than code that looks tidy. In simple functions, unrolling the loop is needed to give the CPU more independent data.</p><p>Recent large cores can execute instructions ahead of the order in which they were written (out of order), which makes scheduling less critical. Many phone efficiency cores, however, can only execute in order. Even phones sold in 2024 existed with only efficiency cores. On inexpensive devices, the difference matters a lot.</p><p>Grouping instructions makes code easier to read but reduces freedom to reorder it. The more you wrap up in macros, the worse the scheduling; Martin recommended writing plenty of comments and interleaving separate calculations.</p><p>The algorithm matters just as much. Adding x0 through x7 one after another creates a chain of seven dependent instructions, whereas adding x0+x1, x2+x3, x4+x5 and x6+x7 in parallel and reducing the results as a tree takes three steps.</p><h4>Dependencies created by post-increment</h4><p>ARM64 loads can post-increment, advancing the pointer after the read. The code gets shorter, but the next instruction that uses the advanced pointer must wait for the update. So must calculations that use the loaded data.</p><p>One remedy is to use separate base registers for even and odd rows and double the stride. Another is to alternate between an instruction that reads from x2 and one that reads from x2+x3, then advance x2 at the end. That takes more instructions but can be faster on large cores.</p><h4>Counterintuitive optimisations</h4><p>Martin presented three counterintuitive suggestions he received from engineers at Arm.</p><p>The first is accumulating into the same register. In an FIR filter, for example, each operation adds into the previous result. Breaking the dependency by alternating between two registers seems sensible, but Cortex-A53, A55, A520 and C1-Nano have a dedicated forwarding path that passes the previous result straight to the next instruction, and continuing the accumulation is faster there. Rewriting this way made A53, A55 and A520 about 40% faster, at a cost of about 1% on out-of-order cores. Cortex-A510, however, lacks that path, and the same code is much slower there. Since A510 is always paired with larger cores, dropping it from consideration is an option, he said.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4rKtqXzguh2yPdIIe14AA.jpeg" /></figure><p>The second is an 8-pixel-wide function in dav1d. The old code started from a value already at hand and deferred the slow load. Arm’s suggestion was the opposite: start the load first, insert another instruction, then use the loaded value. On deeply out-of-order cores, the next loop iteration can overlap with the previous one. It is a few percent slower on efficiency cores but 9% to 13% faster on large cores.</p><p>The third is the width of the load. Where four bytes are enough, an instruction that loads into part of a 16-byte register leaves the rest unchanged, creating an implicit dependency on what the previous loop wrote there. Replacing it with a load that replicates the four bytes across the register, or one that zeroes the remainder, lets the next iteration start immediately. Changing one instruction made the code three times faster, with single-digit losses elsewhere; combined with the second change, 3.37 times.</p><p>Martin said that writing code requires thinking about how the processor executes instructions. Having tuned code for Cortex-A53 for years, his intuition is shaped by it, and he feels he needs to read code with the characteristics of large cores in mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IIqyRRLRGoChJu9UsNWTmw.jpeg" /></figure><h4>Q&amp;A</h4><p>Asked whether GPUs should be used when execution units are scarce, Martin said attempts exist but the area is outside his expertise. Video codecs need low latency and branching, which makes GPUs hard to use.</p><p>On whether SVE offers advantages, he said some instructions can bring improvements of around 10%. However, until very recently the available SVE2 instructions were limited to 128-bit widths, and writing for variable length sacrifices loop unrolling, so codec functions struggle to benefit.</p><h4>Summary</h4><p>The talk organised the decisions involved in writing ARM64 assembly around CPU architecture. Loads are still slow, but some cores are faster when the accumulation dependency is deliberately kept, and others can start instructions across loop iterations. Even without many test devices, rules of thumb and measured results can bring code closer to working well across many CPUs.</p><h3>Session 5 — Streamed CABAC decode for HEVC</h3><p>by Kieran Kunhya (Open Broadcast Systems)</p><p>Kieran Kunhya had assumed that HEVC decoding was a solved problem. It is not: real-time software decoding of very high-bitrate video still leaves room for improvement. He presented a way to decode CABAC (entropy decoding by arithmetic coding) as packets arrive, making progress while waiting for the rest of a frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRKISAYC8VDAw-g_4DLMMg.jpeg" /></figure><h4>The gap while a huge I-frame arrives</h4><p>At high bitrates, the time it takes a large I-frame to arrive becomes the problem. An I-frame can take almost 100 milliseconds to cross the network, during which the decoder does nothing. Only once the frame is complete does processing begin.</p><p>In the worst case, an I-frame of more than a megabyte is coded as a single slice, with no tiles and no wavefront parallelism (WPP), leaving no room for parallelism. It takes a long time to arrive and, once there, can only be decoded from the beginning in order.</p><p>Today’s FFmpeg spreads frames across many threads to fill that wait, but that uses extra CPU and memory and adds context switches. In effect it hides the reception delay by increasing overall decode latency, he said. GPUs are not an easy answer either: some cannot handle 4:2:2, their performance ceiling is unclear, and some devices have no GPU at all.</p><h4>Measuring the slack before PTS</h4><p>A benchmark that reads from a file can read as fast as it likes. When decoding while receiving in real time, packet arrival becomes the bottleneck and decoding proceeds differently. CPU usage and frame rate do not tell you whether the CPU available at a given moment was put to use.</p><p>Kieran focused on the fact that a transport stream carries absolute decode times. Each frame must finish decoding before its presentation time (PTS). He therefore measures the time from the end of decoding to the PTS, normalised by subtracting the decoder’s internal delay. Rather than averages or P99 (the 99th percentile), he looks at the frame with the least slack, which is almost always a huge I-frame.</p><p>The test procedure is as follows. The transport stream is played at the same speed as real reception: Multicat (a stream-sending tool) transmits it, and a tool that simulates real time decodes it while the slack is measured. A clip runs about ten minutes, and because it is played in real time, one measurement takes ten minutes. Repeating this for every change can take hours or days.</p><h4>Splitting serial work with a task manager</h4><p>Kieran made three changes to increase that slack. The first was a task manager, the approach used in the dav1d and VVC decoders. Entropy decoding, reconstruction and filtering are split into separate tasks and distributed across threads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3KyeEEI_9hP0IEZBhEO5OQ.jpeg" /></figure><p>Even for a file that cannot be parallelised, entropy decoding proceeds from left to right, creating reconstruction and filtering work as it goes, and other threads pick that work up. The data itself can only be read from the beginning, but decoding and later stages can overlap, so several threads work at once.</p><p>The improvement at this stage was 33 milliseconds on the frame with the least slack. Assembly optimisation and IDCT work proceeded at the same time but barely helped: a few milliseconds at most, not enough to increase the slack of that frame.</p><h4>An API that can return frames in batches</h4><p>The next change surprised Kieran himself. FFmpeg’s software decoding API broadly takes one frame and returns one frame. While waiting for a large I-frame to arrive, ten frames may be ready for display but cannot be released.</p><p>He therefore moved the H.264 decoder to the AV receive frame API, designed for hardware decoders, which he believes is the first software decoder to do so. Frames can now be returned in batches, and when the wait ends, the accumulated frames are released at once.</p><p>This change was worth 77.4 milliseconds, the largest of the three.</p><h4>Decoding CABAC as packets arrive</h4><p>The last change is the CABAC streaming in the talk’s title. The transport-stream demuxer is changed to output one packet at a time. FFmpeg normally waits until a whole frame is available, so this is a substantial change.</p><p>The existing fragmented decode works in NAL units, but the target stream has one slice per NAL, so that approach does not apply. He implemented a packet-level, fragment-based scheme. The bitstream contains extra bytes inserted to avoid sequences that would look like start codes, and those bytes must be removed for every packet. Because packets are small, that work is called tens of thousands of times per second. On a one-megabyte I-frame the cost becomes significant, and it had to be rewritten in assembly. The CABAC engine was also changed to keep state from one packet to the next. CABAC is among the most heavily optimised code in FFmpeg, where a single instruction matters, so it needs careful handling.</p><p>CABAC does not reveal where a coding tree unit (CTU) ends. If the available data is not enough to finish a CTU, the decoder rolls back to the previous state. Trying this packet by packet naively caused rollbacks in 10% to 15% of cases, a heavy cost. Since reference frames tend to have larger CTUs, the decoder now buffers more packets before decoding them. Rollbacks have fallen to about 2%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y83Kyhn1se5FqXUqOXwQZw.jpeg" /></figure><p>This was worth 20.5 milliseconds, the smallest of the three. Kieran had expected it to be the biggest gain. By the time the last packet of the frame arrives, CABAC decoding is nearly done and most reconstruction is complete.</p><h4>Testing against broken streams</h4><p>A great deal of time went into reliability testing. He generated abnormal inputs, including resolution changes, concatenated streams, concatenated garbage and fuzzing, and checked that the conventional access-unit (a unit of data for display) decoding and fragment-based decoding matched bit for bit.</p><p>Along the way, the AI repeatedly asked to download x265 and re-encode the content with slices so that it could be parallelised. Kieran had to explain again and again that they do not choose the content they receive.</p><h4>Work handed to AI</h4><p>Kieran revealed that AI did most of the work. Until recently he had said publicly that AI would not do complex codec work; half a year later, it is doing that work. While he was busy with daily chores, the AI wrote a usable 32×32 IDCT, he said. It understands x86 details and uses instruction data from <a href="https://uops.info/">uops.info</a> to tune code per CPU. Even if its output is 90% as good as code written by a person, getting it 100 times faster is worth more, in his assessment.</p><p>What is still needed is an engineer to steer the AI. Kieran said it only works when someone is there to judge.</p><h4>Q&amp;A</h4><p>Asked whether the same could be done for H.264, he said it is possible, but interlacing and the handling of fields and frames are complex, and the effect on the task manager is hard to predict.</p><p>On packet loss and reordering, he explained that FEC (forward error correction) and reordering happen ahead of the decoder in separate processing that the decoder cannot control. If one knows nothing has been lost, there is room to start decoding as soon as the SPS, PPS and VPS (stream configuration information) are available, but that would break the separation between modules.</p><p>On threading, CABAC runs on a single thread. It has its own thread, but no setting pins it to a particular CPU core. Tasks other than CABAC run on multiple threads even when the stream offers no parallelism.</p><p>Asked why he uses rollback and snapshots rather than keeping state at the bit-reader level, he said CABAC is optimised instruction by instruction, and touching it would hurt overall performance, so he prefers to avoid it.</p><p>On stream constraints, he said it works with any kind of stream. Tiles and slices are used when present, but because data can only be read in arrival order, some waiting for slices remains.</p><h4>Summary</h4><p>Kieran’s work puts otherwise idle CPU time to use decoding while packets arrive. The biggest gain came not from CABAC streaming but from moving to an API that can return frames in batches. Together the three changes deliver frames 130 milliseconds earlier than the conventional approach.</p><p>Testing used 1080p59.94; at 4K, cache effects may change the picture, he said. The code is 15,000 lines, and whether to upstream it is undecided.</p><h3>Session 6— vlc.js revisited: one Rust media engine for the browser, the server and beyond</h3><p>by Romain Beauxis (<a href="https://www.descript.com/">Descript</a>)</p><p>Editing video in a browser means decoding the many data formats users bring in, compositing them and exporting the result. Romain Beauxis, a media engineer at Descript, described replacing two paths, a browser engine and the same engine running in headless Chromium on servers, with a single Rust engine.</p><ul><li>Links: <a href="https://www.descript.com/">Descript</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R8LTa2k5QUmYz26nwknv4Q.jpeg" /></figure><h4>The problems of running two paths</h4><p>Three years earlier, VideoLAN demonstrated VLC.js, VLC compiled to WebAssembly, at FOSDEM. Romain had found that work interesting at the time. Descript faces the same problem of decoding a wide range of media in the browser. What differs is that edits have to be exported, and that compositing and GPU processing are part of the job.</p><p>When Romain joined about a year ago, the product was at the stage of making something work first: a little of everything, assembled to get it running. FFmpeg’s libraries were built to WebAssembly for demultiplexing in the browser, while decoding and encoding used browser APIs. Compositing used the browser’s GPU APIs, and export ran headless Chromium on a server, rendering through the same path as the browser.</p><p>That arrangement meant fixing every rendering discrepancy in two places, and the server carried a whole browser, making operations heavy. They therefore set out to rebuild the engine so that the same code runs in the browser and on the server.</p><h4>One rendering path with Rust and wgpu</h4><p>Rust was chosen for the core, not only because it is memory-safe and fashionable, but because it has a toolchain suited to compiling to WebAssembly and because it allows the use of wgpu, an abstraction layer that switches between GPU backends such as Vulkan, Metal, DirectX and WebGPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paxGHKVC6XJnVyIQfAq5DA.jpeg" /></figure><p>Processing runs through decode, upload to the GPU, compositing, output and encode. At the decode, compositing and encode stages, the engine calls host APIs. In the browser it uses WebCodecs and WebGPU, plus WebGL2 when needed, and outputs through WebCodecs. On the server, native APIs are plugged into the same positions.</p><p>Rust coordinates the whole. It asks the host to decode, composite and encode, and receives notifications of the results. The application logic lives in one place and can run from a server command line or inside a browser. The same engine can later be extended to other environments such as mobile devices.</p><p>GPU output is not bit-identical even for the same calculation. Rounding and the handling of pixels at the edges during shading differ from backend to backend. They therefore set an acceptable tolerance and run regression tests that compare rendered results on every change, confirming that differences stay within that range.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-aviMGUHtNkl6KxFgCPgkg.jpeg" /></figure><h4>Narrowing the data formats the client handles</h4><p>Demultiplexing is handled separately. The client currently has a single path, a WebAssembly build of FFmpeg’s libav. But video formats keep evolving, and every new FFmpeg release requires porting the changes. Users’ browsers often remain on old versions, and adding professional formats such as MXF is not easy. Trying to read every format on the client is a losing game, he said.</p><p>They therefore decided to narrow the containers and codecs the application supports. They pick targets such as H.264, and the engine’s internals assume only normalised formats. At the entrance sits the MTS (media transformation server), which normalises uploaded files using the latest FFmpeg on the server. In future they may use WebSocket to convert interactively during ingest.</p><h4>Making decoders and rendering replaceable</h4><p>The engine core does not depend on libav. Decoders are plug-ins: WebCodecs and a WebAssembly build of FFmpeg in the browser, libavcodec on the server. The processing that composites multiple video layers and text into one picture is shared, with adjustments so that text rendering does not break depending on the environment.</p><p>A user’s edits are stored as a timeline and converted into a rendering graph, where operations are nodes and data flows along edges. When adding a new rendering backend, they render this graph and compare it with the existing result, checking that the difference stays within tolerance.</p><h4>A large rewrite with LLMs</h4><p>Rebuilding the whole engine had seemed impossible without a team of about twenty engineers. LLMs changed that. They had the model write large numbers of automated tests, and engineers check whether the tests are sound and whether the code is well organised. While fixing bugs in the old implementation, they apply the same tests to the new one, keeping both in sync.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xr3i59Nla-IP9gzOlRqRjw.jpeg" /></figure><p>Romain also touched on writing specifications as text and using them to guide code changes. Code used to be the specification, but such code contains workarounds and ad hoc fixes added at the time. LLMs get drawn into those descriptions and struggle to read the intended behaviour. Instead, they describe how the system should behave in prose and direct code changes through that description.</p><p>The rewrite is proceeding this way. The core is nearly complete and can already render on the server. They plan to put it into production soon.</p><h4>Summary</h4><p>Three years after VLC.js, browser APIs have matured around WebCodecs and WebGPU. Two problems remain: ingesting a wide range of data formats, and rendering results that differ from GPU to GPU. Romain chose to leave normalisation of formats to the server, manage rendering differences with tolerances and tests, and bring the application logic together in Rust.</p><h3>Session 7— Extending GDB for Multimedia Developers</h3><p>by Alexandra Petlanova Hajkova (Red Hat)</p><p>GDB is a debugger that stops a program so you can inspect its state; Valgrind is a tool for finding memory errors. Alexandra Petlanova Hajkova, who works on Linux kernel debugging at Red Hat, presented improvements that combine the two and let debugging continue across edits and rebuilds. Her work runs Valgrind interactively from inside GDB, makes breakpoints follow changes to the source, and brings kernel information into GDB.</p><ul><li>Links: <a href="https://www.sourceware.org/gdb/">GDB</a> / <a href="https://valgrind.org/">Valgrind</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQFWeQPBncxowB3kKcCGDQ.jpeg" /></figure><h4>Running Valgrind from inside GDB</h4><p>Valgrind is normally used by running a program and then reviewing the results after it exits. Inspecting variables at the moment a memory error occurs meant starting a debugger in another terminal. Alexandra made it possible to launch Valgrind from GDB as a remote target. When Valgrind detects an invalid read, execution stops and control returns to the GDB prompt, where you can walk the stack and print variables.</p><p>Valgrind’s monitor commands are available from GDB too. Typing help memcheck lists the monitor commands memcheck supports. Inspecting the bytes at the location where the error occurred shows which bytes are uninitialised and from where they become inaccessible. Helgrind, which looks for thread races, has its own monitor commands, and lock ownership can be queried from GDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZHEC2qpkM9IFsleVE0kXw.jpeg" /></figure><p>Today a long command is still needed to start Valgrind, but the plan is to reduce it to target valgrind.</p><h4>Breakpoints that survive edits</h4><p>The second improvement is breakpoints that follow changes to the source. Set a breakpoint by file name and line number, edit that line, and rebuild in the same GDB session, and GDB reloads the symbols. The instruction that was at the original line is gone, however, so the breakpoint becomes invalid and execution does not stop there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPguSXRZExaEOPHehzVLDg.jpeg" /></figure><p>The source-tracking breakpoint Alexandra prototyped saves the source around the breakpoint, finds the corresponding place in the new source after a rebuild, and adjusts the breakpoint’s position. A breakpoint on an if line, for example, is reattached to the edited if. The feature is still experimental.</p><h4>Bringing kernel information into GDB</h4><p>The third improvement is a set of commands written with GDB’s Python API. ftrace-next records kernel function calls and their return values while you step through source, so you can trace what the kernel did when a system call failed. drgn_why_sleeping uses drgn, a Python library for working with kernel structures, to show where a sleeping thread is blocked in the kernel. The kernel call stack shows what it is waiting for.</p><p>Both are experimental, and the talk covered what they can and cannot do. Asked whether Valgrind did not already have a feature to launch a debugger, Alexandra said she uses it; the difference is that the same thing can now be done from inside GDB instead of setting up two terminals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCtJu60KB2cT3Q1eeX4ZTw.jpeg" /></figure><h4>Summary</h4><p>Alexandra’s improvements reduce the need to switch tools in the middle of debugging. Valgrind’s findings can be inspected directly in GDB, breakpoints follow source edits, and even a thread’s kernel wait state can be checked in the same window. Multimedia code involves assembly, threads and kernel interaction, so developers move between a debugger and a memory checker more often than in other fields. Improvements that cut down that back-and-forth are particularly useful there.</p><h3>Session 8— Real-Time Motion Estimation and Frame Interpolation in libplacebo</h3><p>by John Tyler</p><p>Frame interpolation is the technique that makes, for example, 24fps video look smooth on a 60fps display. It estimates how pixels move between the frames before and after, and synthesises the picture at an in-between moment. John Tyler, who joined VideoLAN through Google Summer of Code, implemented GPU-based motion estimation and frame interpolation in libplacebo, mentored by libplacebo maintainer Niklas Haas.</p><ul><li>Links: <a href="https://code.videolan.org/videolan/libplacebo">libplacebo</a> / <a href="https://summerofcode.withgoogle.com/programs/2026/projects/gB256bA7">GPU Accelerated Motion Compensation-based Video Frame Interpolation in libplacebo</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G4HDQBvRSg-4DiGu0CDxRg.jpeg" /></figure><h4>Building the measuring tools first</h4><p>John started by building a tool for comparing and checking algorithms. Existing implementations include FFmpeg’s minterpolate filter, mvtools, the closed-source Smooth Video Project, and features that use NVIDIA Optical Flow. With so much prior research, he first had to decide what counts as a good implementation.</p><p>For evaluation he used open-source animated films with motion vectors, and measured speed, accuracy and how the interpolated video looks. Motion estimates were visualised with colour and brightness: colour for direction, brightness for how far the estimate was off. For interpolation, he dropped every other frame to halve the frame rate, interpolated back to full rate, and compared the result with the original frames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QIPE6ABdPO0NT6lQtvqUAw.jpeg" /></figure><h4>Motion estimation with a pyramid and a small search</h4><p>John’s motion estimation works as follows. First it discards colour and keeps only brightness (luma), then builds a pyramid of images at different resolutions. It starts at the coarsest level, taking the motion estimated in the previous frame as a starting candidate, and runs a small brute-force search around it to decide the motion for each block. A median filter then replaces each block with the median of its neighbours. This is repeated at every level up to the finest.</p><p>The process runs at around 2,000 frames per second on the GPU, competitive with other real-time algorithms. It is simple and resembles the motion estimation encoders use. Because it starts from the previous frame’s motion, it can follow large motion that a plain block search would miss.</p><p>John also compared his results with encoder motion estimation. Against the motion in video encoded with NVENC and libx264, accuracy was close. The goals differ, however: encoders estimate motion to reduce the amount of data, not to make motion vectors as accurate as possible. John’s implementation uses motion for frame interpolation, so accurate motion vectors matter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2PU2oGzXlq0t1_mVEe5vg.jpeg" /></figure><h4>Interpolation limited to global motion</h4><p>The interpolation implementation was deliberately kept simple for the summer project. Rather than using the estimated motion directly, it compresses it into a single median value. That works well when the whole picture moves in one direction. Pixels are sampled from the previous and next frames according to the relative timestamp of the interpolated frame, and blended by temporal closeness.</p><p>The method is very fast and keeps up with any frame rate a monitor can display. It breaks down, however, when there is more than one motion. When an object in the foreground moves in a different direction, ghosting appears around its edges. When a tree fills most of the frame and text moves separately, the motion fitted to the tree is applied to the text, which distorts badly.</p><p>John listed occlusion (an object disappearing behind another) and the representation of motion as open problems. The current version estimates only horizontal and vertical translation; scaling and rotation would need affine transforms or homography. Blending pixels in occluded regions is also hard, leaving plenty of room for research.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gy1ODLLQjR_fEWmd-3rE9Q.jpeg" /></figure><p>Future work includes adding confidence to per-block estimates and using it in blending, tidying up the evaluation tool, and trying an AI-based approach such as RIFE. He also welcomes discussions about integrating it into other software.</p><p>Asked whether GPUs offer motion search outside encoders, John said AMD and NVIDIA GPUs can compute optical flow, and NVIDIA’s is very good.</p><h4>Summary</h4><p>John’s implementation combines block-based motion estimation with interpolation driven by global motion. It achieves both 2,000 frames per second and accuracy comparable to existing real-time methods. Scenes with multiple motions and ghosting around foreground objects remain, and are left for future research.</p><h3>The Derek Challenge</h3><p>by <a href="https://www.linkedin.com/in/jbkempf/">Jean-Baptiste Kempf</a> (<a href="https://www.videolan.org/">VideoLAN</a> President)</p><p>The Derek Challenge is a contest for media files that exploit gaps in specifications. Entries fall into two kinds: files that are strictly conformant yet no player can play to the end, and files that break the specification yet somehow play. Jean-Baptiste Kempf (known as jb) presented the entries and let the audience vote for the best.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORrk6OESI0QvI_PoqKKXuQ.jpeg" /></figure><h4>Files that cannot be played despite conforming</h4><p>The first entry was an MPEG-TS file from Dimitri. It exploited the handling of the PMT, the table that lists the streams making up a programme. A new version of the PMT moves to a different PID (the identifier for a stream), and a PMT takes effect as soon as it arrives. Players could not follow the move and stopped playback after a few seconds.</p><p>Another entry used H.264 FMO (flexible macroblock ordering). FMO is part of the specification, but FFmpeg’s H.264 decoder does not implement it, and as far as Jean-Baptiste knows no implementation can play the file.</p><p>Niklas’s “63 layers of hell” is an MV-HEVC file with 63 layers. The layer dependencies form a 63×63 matrix, the output layer combinations number 3,070, and the stream configuration information alone reaches 60 kilobytes. Reading the next field requires computing the transitive closure of the dependency matrix in O(n³). No player could play it, and even the reference decoder did not work correctly.</p><h4>Files that open as another format</h4><p>Romain submitted a file that shows different video depending on whether it is opened as MP4 or in another way, hiding a second video inside the MP4 container.</p><p>François’s entry is an audio file readable as both MP3 and AAC. MP3 frames are embedded in AAC’s private data (an area the specification leaves free for any use) and in padding, and the bitrate declared in the MP3 header is made higher than the real one, so that decoders for both formats read it as a valid file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mzEKONYKVtqO7THeYEtfw.jpeg" /></figure><p>Nathan submitted an AVI with an undefined audio codec containing Opus. Moon made a file that is a C source file and also opens as video: C code embedded in XPM, an image format, which compiles into a program that displays the video.</p><h4>Vote and results</h4><p>The audience vote went to Niklas’s 63-layer MV-HEVC. jb said the entries would be published.</p><p>He reflected that this year had been made hard enough, and said next year would be harder still.</p><h4>Summary</h4><p>What the entries share is that they exploit features nobody uses or boundaries where several formats overlap. The aim is to find gaps in how specifications are read, making the contest a reflection of how far decoder implementations manage to follow the specification.</p><h3>LT1 — Vship Fast Metric Computation on GPU</h3><p>by Line (Vship)</p><p>When setting up a video encoder, what you measure picture quality against changes the result. Vship’s talk was about choosing that metric, and about running heavy metrics on the GPU.</p><ul><li>Links: <a href="https://codeberg.org/Line-fr/Vship">Vship</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rcuLeVcm4uXWjEIYK7byqw.jpeg" /></figure><h4>Something is wrong with how metrics are chosen</h4><p>PSNR and SSIM turn differences between pixels into numbers, and hardly correlate with how good the picture looks to a person. Noise or blur can still score well if the numbers are good.</p><p>VMAF comes closer to perception, but it learns correlation with a dataset through machine learning. It responds well to changes in the quantisation parameter, but when used as a target for optimisation, it tends to produce video that only chases the score. Line said that is not what an encoder should become.</p><p>What is needed is a robust metric that covers more kinds of degradation, which means fewer machine-learning parameters and a richer model of the human visual system.</p><h4>Bringing ColorVideoVDP to the GPU</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ZpYVjyYLGeqYtbL6rnuvQ.jpeg" /></figure><p><a href="https://www.cl.cam.ac.uk/research/rainbow/projects/colorvideovdp/">ColorVideoVDP</a> (CVVDP) fits that description. It models the human visual system carefully, covering phenomena such as colour appearance, contrast sensitivity and masking. It is accurate but very slow on the CPU, which kept it out of practical use.</p><p>Vship is a library that computes SSIMULACRA2 and CVVDP on the GPU. SSIMULACRA2 starts from SSIM and improves it to match human perception, and the two can be chosen according to the task. It is eight to ten times faster than the CPU versions and handles colour conversion internally. Vulkan support means it runs on Mac, Intel and AMD GPUs. It also offers a C API with no dependencies other than the GPU backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQxy5SuBrRhpRlB80c8ABw.jpeg" /></figure><p>If quality metrics can run at close to real time, encoder tuning can be driven by perceptual metrics. Computation time is the barrier to running metrics inside a tuning loop, Line said.</p><h3>LT2— Tokyo Video Tech</h3><p>by Takesato Hayashi (<a href="https://luma.com/tokyo-video-tech">Tokyo Video Tech</a>)</p><p>Tokyo Video Tech is a community for engineers interested in video and streaming technology. It was founded in December 2018 and has been holding meetups in Tokyo. The lightning talk introduced its activities and its next event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnyQpa9D9O5dov5e9UwCCw.jpeg" /></figure><h4>A meetup running since 2018</h4><p>It began as a place for engineers working on online video and streaming to gather. It is run by Takesato, Katz and Hiromine, and has held a number of meetups. Topics range widely across video technology, including codecs, delivery and players. It is also a place where members who attend conferences abroad bring back what they heard and report on it.</p><p>In 2019 it co-hosted VDD in Tokyo, inviting developers from abroad for technical exchange. Two members attended VDD26. <a href="https://medium.com/tokyo-video-tech">Talks are published as reports on Medium</a> so that people who could not attend can read them later.</p><h4>The next event and a call for speakers</h4><p>The next Tokyo Video Tech is planned for 25 November. The organisers are looking for speakers and asked anyone visiting Tokyo to get in touch. They are also inviting developers who spoke at VDD26 to present in Tokyo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2jmVaGEBb_uMqGiLDagVaA.jpeg" /></figure><p>The community also serves as a bridge between developers abroad and engineers in Japan. By inviting people met at events such as VDD to speak, it has brought the latest technical developments to a domestic audience. The VDD26 talks are being published as reports as well.</p><h3>LT3 — edge264</h3><p>by Thibault Raffaillac (edge264)</p><p><a href="https://github.com/tvlabs/edge264">edge264</a> is a research project that decodes H.264 using C vector extensions instead of hand-written assembly. Thibault Raffaillac reported on how it changed over the year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TtqeqnfWFOa3b9ysW6xjUA.jpeg" /></figure><h4>Going fast without writing assembly</h4><p>Codec implementations such as H.264 usually write SIMD assembly by hand to gain speed. edge264 took the opposite route: express SIMD through C vector extensions and let the compiler optimise it. It is currently about 20% faster than FFmpeg, and because it is written in C, it gets faster as compilers improve.</p><p>It is now being finished for production use at Netflix, with multithreading and AVX-512 support still to do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VcBpWXDp0-Zn6tvYXxyTmg.jpeg" /></figure><h4>Wider portability</h4><p>Over the year, Thibault completed the WebAssembly backend and a backend for Clang’s SIMD extensions. The code now runs on any architecture. A user has run it on RISC-V, and the results can be found in the repository. This demonstrates that the approach of writing everything with C vector extensions holds across several environments.</p><p>While building the WebAssembly version, he also analysed the performance of TurboFan, V8’s JIT. On the Arm backend, compiling and running was slower than compiling for SSE and running that code on Arm, an inversion he traced to the shuffle instruction.</p><p>A few months ago, someone created a fork of the project. It contains work that beats FFmpeg by an even wider margin in multithreaded implementations, along with many tests. It also contains a lot of quick fixes, however, so only the useful changes need to be cherry-picked. An implementation using long vector extensions is about 20% slower in practice, he said.</p><h4>Removing undefined behaviour with formal verification</h4><p>Formal verification is this year’s new effort. Using CBMC, Thibault proves that undefined behaviour cannot occur. Place scalar code, processing one value at a time, next to SIMD code and assert that the two are equal, and the equivalence can be proven as well. It works well with GCC vector extensions and suits the way edge264 is written.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qaDoOlKTG0o2riXk9hfDQQ.jpeg" /></figure><p>Verification takes time, however, so it has to run function by function. Some coding styles are incompatible and have to be changed. Even so, the attempt is notable for bringing mechanical guarantees to a world that has relied on human review for the correctness of hand-written assembly.</p><h3>LT4 — CEA-608 Closed Captions in Open Source</h3><p>by Devin Heitmueller</p><p>CEA-608 is a captioning specification laid down in the 1980s. In Europe the word subtitles is usual, while in the United States closed captions developed as data embedded in the video signal.</p><ul><li>Links: <a href="https://github.com/dheitmueller/cea608-conformance-suite">cea608-conformance-suite</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xh16Gl4ZhXDFSdwhXMn66w.jpeg" /></figure><h4>Why 608 persists</h4><p>CEA-708 followed in the 2000s, and recently web-oriented formats such as IMSC 1 and TTML have come into use. Outside the United States, however, the switch has barely happened. Replacing broadcast equipment and receivers is expensive, and continuing with the existing system is cheaper.</p><p>Devin had been writing code to convert 608 to IMSC 1 and needed material to test it against. Publicly available streams carry heavy licensing restrictions and cannot be used freely, so he built a test suite himself.</p><p>Web players expect to receive captions in formats such as IMSC 1 and WebVTT. Displaying 608 data directly in a browser is not easy. Delivering the same captions on broadcast and on the web requires an accurate conversion from 608 to IMSC 1.</p><h4>Comparing implementations with a test suite</h4><p>The suite plays video, runs the captions and compares the result with expected behaviour. It covers things that can be checked by eye: position, colour, display timing, and switching between roll-up and pop-on. The comparison work can also be handed to AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-fVGeJ40K2VWYbQSagCmQ.jpeg" /></figure><p>608 captions were originally embedded as bytes in the 21st scan line of the analogue video signal. Digital broadcast carries the same byte sequence. Control codes that change position and colour alternate with character codes, and display modes such as pop-on, roll-up and paint-on have to be followed as a state machine, keeping track of the display state while processing control codes. Because the specification is old, interpretations tend to differ between implementations.</p><p>Applying the suite to existing caption libraries gave poor results. 608 is more than thirty years old and has been implemented in VLC for more than fifteen, yet bugs remain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMHQs2drRbqa487ECFnM0Q.jpeg" /></figure><p>Most of them are shallow, however, and AI can fix them quickly. Devin said a few hours of work brought considerable improvement. It is an example of how, for older specifications, a lack of testing tends to show up in implementation quality.</p><h3>LT5 — Downscale-Aware ProRes Decoding</h3><p>by Kyle Swanson (Netflix)</p><p>Making 1080p or 540p proxies from 4K ProRes source material is a common task. If the heavy part of decoding can be stopped early, the cost of conversion falls substantially. Kyle Swanson of Netflix presented a speed-up that exploits the ordering of ProRes coefficients, a technique that is not in the specification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1seh9nJQCbakPvmb58N0g.jpeg" /></figure><h4>How ProRes decoding is structured</h4><p>ProRes decoding splits into two main stages: decoding the coefficients, and the inverse DCT that follows. Measured on FFmpeg’s decoder, coefficient decoding accounts for about three-quarters of the time. The inverse DCT is only the remaining quarter.</p><p>Ordinary downscaling decodes every coefficient, reconstructs the picture with the inverse DCT, and then shrinks it with a high-quality filter such as Lanczos. That means decoding high-frequency components that are about to be thrown away.</p><h4>Reading only the low-frequency coefficients</h4><p>ProRes stores coefficients not in the usual zigzag order but in a distinctive order. That ordering allows the decoder to read only the low-frequency coefficients needed for downscaling and skip the rest. Going from 4K to 1080p requires the top quarter; 540p needs one eighth, and 270p one sixteenth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxOVPUjyvZV1UaREmMj51A.jpeg" /></figure><p>ProRes frames are divided into slices, and coefficients are stored slice by slice. Because they are stored starting from the lowest frequencies, stopping partway still leaves the information needed for downscaling. The technique only works when downscaling, however: upscaling or high-quality downscaling needs high-frequency components, so all coefficients must be read.</p><p>The effect is large: 1080p conversion is twice as fast, 540p 5.5 times, and 270p 14 times. PSNR is almost unchanged. Combined with encoding, transcoding uses less than half the computation.</p><p>The technique is not written into the specification; it is a decoder-side optimisation. It suits proxy generation at a fixed scale, and producing several resolutions for delivery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kn5llqyAGQAXSOfQF73uMQ.jpeg" /></figure><p>Delivery makes 1080p, 720p and 540p versions from one source. Reading all coefficients for each repeats the same work. Reading only the low-frequency components needed cuts that repeated cost.</p><h3>LT6 — Four views. One Bitstream</h3><p>by Rafael Carício (Netflix)</p><p>As a sequel to his talk the day before, Rafael Carício demonstrated an AV2 demo he had built overnight. AV2 is the next-generation video codec developed by AOMedia, with a feature for packing several viewpoints into one bitstream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wJB0n1-nioVa_DwJrKGhg.jpeg" /></figure><h4>A demo built overnight</h4><p>Rafael wrote an AV2 encoder, compiled it to WebAssembly and ran it in the browser. The demo captures camera video, encodes it to AV2 inside the browser, and decodes it there as multiple streams. Everything happens in the browser.</p><p>AV2 multiview packs the frames for each viewpoint into one stream and codes them using prediction between views. In the demo, video captured from the browser camera was encoded on the spot and four views were played back together.</p><p>Nothing was optimised, and it runs at 15 frames per second. The generated OBUs (units of coded data) can be downloaded and inspected. The demo is published so that it can be tried from a QR code, and the server cost less than two dollars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kn-nn0HSULmkpSm1se2rxQ.jpeg" /></figure><h4>Lowering the effort of trying it</h4><p>The point of the talk was less the demo itself than how little effort it took to try it. The day after his previous talk, something that worked was available in a browser. Rafael said he had come to the conference for inspiration, and encouraged the audience to try things themselves.</p><p>The browser is now a place where codec experiments can be distributed with little effort. The demo showed that even something as heavy as playing four views at once runs at 15 frames per second without optimisation.</p><p>Multiview coding is needed for VR, 3D and free-viewpoint video. Sending one independent stream per view wastes bandwidth; prediction between views removes redundancy. What matters about running it in a browser is that it can be tried without installing a dedicated application.</p><h3>LT7— librist one year, seven releases</h3><p>by Sergio Ammirata (librist)</p><p>RIST (Reliable Internet Stream Transport) is a transport method for delivering packets reliably over UDP. It retransmits only the packets that fail to arrive, and adds encryption and authentication plus the use of multiple paths. Sergio Ammirata looked back on a year of librist, its reference implementation.</p><ul><li>Links: <a href="https://code.videolan.org/rist/librist">librist</a> / <a href="https://www.rist.tv/">RIST Forum</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JXsL57PEgxIVoi0VU0u0mQ.jpeg" /></figure><h4>RIST and librist</h4><p>RIST was created so that broadcasters and streaming services could exchange video without leased lines. Instead of retransmitting everything as TCP does, it uses NACK (a mechanism by which the receiver reports missing packets) and requests only what is missing, so it can recover losses while keeping latency low. librist is published under the BSD 3-clause licence and is built into products by many companies.</p><p>There were seven releases this year, taking the version from 2.14 to 2.20. There were four major additions. First, it now runs in a browser. A transport API that does not depend on sockets lets the browser’s communication features be plugged in, so it can be used from WebAssembly. A module for VLC is in review, which will let the WebAssembly build of VLC play RIST streams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-bZqgpvBwqjk2tccj4iefg.jpeg" /></figure><h4>A new profile and security</h4><p>Second, it supports a new profile of the protocol. It removes encapsulation through GRE (a tunnelling protocol) and uses RTP directly, with a 1MHz clock for fine control of send timing. Because browsers have no UDP fragmentation, splitting and reassembly to fit the MTU had to be implemented as well.</p><p>Third, security was strengthened. With authentication enabled, reconnecting requires authenticating again. RIST can reconnect quickly even in that situation; if the IP address changes, the video does not stop. The authentication mechanism has also been updated.</p><p>Finally, metrics were added for checking retransmission status. They support collection through Prometheus and status reports for tunnels (the virtual paths between sender and receiver).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LFlikViGxpZqaN_-Ux7Vg.jpeg" /></figure><p>VLC 3.0.24 now includes librist. RIST over WebTransport has been proposed to VSF (the industry body for video transport) for standardisation. Sergio himself sits on the specification committee and expects it to become a standard.</p><h3>LT8 — SRS. Simple Realtime Server</h3><p>by John Xiao (SRS)</p><p>SRS is a real-time media server released under the MIT licence. It supports the major streaming protocols and codecs and runs on Linux, macOS and Windows. It also runs on a wide range of CPUs, including RISC-V and MIPS. It has been updated for 13 years since Winlin published it in 2013.</p><ul><li>Links: <a href="https://github.com/ossrs/srs">SRS</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntNKFS8HZsCFcvZ0FwRWDQ.jpeg" /></figure><h4>One node or a cluster</h4><p>SRS accepts streams over WebRTC, RTMP and SRT, and delivers them to viewers over HLS, FLV, RTMP, SRT and WebRTC. Because different protocols can be used for ingest and for playback, it can fit both the broadcaster’s environment and the viewer’s.</p><p>On a single node, it handles ingest, delivery and recording to local or cloud storage on the same server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BD2A35iRR4n9eObZIcH6rw.jpeg" /></figure><p>There are two kinds of cluster. In an origin cluster, which handles many streams, each stream lives on one origin server and edges fetch it from there. In an edge cluster, which scales the audience, an edge pulls a stream once from the origin and distributes it to the viewers it serves. The two can be combined to build a large delivery platform.</p><p>Origins gather the sources; edges deliver from locations close to viewers. Because the same software builds both, the same operation covers everything from small delivery to a large platform.</p><p>Performance rests on state-threads, a coroutine-based I/O library. It lets asynchronous processing be written as straightforward synchronous code, without piling up callbacks.</p><h4>What’s next</h4><p>Going forward, the project plans Media over QUIC for low-latency delivery, Enhanced RTMP v2 for codecs such as AV1, greater use of FFmpeg to widen container support, and multithreading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMFzvgtw6P_SN5OYv4aPyg.jpeg" /></figure><p>John said the aim is to be the Swiss Army knife of media servers, as VLC and FFmpeg are for audio. As protocols keep multiplying, SRS intends to remain the one server that handles both ingest and delivery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OR3MkJrzgsEhy_el9HjALw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ECiKlP11NTr_ffIafXeag.jpeg" /></figure><h3>Ending Report with Gratitude of 2026</h3><p>We would like to extend our sincere thanks to Jean-Baptiste Kempf of VideoLAN and the entire VideoLAN &amp; Videolabs team for providing this wonderful opportunity for everyone.</p><p>Thanks also to Julian for organizing such an enjoyable and memorable Community Bonding Day, and of course to all the inspiring speakers.</p><p>We would like to express our sincere gratitude to Vibhoothi for the outstanding event management. Bringing together members from diverse backgrounds across the globe requires an extensive preparation period and tremendous dedication. Following Dublin and London, this was another splendid event, and it was truly wonderful to meet you in person this year!</p><p>Our gratitude also goes to Sapienza University of Rome for providing such a wonderful venue, and to the organizers of Tokyo Video Tech.</p><p>Finally, we wish to express our heartfelt gratitude to our families and friends for their kind support and encouragement that made this trip possible. Katz extends his special thanks to Hisashige “Qz” Hashimoto of Coopel. Takesato also extends his special thanks to Laia Vilagrasa, Brian Pang, and Jacky Law of NPAW.</p><p>We are already looking forward to joining VideoLAN Developer Days 2027! 😉</p><p>Reported by <a href="https://www.linkedin.com/in/takesato/">Takesato Hayashi</a> &amp; <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=baf2a528d152" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-en-baf2a528d152">VideoLAN Developer Days 2026 Rome Report Part 3 (en)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VideoLAN Developer Days 2026 Rome レポート Part 3(ja)]]></title>
            <link>https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-ja-48827ea51438?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/48827ea51438</guid>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[videos]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 12:38:24 GMT</pubDate>
            <atom:updated>2026-11-15T06:13:20.818Z</atom:updated>
            <content:encoded><![CDATA[<h4>Day 3: Conference Day: FFmpegの内部からブラウザ、規格の隙まで (Oct 18, 2026)</h4><p>2026年10月16日から18日まで、イタリア・ローマのサピエンツァ大学で、<a href="https://www.videolan.org/videolan/events/vdd26/">VideoLAN Developer Days 2026（VDD26）</a>が開催されました。VDDはVideoLANが毎年秋に開くオープンソースのマルチメディア技術の会議で、今回で15回目です。会議の中心は土曜と日曜の2日間で、前日の金曜はコミュニティデイとして、ローマの街を歩くゲームが行われました。本レポートでは、会期3日目にあたる日曜日に行われた講演とライトニングトークの要点をお伝えします。（文中敬称略）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vovFeSd8xE5y1VQ0ewHqYg.jpeg" /></figure><p>Reported by <a href="https://www.linkedin.com/in/takesato/">Takesato Hayashi</a> &amp; <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a></p><h3>エグゼクティブサマリー</h3><h4>Session 1 — libavconv</h4><ul><li>ライブラリを組み合わせて映像変換処理を書くのは手間がかかるため、開発者は映像変換にいまでもFFmpegのCLIを使っています。Khirnovは、そのCLIの中核機能を約700コミットかけてライブラリlibavconvとして切り出しました。</li><li>変換処理は循環のない有向グラフとして組み立て、任意のノードにフックを付けられます。解像度などが途中で変わる入力には、フィルターグラフを作り直す、手前で変換する、変更を出力まで伝えるの3通りで対応できます。</li><li>同梱のlibavgrabは、デバイス上の画面や音声の取り込みを処理グラフのノードとして扱います。KMS（カーネルのフレームバッファーを直接取得する仕組み）の利用に必要な処理はヘルパーに分離し、映像処理全体をroot権限で動かさずに済むようにしました。</li></ul><h4>Session 2 — Lightning Talk: News from Librempeg project</h4><ul><li>Librempegは、FFmpegから派生したプロジェクトです。FFmpegが扱わないゲーム機の映像フォーマットや、古い音声の符号化方式への対応を増やしてきた点が特徴です。</li><li>今年は音声まわりを中心に手を入れ、libsoxrのリサンプラーとresampleフィルターを代替に置き換え、音声フィルターのチャンネル数制限も見直しました。パンニングの音声フィルターはスライススレッディングに対応しています。</li><li>ゲーム向けのデコーダーやADPCMの亜種対応を増やし、THPのマルチプレクサーと映像エンコーダーも実装しました。今後はロスレス用の補正ファイルや音声フィルターのシーク対応を進めるといいます。</li></ul><h4>Session 3 — What’s new in libswscale?</h4><ul><li>libswscaleの書き換えは、約100種類の画素形式から生じる1万通りの映像データ変換を、1本の経路で処理することを目指します。素朴な命令列を実行時に生成し、最適化規則でそれらをまとめてからSIMDで実行するという構成です。</li><li>マイクロオペレーションには、値の範囲などの情報が付きます。これを手がかりに、実行時に実行環境上での最適な命令を選べるようになりました。1万通りの組み合わせはビルド時に列挙し、必要な命令を自動生成します。</li><li>変換速度は、従来のlibswscaleと比べて全画素形式の幾何平均で4.5倍（前年3.4倍）になりました。RGBAの拡大は5倍、グレースケールからRGBへの変換では3万倍になりました。</li></ul><h4>Session 4 — AArch64 Assembly Tips and Tricks</h4><ul><li>最適なコードはCPUごとに違います。Storsjöは、複数の実機で測ること、省電力コアにも調整の余地があること、x86のSIMD実装をそのまままねないことを挙げました。</li><li>性能は命令の並べ方で決まります。ロードは遅いため、その結果を使う命令との依存を減らし、独立した処理を並べます。記述順にしか実行できないコアでは、とくにスケジューリングが重要です。</li><li>直感に反する最適化も紹介しました。同じレジスターへの積和を続ける方法が一部のコアでは大きく速度改善に効きます。また、ロード命令を1つ変えるだけで3倍速くなる例もあります。dav1dのループ並べ替えで9%から13%、部分ロードの変更で3倍、組み合わせて3.37倍の速度改善をした例も示しました。</li></ul><h4>Session 5 — Streamed CABAC decode for HEVC</h4><ul><li>高ビットレートのHEVCでは、大きなIフレームがネットワーク層からデコーダーに届くまで時間がかかり、届いても直列にしか復号できない場合があります。一般的なデコーダー実装では、そのあいだCPUを使わずに待つことになります。</li><li>Kunhyaは、この待ち時間を減らすために、処理をスレッドに割り振るタスクマネージャー、映像フレームをまとめて返すAPI、パケットの到着ごとにCABACを復号する方式の3つを実装しました。</li><li>これらを合わせて従来の実装より130ミリ秒早くフレームを出せるようになりました。最大の効果はCABACのストリーミング処理ではなく、フレームをまとめて返すAPIへの移行でした。</li></ul><h4>Session 6 — vlc.js revisited</h4><ul><li>Descriptは、動画編集の合成と描画を担うエンジンを、ブラウザで動かすものと、サーバーのヘッドレスChromiumで動かすものの2つ持っていました。描画の違いを直すために2箇所を修正する必要があったため、単一のRust製エンジンへの置き換えを進めています。</li><li>描画はRustとwgpuで書き、ブラウザではWebGPU、ネイティブではVulkanやMetalで同じコードを動かします。GPUごとの微妙な描画の差は、許容範囲を決めてリグレッションテストで管理しています。</li><li>エンジンのRustへの書き換えはLLMの助けで進み、中核はほぼ完成しています。</li></ul><h4>Session 7 — Extending GDB for Multimedia Developers</h4><ul><li>Hajkovaは、GDBの内側からValgrindを動かせるようにしました。Valgrindがメモリー誤りを検出した時点で実行が止まり、GDBで変数やスタックを調べられます。target valgrindだけで起動できるようにする計画です。</li><li>また、ソースを編集して再ビルドしても、ブレークポイントが新しい位置に追従するsource-tracking breakpointを試作しました。まだ実験的な機能です。</li><li>GDBのPython APIで、カーネル関数の呼び出しを記録するftrace-nextと、待機中のスレッドのカーネルスタックを表示するdrgn_why_sleepingを実装しました。</li></ul><h4>Session 8 — Real-Time Motion Estimation and Frame Interpolation in libplacebo</h4><ul><li>Google Summer of Codeに参加したTylerは、libplaceboにGPUで動く動き推定とフレーム補間を実装しました。評価用のツールを先に作り、動きベクトル付きの映像で補間精度を測りました。</li><li>動き推定は、輝度のピラミッドを作り、前のフレームの動きを出発点に小さな探索をかけます。毎秒2,000フレームで動き、実時間の既存手法に匹敵する精度です。</li><li>補間は画面全体の動きに絞ったため非常に速い一方、複数の動きが混在する場面では残像が出ます。今後は動き推定の信頼度の導入や、AIを使うRIFEのような方式を試すといいます。</li></ul><h4>The Derek Challenge</h4><ul><li>The Derek Challengeとは、規格の隙を突いたメディアファイルを競うコンテストです。コンテストでは、規格に忠実なのに再生できないファイルと、規格から外れているのに再生できるファイルの2種類のファイルを応募できます。</li><li>MP3とAACの両方として読める音声、Opusを入れたAVI、C言語のソースでありながら映像でもあるファイルなどが集まりました。</li><li>コンテストの優勝ファイルは、63層のMV-HEVCで63×63の依存関係行列を持つ「63 layers of hell」でした。読み取りにO(n³)の推移閉包が必要で、どのプレイヤーでも再生できません。</li></ul><h4>Lightning Talks</h4><ul><li><strong>Vship</strong>：人が見て感じる画質に近い指標を、GPUで高速に計算します。SSIMULACRA2とCVVDPをCPUの8倍から10倍速くGPUで処理し、Vulkan対応でMacやIntel、AMDのGPUでも動きます。</li><li><strong>Tokyo Video Tech</strong>：2018年発足の映像エンジニアコミュニティです。2019年のVDD東京を支え、日々の活動レポートをMediumで公開しています。次回は11月25日で、登壇者を募集しています。</li><li><strong>edge264</strong>：アセンブリを使わずCのベクトル拡張で書いたH.264デコーダーです。FFmpegより約20%速く、WebAssemblyとClangのSIMDに対応しました。CBMCによる形式検証も進めています。</li><li><strong>CEA-608</strong>：CEA-608は1980年代の字幕規格ですがまだ現役で使われています。608からIMSC 1への変換を確かめるテストスイートを作り、既存ライブラリの字幕データの取り扱いの不具合を洗い出し修正しました。</li><li><strong>Downscale-Aware ProRes Decoding</strong>：4KのProResを1080pなどに縮小するとき、不要な高周波成分を復号しないことで処理を高速化。4Kから1080pで2倍、540pで5.5倍、270pで14倍速くなり、PSNRはほぼ同等でした。</li><li><strong>Four views. One Bitstream</strong>：AV2のエンコーダーを一晩で書き、WebAssemblyにしてブラウザ上で符号化・復号できるようにしました。新しいコーデックの実験を、専用アプリなしでブラウザのみで試せることを示しています。</li><li><strong>librist</strong>：RISTのリファレンス実装が1年で7回のリリースを重ねました。ブラウザ対応、GREを廃した新プロファイル、認証下での高速な接続復旧、Prometheus向けメトリクスを追加しています。</li><li><strong>SRS</strong>：SRSはMITライセンスの配信サーバーです。WebRTC、RTMP、SRT等で映像を受け取り、HLSやFLVなどで配信する多プロトコル対応と、オリジンとエッジを組み合わせた大規模配信対応を特徴としています。今後はMedia over QUICやEnhanced RTMP v2も視野に入れています。</li></ul><h3>Session 1 — libavconv — ffmpeg CLI turned into a library</h3><p>by Anton Khirnov（<a href="https://kyber.tech/">Kyber</a>）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hohbIQFl_DhAHkZjesfdg.jpeg" /></figure><p>FFmpegのライブラリがあり、GStreamerのような同種のプロジェクトもあります。それでも、映像の変換処理を書くとき、多くの開発者がffmpegのコマンドラインツールをバックエンドに呼び出します。ffmpegのコマンドラインツールを長年保守してきたAnton Khirnovは、この事実を「ライブラリが提供するものと、利用者が求めているものとの隙間」と捉え、その隙間を埋めるライブラリlibavconvを作りました。libavconvはKyberのプロジェクトの一部ですが、Kyberが手がけるほかのソフトウェアには依存せず、単体で使えます。発表では、処理グラフのAPI、ストリームのパラメーター変更への対応、画面や音声を取り込む同梱ライブラリlibavgrabが紹介されました。</p><h4>ライブラリがあるのに、なぜCLIが選ばれるのか</h4><p>Khirnovはまず、なぜffmpeg CLIが使われ続けるのかを整理しました。理由の1つは、ライブラリの複雑さです。マルチメディアそのものが複雑なので、ライブラリが利用者に求める設定も細かくなります。しかし、多くの場面でそこまでの自由度は要りません。細部はライブラリに任せ、妥当な既定値で動いてくれれば十分です。</p><p>もう1つは、ライブラリ同士を適切につなぐこと自体が難しいという点です。ファイルの読み書きはAVFormat、符号化と復号はAVCodec、データの変換はAVFilterが担います。この3つの間をつなぐ処理は簡単だと考えられてきましたが、いまはそうではありません。20年前ならともかく、現在は違うとKhirnovは述べました。</p><p>ffmpegのCLIは、このつなぎ込みを利用者に代わって処理します。単純なラッパーに見えますが、実際は大規模で洗練されたプログラムです。だからこそ人々はライブラリではなくCLIをバックエンドに選ぶ、とKhirnovは見ています。そこで、CLIが担っている機能をそのままライブラリにできないかと考えました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xosd4-MdYPrSYiDhi_ArYA.jpeg" /></figure><h4>700コミットかけてCLIから切り出す</h4><p>そうして作られたのがlibavconvです。CLIから一度に分割したのではなく、約700コミットをかけて少しずつ切り出しました。履歴をたどれば、何をどの順に切り出したかが分かります。分割は一続きの作業として進み、どの段階でもテストは通っていたといいます。</p><p>libavconvに移したのは、スケジューラー、コンポーネント間の通信、各コンポーネントの中核部分です。スケジューラーは、どの処理をどのスレッドで動かすかを決める仕組みです。コンポーネントは、デマルチプレクサー（ファイルから音声や映像のデータを取り出す処理）、マルチプレクサー（取り出したデータをコンテナーへ書き出す処理）、デコーダー、エンコーダー、フィルターを指します。コンポーネント間の通信も複雑で、ここもライブラリ側に入りました。</p><p>CLIに残ったのは、コマンドラインの解析と、与えられた選択肢と入力から処理グラフを組み立てる処理です。CLIは非常に多様な用途を扱うため、コマンドラインの解析だけでもかなりの複雑さを伴います。そのため、この部分はCLI側に残しました。加えて、ライブラリにはふさわしくない特殊な用途向けの機能も、後述するフックを使ってCLI側に実装されています。</p><p>リポジトリーのGit履歴は、ある時点までのFFmpegの履歴とつながっています。ただし、FFmpegのフォークではありません。分割のあと、CLIとlibavconv以外はすべて削除されたからです。FFmpegのソースを取り込んでおらず、パッチも当てていません。libavconvはFFmpegのAPIを通常どおりに使うだけなので、自分のビルドしたFFmpegとリンクできます。このCLIをFFmpegのソースツリーに置いてビルドすると、2件を除いてテストが通るといいます。libavconv自体は、グローバルな状態を持たないように作られていますが、外部のライブラリーのなかにはグローバルな状態を持つものがあり、そこまでは守りきれていません。</p><h4>処理グラフをAPIで組み立てる</h4><p>APIは、処理の流れを有向グラフとして組み立てる形になっています。Khirnovは、スライド1枚に収まるほど短い、再多重化（リマルチプレクス）のコード例を示しました。再多重化は、符号化し直さずにコンテナーだけを入れ替える処理です。</p><p>まず、処理グラフ全体を表すコンテキストを確保します。コンテキストは、状態をまとめて持つ入れ物です。次にデマルチプレクサーを作り、ファイルを開きます。ここは手間がかかります。グローバルヘッダーを読み、それがなければ中身を少し読んでフォーマットを推定し、どんなストリームが入っているかを調べる必要があります。続いて、デマルチプレクサーが持つストリームごとにマルチプレクサーと対応するストリームを作り、接続用のAPIで両者をつなぎます。最後に起動し、終わるのを待ちます。</p><p>複雑な用途では、グラフはもっと大きくなります。ソースには、デマルチプレクサーのほか、libavgrabによるキャプチャー、内部にデータの生成元を持つフィルターグラフ、独自のスレッドとしてグラフにデータを流し込むユーザーノード、メインスレッドからAPIを呼んでデータを渡すデータソースがあります。出口（シンク）は2種類で、符号化済みのデータを書き出すマルチプレクサーと、グラフが作ったデータを外へ取り出すデータシンクです。ソースとシンクの間にデコーダー、エンコーダー、フィルターを自由につなげます。ただし、循環のない形にする必要があります。</p><h4>フックでストリームを差し替える</h4><p>各ノードにはフックを付けられます。フックは、パケットを受け取った、フレームを送った、パラメーターが変わったといったイベントで呼ばれるコールバックです。対象のパケットやフレームを調べ、書き換え、挿入し、捨てることもできます。グラフは非同期に動くため、通常は外から触れないAVCodecContextやフィルターグラフにも、フックからはアクセスできます。</p><p>CLIはフックを使い、複雑な機能を実装しています。ビットマップ字幕を映像ストリームとして扱う機能や、タイムスタンプの操作がその例です。Khirnovは、これらをライブラリの機能にするのは適切ではないと判断しました。</p><h4>解像度が途中で変わるストリームをどう扱うか</h4><p>映像の大きさ、画素形式、音声のチャンネル数が、ストリームの途中で変わることがあります。libavfilterは、こうした変化に対応できません。これはlibavfilterに限りません。FFmpegのなかでデコーダー以外のコンポーネントは、実行中のパラメーター変更を扱えないとKhirnovは説明しました。しかし、現実の入力では変更が起きます。libavconvは、この変更への対応方法を3通り用意しています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hxQ889du0sI4L4JQc0B9g.jpeg" /></figure><p>1つ目は、ffmpegのCLIが採っている方法です。入力のパラメーターが変わると、フィルターグラフ全体を破棄し、出力側のパラメーターを保ったままグラフを作り直します。フィルターグラフの後ろ、通常はエンコーダーには変化が見えません。この方法でも動きますが、フィルターグラフ上の状態をすべて失います。カウンターやメタデータなど、保持したいものも消えます。</p><p>2つ目は、フィルターの手前に変換処理を挿入する方法です。入力のパラメーターが変わったとき、元のパラメーターに戻してから流し込みます。フィルターグラフには変化が伝わらないため、リセットも不要です。ただし、この方法も別の場面では最適ではありません。</p><p>3つ目の方法は、フィルターグラフは作り直すものの、出力のパラメーターは固定しないやり方です。入力の変化は出力まで伝わり、エンコーダーは残ったデータを書き出したうえで作り直されます。Khirnovは、Kyberで使う典型的な例として、ウィンドウをキャプチャーしている最中にその大きさを変える場合を挙げました。この場合、大きさの変化をマルチプレクサーなど出口まで伝えられることが重要になります。</p><h4>GStreamerとの違いはどこにあるのか</h4><p>「GStreamerを再発明しただけではないか」と、複数の人から聞かれたそうです。Khirnovは「ある意味そうだ」と認めつつ、FFmpegの世界とGStreamerの世界はほとんど重ならないと説明しました。</p><p>libavconvはFFmpegの世界に属します。そのため、AVFrameやAVPacketといったFFmpegのオブジェクトに直接アクセスしたい場合に向いています。FFmpegは成り立ちからしてトランスコード寄りで、GStreamerは再生寄りだというのがKhirnovの印象です。任意のファイルを放り込んでデコードする用途は、FFmpegの世界のほうが容易だと述べました。</p><h4>libavgrabで画面と音声を取り込む</h4><p>libavgrabは、libavdeviceの代わりに使う同梱ライブラリです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QD9h1mq09JOwQsQ3JAXuSw.jpeg" /></figure><p>libavdeviceは、デバイスをAVFormatのAPIで扱えるようにしたマルチプレクサーとデマルチプレクサーを提供しています。つまり、ウィンドウやカメラ、マイクをデマルチプレクサーとして扱える仕組みです。<br>Khirnovは、この作りに問題があると見ています。とくにデバイスへの出力は、マルチプレクサーのAPIが用途に合っておらず、実用には耐えないといいます。<br>libavdeviceの入力側は、出力よりはまだましです。デスクトップのキャプチャーをファイルのように扱えます。それでも、AVFormatがコールバックでデータを読み出すのに対し、キャプチャーのAPIはフレームを返すため、両者の形は合いません。フレームをパケットに詰める方法も、まだ議論の途中です。ハードウェアアクセラレーションを組み合わせると、さらに難しくなります。パラメーターの変更にも対応しておらず、ウィンドウを大きくすると一部しか取得できず、小さくするとキャプチャーが止まってしまいます。</p><p>libavgrabはlibavconv専用のライブラリで、画面や音声の取り込みというlibavdeviceと同じ役割を担います。libavconvの公開APIだけを使ってlibavdevice相当の機能を実装しています。使い方は、まずプロバイダーを作ります。ディスプレイサーバーへの接続に相当するもので、対象によって中身は変わります。プロバイダーに問い合わせて、デスクトップ、画面、ウィンドウ、マイク、カメラといったソースの一覧を得ます。この一覧は時間とともに変わり得ます。選んだソースをキャプチャーに結びつけると、キャプチャーは処理グラフのノードになり、デマルチプレクサーやデコーダーと同じようにつなげます。</p><p>対応するプロバイダーは複数あります。Windowsには、DirectXで高速化するデスクトップキャプチャーのDXGIと、マイクやループバック（再生中の音の取り込み）を含む音声があります。Unix系には、X11、Wayland、PulseAudio、カメラ向けのv4l2、そしてカーネルからフレームバッファーを直接取得するKMSがあります。macOS向けのScreenCaptureKitはほぼ完成しており、レビュー中で数週間のうちに取り込まれる予定です。GStreamerのパイプラインの出力をどうしても取り込みたい場合のために、GStreamerのプロバイダーもあります。</p><p>KMSの実装は、libavgrabのなかでもとくに手が込んでいます。単体のプロバイダーとしても、X11とWaylandの内部でも使われます。X11ではキャプチャーできますが、GPUのハードウェア支援は使えず、ソフトウェアで読み出す経路しかありません。Waylandでは、使えるキャプチャー方法が環境によって変わり、保証がありません。KDEは、画面の取得にポータル（デスクトップ環境の許可を得る仕組み）を使うよう求めます。KMSは、カーネルが管理する画面のバッファーを直接読み出すため、デスクトップ環境の構成に左右されません。その代わり、画面を管理するソフトウェアと連携できないため、すべての環境で安定して動くとは限りません。</p><p>KMSでは画面の中身をそのまま読めます。そのため、KMSを誰でも使えるようにするとほかの人の画面をのぞけてしまうため、KMSの利用にはroot権限が必要となっています。Debianでは、従来KMSを使うアプリケーション全体をrootで動かす必要がありました。画面を取り込むだけの処理に、システム全体を操作できる権限を与えることになり、安全ではありません。libavgrabは小さなヘルパープログラムを同梱し、そこにファイルケイパビリティ（実行ファイルに個別の権限を与えるLinuxの仕組み）を与えて特権を持たせます。libavgrabがヘルパーを起動してKMSからフレームバッファーを取得するため、処理グラフ自体はrootで動かさずに済みます。</p><h4>残っている作業と質疑</h4><p>今後は、スケジューラーをより動的にし、実行中にグラフの構成を変えられるようにします。また、利用者が任意のノードを挿入できるようにします。安定版のリリースと、対応するキャプチャーの追加も計画しています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QlM3tFR24REa_lF-4w28rw.jpeg" /></figure><h4>まとめ</h4><p>libavconvは、ffmpegのCLIの中核をライブラリとして切り出したものです。700コミットかけて少しずつ分割した作業は、どこまでをライブラリが担い、どこからをCLIが担うかという線引きを示しています。パラメーター変更への3通りの対応と、特殊な用途に限った機能をCLI側に残すフックは、ライブラリを汎用に保ちながら、CLIの用途の広さを維持するための分け方になっています。画面や音声の取り込みまで同じグラフで扱えるようになれば、ffmpegのCLIを子プロセスとして呼び出す構成を、アプリケーションのなかへ取り込む道が開けます。</p><h3>Session 2— Lightning Talk: News from Librempeg project</h3><p>by Paul B Mahol（<a href="https://github.com/librempeg/librempeg">Librempeg</a>）</p><p>LibrempegはFFmpegから派生したプロジェクトで、FFmpegが扱わないゲーム機の映像フォーマットや、古い音声の符号化方式への対応を増やしてきた点が特徴です。5分のライトニングトークでPaul B Maholは、前回のVDDからの変更点と、音声処理の方針、今後取り組む項目を紹介しました。</p><ul><li>関連リンク：<a href="https://github.com/librempeg/librempeg">Librempeg</a></li></ul><h4>音声を優先し、リサンプラーを入れ替える</h4><p>Maholが最初に挙げたのは、音声のリサンプリング処理の入れ替えです。libsoxrによるリサンプリングとresampleフィルターを削除し、より良い方法に置き換えました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jki8vukCXRUv0CdcETqjfA.jpeg" /></figure><p>音声フィルターが受け付けるチャンネル数の制限も見直しました。チャンネルを振り分けるパンニングのフィルターは、スライススレッディング（1つのフレームを複数のスレッドで手分けして処理する仕組み）に対応しています。</p><p>Librempegは音声に関する実装を優先する方針で、Maholは映像フィルターよりも音声フィルターに高い優先度を置いていると説明しました。</p><h4>ゲーム向けのフォーマットを増やす</h4><p>前回のVDDからの追加として、新しいフィルターをいくつか紹介しました。デコーダーは、ゲームで使われるさまざまなフォーマットに対応してきました。ADPCM（音声の差分を符号化する方式）の亜種対応も追加しています。ほかの実装にはないマルチプレクサーやエンコーダーも加わったといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ELiKldpApfH9-RM7bqMGw.jpeg" /></figure><p>なかでもMaholが挙げたのが、ゲーム機向けの動画フォーマットTHPです。THPのマルチプレクサーと映像エンコーダーを新たに実装しました。THPは多くのゲームとプラットフォームで使われており、これでTHPの書き出しにも対応しました。</p><h4>リサンプリングの品質</h4><p>Maholは、自身が改良した音声リサンプリングのアルゴリズムにも触れました。周波数を徐々に変えるスイープ信号をアップサンプリングし、折り返し雑音（エイリアシング）が出ない例をデモしました。</p><p>このアルゴリズムは、ライセンスの緩いPythonスクリプトとして公開されたあと、RustやC++、Pythonなど複数のプロジェクトに取り込まれました。Maholは、FFmpegのlibswresampleより音質が良いと述べています。Hydrogen Audioのフォーラムを見れば、このアルゴリズムを使うプロジェクトが見つかるといいます。</p><h4>これからの作業</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64w3_WBZ3PWybFWMfnRBiQ.jpeg" /></figure><p>今後の課題として、一部のフォーマットでロスレスデコード用の補正ファイルに対応すること、未完成のフィルターを仕上げること、音声フィルターにシーク対応を加えることを挙げました。映像の画素フォーマットの変換についても、libswscaleによるソフトウェア処理を、libavfilterによる処理に置き換える計画です。</p><h3>Session 3— What’s new in libswscale?</h3><p>by Niklas Haas</p><p>FFmpegは約100種類の画素形式を扱い、任意の画素形式から任意の画素形式への変換を考えると、組み合わせは1万通りに達します。従来のlibswscaleは、よく使う組み合わせごとに専用の処理経路を用意し、速度を稼いでいました。Niklas Haasは、任意の組み合わせを1本の経路で処理する書き換えを進めており、前回のVDDで紹介した内容の、その後の変化を報告しました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*syQ-fGZ_ztz_K90kr0jS-g.jpeg" /></figure><h4>前回までの設計</h4><p>従来のlibswscaleは、画素形式ごとに手書きされた処理経路の集まりでした。対応している組み合わせにばらつきがあり、不具合も脆弱性も性能も、画素形式ごとに異なっていました。</p><p>Haasの目的は、そうした個別の手書きのコードをなくし、入力も出力も任意の画素形式を扱える1本の経路を作ることです。まず、画素形式の変換に必要な計算を、1つずつ素直に並べた命令の列にします。この段階では速さを考えず、どの組み合わせでも正しく動くことを優先します。次に、同じ結果になる範囲で命令をまとめ、少ない手順で済むようにします。最後に、その命令列をSIMD命令でまとめて実行します。この仕組みの詳細は前回の発表に譲り、今回はその後の変更を紹介しました。</p><h4>中間層としてのマイクロオペレーション</h4><p>この1年で大きかったのは、内部の作り直しです。最適化後の命令をそのままCPUで実行するのではなく、あいだに「マイクロオペレーション」と呼ぶ中間層を挟みました。高水準の命令を、ハードウェアに近く、実装しやすい命令へ翻訳します。それぞれのマイクロオペレーションには、値がどの範囲に収まるかといった情報があらかじめ付いています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rg_OL_AdisbqXxqqgwU9fg.jpeg" /></figure><p>例として、YUVからRGBへの変換を挙げます。これは、行列演算に、拡大縮小、シフト、レベル調整の係数が混ざった処理です。x86には積和演算（FMA）があり、乗算と加算を分けるより速い場面があります。ただし、結果が完全に一致すると証明できなければ使えません。プラットフォームによって出力が変わってしまうからです。マイクロオペレーションには値の範囲の情報が付いているので、翻訳の段階で、積和演算の中間結果が24ビットの仮数部（浮動小数点で有効数字を保持する部分）に収まるかどうかを、成分ごとに判定できます。収まると分かった成分だけを積和演算に置き換え、収まらない成分は乗算と加算に分けたままにします。</p><h4>1万通りの組み合わせから命令を集める</h4><p>マイクロオペレーションの種類は膨大になります。すべてを手で実装するのは現実的ではありません。Haasは、ビルド時に網羅的な列挙を行うようにしました。1万通りの画素形式の組み合わせについて、拡大、縮小、3次元ルックアップテーブル（色の対応を表す3次元の表）など、起こり得る処理をすべて洗い出します。その過程で現れたマイクロオペレーションを集め、自動生成のヘッダーにマクロとしてまとめます。この列挙はFATE（FFmpegの回帰テスト）が自動で行うため、再現性があり、正しさも確かめられます。各バックエンドはそのマクロを実装するだけでよく、個々の命令の組み合わせを意識せずに済みます。</p><p>中間層を設けたことで、対応するバックエンドが増えました。LLVMの中間表現、ARMのNEON（ARM向けのSIMD命令）、x86向けのコードを生成できます。テスト用のチェッカーも自動生成され、カーネルごとに正しさを確かめられます。高水準側は低水準の実装を知らずに済み、低水準側も高水準の都合を知らずに済むようになりました。</p><h4>拡大縮小もグラフのノードにする</h4><p>この作り直しで、libswscaleは拡大縮小そのものも扱えるようになりました。Haasは、すべてのフィルターを処理グラフのノードとして扱う方針で進めました。高水準側は、必要な場所にフィルターの命令を差し込むだけで、実装はマイクロオペレーションへの翻訳に任せます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HpDGV3GzWCEdYa7f0CIJ8w.jpeg" /></figure><p>実行時には、任意のフィルターグラフを独立した部分グラフに分解し、それぞれをハードウェア向けの実装に対応づけます。部分グラフごとに別のバックエンドを割り当てることもできます。Cによるフォールバックは本当に必要な場合だけに減り、それ以外はSIMDで処理します。たとえば、x86のAVX2でクロマを縮小しておき、次の部分グラフで拡大し、その次の部分グラフでRGBへ変換するといった組み合わせを扱えます。</p><h4>対応するフォーマットと整数演算</h4><p>対応する入力フォーマットも増えました。パレットやルックアップテーブルを使うフォーマットにも広がり、ほぼすべてをカバーできつつあるといいます。整数演算の経路も追加しました。この実装はもともと浮動小数点で計算する方針で、昨年はそれで通用するのかという声もありました。全体としては浮動小数点のほうが速いものの、整数のほうが速い場面は残ります。マイクロオペレーションの層があるため、整数経路は浮動小数点経路とほぼ同じコードから自動生成できます。1チャンネル32ビットの画素形式にも対応しました。</p><p>ARM64向けには、Ramiro PollaがNEONバックエンドを実装しました。Haasは、x86向けの従来コード（SSE4）より速いと評しています。Pollaはさらに、実行時に命令列をSIMDへコンパイルするJITバックエンドも進めています。Vulkan向けに、実行時にSPIR-V（Vulkanで使う中間表現）を生成する取り組みもあります。</p><h4>ベンチマーク</h4><p>すべての画素形式の幾何平均で、従来のlibswscaleより4.5倍速くなりました。前回は3.4倍だったので、1年で差が広がっています。RGBAの拡大は約5倍速いといいます。従来は、いったん共通の画素形式を経由して拡大する必要があり、パック形式（画素が連続して並ぶ形式）のまま拡大できませんでした。新しい実装はその制約がないため、中間の画素形式への変換にかかる時間が丸ごと省けます。YUV420から422、444への拡大も、よく行われる変換でありながら専用の最適化がなく、今回の作りで自然に速くなりました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CyUeTvxY0bEQuyo4-zoCKA.jpeg" /></figure><p>グレースケールからRGBへの変換では、データを移す必要すらありません。すべての色成分を同じデータへの参照にすれば済みます。前回は700倍だった高速化が、今回は3万倍になったといいます。</p><h4>実運用に向けて</h4><p>質疑では、実運用に使えるのかと問われました。Haasの答えは「ほぼ使える」です。現在はフラグを有効にした場合だけ使えます。1〜2か月以内に安定版にしたいといいます。テストの枠組みを整え、すべてを検証できると確信できてから安定版にする方針です。実際の利用者からのフィードバックも求めています。</p><p>従来の方法より遅くなる場面も残っています。YUV420からRGBAへの変換では、いったん浮動小数点の中間バッファーに変換してからフォーマットを整えるため、遅くなります。この経路は修正中で、直れば従来と同等以上になる見込みです。もう1つは、従来のlibswscaleが速度を稼ぐために品質を落としていたような処理です。たとえば、丸めの精度を落とす、拡大ではなく画素を複製する、といった処理はまだありません。</p><h4>まとめ</h4><p>libswscaleの書き換えは、任意の画素形式を1本の経路で扱う目標に近づきました。マイクロオペレーションという中間層と、ビルド時にすべての組み合わせを試す仕組みが、対応フォーマットの拡大と4.5倍という速度を両立させています。</p><h3>Session 4 — AArch64 Assembly Tips and Tricks</h3><p>by Martin Storsjö</p><p>この1年、ARM64（AArch64）向けのNEONを書く新しい貢献者が増えました。Martin Storsjöは、レビューのたびに個別に伝えてきた助言をまとめ、あわせて経験の長い開発者でも意外に感じる最適化を紹介しました。アセンブリの書き方そのものを教える発表ではありませんが、ARM64のコードを書くときの判断を、CPUの構造から説明する内容です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZlWnx8uLFh__k0a88HhEQ.jpeg" /></figure><h4>CPUごとに最適なコードは違う</h4><p>最適化の難しいところは、CPUごとに命令の実行時間が違うことです。1つのCPUだけで調整すると、そのCPUでは最適でも、別のCPUでは大きく劣る可能性があります。複数の実機を持っているなら、並行して測り、一方で速くなり他方で遅くなる調整のなかから、釣り合いの取れた点を探すべきだといいます。</p><p>レビューでStorsjöが提案する調整のなかには、Apple Siliconの大きなコアでは差が見えないのに、ほかのCPUでは重要なものもあります。ただし、すべての開発者が十数台の実機をそろえる必要はありません。いくつかの経験則を身につければ十分だと述べました。</p><p>とくにCortex-A53やA55といった小さなコア、省電力コアには、調整の余地が多く残っています。各社は命令の時間をまとめた最適化ガイドを公開していますが、Storsjöは「読んでいない」といいます。数字を覚えるのではなく、どの処理が速く、どれが遅いかを感覚として身につけるほうが実用的だという考えです。</p><h4>NEONでは素直にCを写す</h4><p>NEON（ARMのSIMD命令）では、x86のような小技は要りません。Cのコードを見て、同じ処理をアセンブリで書けばよく、命令セットがそろっているため、変わった工夫は不要だといいます。</p><p>役に立つのは、複数の処理をまとめて行う命令です。丸めと飽和（値を上限や下限に収める処理）を同時に行う命令、積和（乗算と加算）を行うMLA、符号付き16ビットを8ビットの画素へ丸めながら変換する命令などがあります。定数を足してから右シフトする処理は、その定数が丸めのための値であることが多く、専用の丸め付き右シフトに置き換えられます。16ビットの乗算結果を16ビットのまま得る命令もあります。</p><p>x86のSIMD実装がすでにある場合、参考にするのはよいものの、処理の流れまでまねるのは避けるべきだといいます。x86では範囲の末尾から添字を取るなど、アドレス指定の都合に合わせた書き方があり、ARM64のアドレス指定とは違うからです。NEONらしい書き方を身につけるには、FFmpegにある小さなNEON関数を読むのがよいと勧めました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gXbYQ9PuHZwTCKWlQXpRA.jpeg" /></figure><p>パッチをプロジェクトに取り込んでもらう前に、まず計測してみることが重要です。既存のC実装より速くなければ、アセンブリを追加する意味はありません。SVE（可変長のベクトル命令）も、現状では利点が乏しいといいます。SVE2で使える命令はごく最近まで128ビット幅までに限られており、可変長を前提に書くとループ展開の余地を失うためです。</p><h4>命令の並びが性能を決める</h4><p>Storsjöは、命令のスケジューリングを「個人的に一番好きな話題」として、基礎から説明しました。</p><p>CPUは1度に1命令しか実行しなかった時代を経て、1990年代にスーパースカラー（複数の命令を同時に開始できる方式）になりました。ある命令の結果を次の命令が使う場合、その結果が出るまで次は始められません。メモリーからの読み込み（ロード）は遅く、ロードした値を使う命令は待たされます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NwhqCewUuy2d4t-kV4o55Q.jpeg" /></figure><p>そこで、依存関係のないロードを先にまとめて発行し、そのあとで値を使う計算を並べます。実行できる命令の数はコアごとに違い、演算器の数も限られます。きれいに見えるコードより、依存の連鎖を切ったコードのほうが速くなります。単純な関数では、並列に処理できるデータを増やすため、ループを展開することも必要です。</p><p>最近の大きなコアは、記述した順序とは違う順で命令を先に実行できます（アウトオブオーダー）。この場合はスケジューリングの重要度は下がります。一方、スマートフォンの省電力コアの多くは記述順にしか実行できません。2024年に発売された機種でも、省電力コアだけで構成されたものがありました。安価な端末では、この差が大きく効きます。</p><p>命令をまとめると読みやすくなりますが、並べ替えの自由度は下がります。マクロでまとめるほどスケジューリングは悪くなるため、コメントを多めに書き、別々の計算を交互に並べるよう勧めました。</p><p>アルゴリズムも同じくらい重要です。x0からx7までを順に足すと7命令が一直線につながりますが、x0+x1、x2+x3、x4+x5、x6+x7を並行して計算し、木のように足し合わせれば3段階で済みます。</p><h4>ポストインクリメントが作る依存</h4><p>ARM64のロードには、読み出したあとにポインターを進めるポストインクリメントがあります。コードは短くなりますが、進めたポインターを使う次の命令は、その更新を待つことになります。ロードしたデータを使う計算も、読み込みの完了を待ちます。</p><p>対策の1つは、偶数行と奇数行で別のベースレジスターを使い、進める幅を2倍にする方法です。もう1つは、x2から読む命令とx2+x3から読む命令を使い分け、最後にx2を進める方法です。命令数は増えますが、大きなコアでは速くなることがあるといいます。</p><h4>直感に反する最適化</h4><p>Storsjöは、ARMのエンジニアから受けた、直感に反する提案を3つ紹介しました。</p><p>1つ目は、同じレジスターへの積和です。FIRフィルターのような処理では、前の結果に足し込む形になります。依存を切るために2つのレジスターへ交互に足すのがよさそうですが、Cortex-A53、A55、A520、C1-Nanoには、前の命令の結果をそのまま次に渡す専用の経路があり、足し込みを続ける形のほうが速いといいます。この形に書き換えると、A53、A55、A520で約40%速くなり、アウトオブオーダーのコアでは1%程度の低下で済みます。ただし、Cortex-A510にはこの経路がなく、同じ書き方が大きく遅くなります。A510は大きなコアと組み合わせて使われるため、対象から外す選択肢もあると述べました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4rKtqXzguh2yPdIIe14AA.jpeg" /></figure><p>2つ目は、dav1dの8画素幅の関数です。以前のコードは、すでに手元にある値から計算を始め、遅いロードを後回しにしていました。ARMの提案は逆で、ロードを先に始め、別の命令を1つ挟んでから、ロードした値を使います。深いアウトオブオーダーのコアでは、次のループの反復を前の反復と重ねて実行できます。省電力コアでは数%遅くなりますが、大きなコアでは9%から13%速くなりました。</p><p>3つ目は、ロードの幅です。4バイトだけ読めばよい場面で、16バイトのレジスターの一部だけを読み込む命令を使うと、残りの部分は前の内容のまま残ります。そのため、前のループが書き込んだ値に暗黙に依存してしまいます。読み込んだ4バイトをレジスター全体に複製する命令か、残りを0で埋める命令に変えると、次の反復をすぐに始められます。命令を1つ変えるだけで3倍速くなり、ほかのコアでの低下は1桁台に収まりました。2つ目の並べ替えと合わせると3.37倍です。</p><p>Storsjöは、コードを書くときはプロセッサーがどう命令を実行するかを意識する必要があると述べました。同自身はCortex-A53向けの調整を長く続けてきたため、考え方がそこに固定されがちで、大きなコアの特性を意識してコードを読む必要があると感じているといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IIqyRRLRGoChJu9UsNWTmw.jpeg" /></figure><h4>質疑</h4><p>質疑では、実行ユニットが足りないならGPUを使えばよいのではないかと問われました。Storsjöは、試みはあるものの自分の専門外だと答えています。映像コーデックでは低遅延と分岐が必要で、GPUは使いにくいということでした。</p><p>SVEに利点はあるかという問いには、一部の命令で10%程度の改善が得られる場合があると答えました。ただし、SVE2で使える命令はごく最近まで128ビット幅までに限られており、可変長を前提に書くとループ展開の余地を失うため、コーデックの関数では性能を出しにくいといいます。</p><h4>まとめ</h4><p>ARM64のアセンブリを書くときの判断を、CPUの構造に結びつけて整理した発表でした。ロードは遅いという原則は変わりませんが、積和の依存をあえて残すほうが速いコアもあれば、ループをまたいで命令を早く始められるコアもあります。実機をたくさんそろえなくても、経験則と測った結果を積み上げれば、多くのCPUで通用するコードに近づけられるとのことでした。</p><h3>Session 5 — Streamed CABAC decode for HEVC</h3><p>by Kieran Kunhya（Open Broadcast Systems）</p><p>Kieran Kunhyaは当初、HEVCのデコードにはもう課題が残っていないと考えていました。しかし、高ビットレートの映像をソフトウェアで実時間にデコードするには、まだ改善の余地があります。Kunhyaは、パケットが届くそばからCABAC（算術符号化によるエントロピー復号）を解き、到着を待つあいだにデコードを進める方法を紹介しました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRKISAYC8VDAw-g_4DLMMg.jpeg" /></figure><h4>巨大なIフレームが到着するまでの空白</h4><p>高ビットレートの映像では、大きなIフレームが届くまでの時間が問題になります。Iフレームがネットワークを伝わって届くまでに100ミリ秒近くかかることがあり、そのあいだデコーダーは何もできません。フレームがそろってから、まとめて処理を始めることになります。<br>また、最悪のケースでは、1メガバイトを超えるIフレームが、1スライスだけで符号化されていることもあります。タイルもウェーブフロント並列（WPP）もないため、並列化の余地がありません。届くのに時間がかかるうえ、届いてからも先頭から順にデコードするしかありません。</p><p>現在のFFmpegは、多数のスレッドにフレームを振り分けて並列にデコードし、こうした待ちを埋め合わせています。ただし、CPUとメモリーを余分に使い、コンテキストスイッチも増えます。受信の遅れを隠すために、デコード全体の遅延を大きくしているだけだといいます。GPUも選択肢になりにくいといいます。4:2:2を扱えない場合があり、性能の上限も分かりません。GPUを搭載していない端末もあります。</p><h4>PTSまでの猶予を測る</h4><p>ファイルを入力にするベンチマークは、入力データをいくらでも速く読めます。リアルタイムで受信しながらデコードする場合、パケットの到着がボトルネックになり、デコードの進み方が変わります。CPU使用率やフレームレートを見ても、そのときに使えたCPUを生かせたかどうかは分かりません。</p><p>Kunhyaは、トランスポートストリームが絶対的なデコード時刻を持つ点に着目しました。各フレームは、表示時刻（PTS）までにデコードを終えていなければなりません。そこで、デコードが終わってからPTSが来るまでの時間（猶予）を測ります。デコーダーの内部遅延は差し引いて正規化します。平均やP99（上位1%の値）ではなく、もっとも猶予のないフレームに注目しました。それはほとんどが、巨大なIフレームです。</p><p>検証手順は次の通りです。トランスポートストリームを実際の受信と同じ速さで流します。Multicat（ストリームを送出するツール）で送り、実時間を模したツールでデコードして猶予を測ります。クリップは1本10分ほどで、実時間で流すため、1回の測定にも10分かかります。変更のたびに何度も繰り返すので、数時間から数日かかることもあります。</p><h4>タスクマネージャーで直列な処理を分割する</h4><p>Kunhyaは、この猶予を増やすために3つの実装をしました。まずタスクマネージャーを導入しました。dav1dやVVCのデコーダーで使われている方式です。エントロピー復号、再構成、フィルタリングを別々のタスクに分け、複数のスレッドに配ります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3KyeEEI_9hP0IEZBhEO5OQ.jpeg" /></figure><p>並列化できないファイルでも、エントロピー復号が左から右へ進みながら、再構成やフィルタリングの仕事を次々に作り、ほかのスレッドがそれを処理します。データ自体は先頭から順にしか読めませんが、復号と後段の処理を重ねて進められるため、複数のスレッドが同時に働けます。</p><p>この段階の改善は、もっとも猶予のないフレームで33ミリ秒でした。アセンブリの最適化やIDCTの実装も同時に進めましたが、そちらはほとんど効きませんでした。数ミリ秒の改善にとどまり、そのフレームの猶予を増やすには至らなかったといいます。</p><h4>フレームをまとめて返せるAPIへ</h4><p>次が、Kunhyaにとっても意外だった部分です。FFmpegのソフトウェアデコードAPIは、おおむね1フレームを入れて1フレームを返す形です。大きなIフレームの到着を待っているあいだに、表示できる状態のフレームが10枚たまっていても、外へ出せません。</p><p>そこでH.264デコーダーを、ハードウェアデコーダー向けに作られたAV receive frame API（準備ができたフレームをまとめて受け取るためのAPI）へ移しました。Kunhyaの知る限り、ソフトウェアデコーダーとしてははじめてだといいます。準備ができたフレームをまとめて返せるようになり、到着待ちが終わった時点で、たまっていたフレームを一度に返せます。</p><p>この変更の効果は77.4ミリ秒で、3つの取り組みのなかで最大でした。</p><h4>パケット到着ごとにCABACを解く</h4><p>最後が、発表の題名にあるCABACのストリーミングです。トランスポートストリームのデマルチプレクサーを、1パケットずつ出力するように変えます。FFmpegは通常、フレーム全体がそろうまで待つため、これは大きな変更です。</p><p>既存の分割デコードはNAL単位です。しかし対象のストリームは1スライスが1つのNALなので、そのままでは使えません。そこで、パケット単位でデコードを進める方式（フラグメントベース方式）を実装しました。ビット列には、開始コードと紛らわしい並びを避けるため、余分なバイトが入っています。パケットごとに、その余分なバイトを取り除く必要があります。パケットが小さいため、その処理が1秒に数万回呼ばれます。1メガバイトのIフレームでは、この処理の負荷が無視できなくなり、アセンブリで書き直す必要がありました。CABACのエンジンも、パケット単位で状態を保てるように変えています。CABACはFFmpegのなかでも非常に最適化されたコードで、1命令の違いが効くため、慎重に扱う必要があります。</p><p>CABACでは、符号化木単位（CTU）の切れ目が分かりません。データが足りずCTUを最後まで解けなければ、元の状態に巻き戻します。単純にパケットごとに試すと、10%から15%が巻き戻しになり、大きな負担でした。参照フレームではCTUが大きい傾向があるため、その場合は多めにパケットをためてから解くようにしました。巻き戻しは2%程度まで下がっています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y83Kyhn1se5FqXUqOXwQZw.jpeg" /></figure><p>この効果は20.5ミリ秒で、3つの中では最小でした。Kunhyaは、ここが最大の改善になると予想していたといいます。フレームの最後のパケットが届いた時点で、CABACの復号はほぼ終わり、再構成も大半が済んでいます。</p><h4>壊れたストリームでの検証</h4><p>信頼性の検証にも多くの時間をかけました。解像度の変更、ストリームの連結、壊れたデータの連結、ファジングなど、異常な入力を作り、従来のアクセスユニット（表示単位のデータのまとまり）ごとのデコードとフラグメント単位のデコードがビット単位で一致するかを確かめます。</p><p>この過程で、AIは何度も「x265をダウンロードして、スライスで並列化できるよう再エンコードさせてほしい」と頼んできたそうです。Kunhyaは、入力されるコンテンツは自分たちで選べないのだと、そのたびに説明し直しました。</p><h4>AIに任せた作業</h4><p>Kunhyaは、作業の大部分をAIに任せたと明かしました。少し前まで、同は「AIが複雑なコーデックの作業をすることはない」と公の場で話していました。それが半年で変わり、いまはAIがその作業をこなしています。日々の雑用をしているあいだに、AIが実用的な32×32のIDCTを書いたといいます。x86の細部を理解し、<a href="https://uops.info/">uops.info</a>の命令データを使って、CPUごとにコードの調整もします。人間が書いたコードに比べて出来が90%でも、コードが100倍速く出てくることのほうが価値が大きい、という評価です。</p><p>一方で、AIを求める方向に導くエンジニアは必要です。Kunhyaは、判断する人がいてこそ成り立つと述べました。</p><h4>質疑</h4><p>質疑では、H.264でも同じことができるかと問われました。Kunhyaは可能だとしつつ、インターレースやフィールドとフレームの扱いが複雑で、タスクマネージャーへの影響が読めないと答えています。</p><p>パケット単位で処理する場合のパケットロスや並べ替えについては、FEC（誤り訂正）と並べ替えはデコーダーより手前で行われる別の処理で、デコーダーからは制御できないと説明しました。ロスがないと分かっていれば、SPSやPPS、VPS（ストリームの構成情報）がそろった時点で先にデコードを始める余地はあるものの、モジュールの分離を崩すことになると述べています。</p><p>スレッド構成については、CABACは1スレッドで、専用のスレッドに載せているものの、どのCPUコアで動かすかを固定する設定はしていないといいます。CABAC以外のタスクは、ストリームに並列性がなくても、複数のスレッドで処理します。</p><p>CABAC処理でなぜ巻き戻しとスナップショットを使うのか、ビットリーダーの段階で状態を保てばよいのではないかとも問われました。CABACは1命令単位で最適化されたコードで、手を入れると全体の性能に響くため、避けたいと答えています。</p><p>対応するストリームの制約については、どの種類でも動くと答えました。タイルやスライスがあれば、その並列性も生かします。ただし到着順にしか読めない以上、スライスが届くまで待つ部分は残ります。</p><h4>まとめ</h4><p>Kunhyaの取り組みは、パケットの到着を待つあいだに使われずにいたCPUを、デコードに回すものでした。効果が大きかったのはCABACのストリーミングではなく、フレームをまとめて返せるAPIへの移行でした。3つの変更を合わせると、従来の方法より130ミリ秒早くフレームを出せます。</p><p>検証は1080p59.94で行い、4Kではキャッシュの影響で事情が変わる可能性があるとしています。コードは15,000行で、プロジェクト本体に取り込むかは未定です。</p><h3>Session 6 — vlc.js revisited: one Rust media engine for the browser, the server and beyond</h3><p>by Romain Beauxis（<a href="https://www.descript.com/">Descript</a>）</p><p>ブラウザで動画を編集するには、利用者が持ち込む多様なデータフォーマットをデコードし、合成し、書き出す必要があります。Descriptでメディアエンジニアを務めるRomain Beauxisは、ブラウザ用のエンジンと、サーバーのヘッドレスChromiumで動かす同じエンジンの2経路を、Rustの1本のエンジンに置き換える取り組みを紹介しました。</p><ul><li>関連リンク：<a href="https://www.descript.com/">Descript</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R8LTa2k5QUmYz26nwknv4Q.jpeg" /></figure><h4>2つの経路が抱えていた問題</h4><p>3年前、VideoLANはVLCをWebAssemblyにコンパイルしたVLC.jsをFOSDEMで披露しました。Beauxisは当時の取り組みを興味深く見ていたといいます。いま携わるDescriptも、ブラウザで多様なメディアをデコードするという同じ問題を抱えています。異なるのは、編集した内容を書き出す必要があることです。合成やGPUを使った処理も加わります。</p><p>Beauxisが1年ほど前に入社した時点では、まず動くものを作る段階でした。あれこれ寄せ集めて、とにかく動かすことを優先した構成です。FFmpegのライブラリをWebAssemblyにビルドしてブラウザでデマルチプレクスし、デコードとエンコードはブラウザのAPIを使います。合成はブラウザのGPU APIで行い、書き出しはサーバー上でヘッドレスChromiumを動かし、ブラウザと同じ経路で描画していました。</p><p>この構成では、画質の不具合を2箇所で直す必要があります。サーバー側はブラウザを丸ごと抱えるため、運用も重くなります。そこで、ブラウザでもサーバーでも同じコードが動くエンジンを作り直すことにしました。</p><h4>Rustとwgpuで描画を1本にする</h4><p>中核にはRustを選びました。メモリー安全で話題の言語だからというだけでなく、WebAssemblyへのコンパイルに適した処理系があり、wgpuという抽象化層が使えるためです。wgpuはVulkan、Metal、DirectX、WebGPUといったGPUのバックエンドを切り替えられます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paxGHKVC6XJnVyIQfAq5DA.jpeg" /></figure><p>処理は、デコード、GPUへの転送、合成、出力、エンコードの順に進みます。デコード、合成、エンコードの各段では、ホスト側のAPIを呼びます。ブラウザではWebCodecsとWebGPU、必要ならWebGL2を使い、出力もWebCodecsで行います。サーバーでは同じ位置にネイティブのAPIを差し込みます。</p><p>Rustは全体を調整する役割を担います。ホストにデコードや合成、エンコードを依頼し、結果の通知を受け取ります。アプリケーションのロジックは1箇所にまとまり、サーバーのコマンドラインからも、ブラウザのなかからも同じものを動かせます。同じエンジンを、将来は携帯端末など別の環境にも展開できます。</p><p>GPUの出力は、同じ計算でもビット単位では一致しません。丸めの方法や、シェーディングで端の画素をどう扱うかが、バックエンドごとに違うからです。そこで、許容できる差を決め、コード変更のたびに描画結果を比較するリグレッションテストを回して、差が範囲に収まることを確かめています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-aviMGUHtNkl6KxFgCPgkg.jpeg" /></figure><h4>クライアントが扱うデータフォーマットを絞る</h4><p>デマルチプレクスだけは別扱いです。現在のクライアントはFFmpegのlibavをWebAssemblyにした1つの経路を持っています。しかし、映像フォーマットは日々進化し、FFmpegの新版が出るたびに修正を移植する必要があります。利用者のブラウザは古い版のまま残ることも多く、MXFのような専門的なフォーマットを加えるのも容易ではありません。あらゆるフォーマットをクライアントで読めるようにするのは、いたちごっこだといいます。</p><p>そこで、アプリケーションが扱うコンテナーとコーデックを絞る方針にしました。H.264など対象を決め、エンジンの内部は正規化されたフォーマットだけを扱う前提にします。入口に置くのがMTS（メディア変換サーバー）です。利用者がアップロードしたファイルを、サーバー側の最新のFFmpegで正規化します。将来はWebSocketを使い、対話的に変換しながら取り込むことも考えています。</p><h4>デコーダーと描画を差し替え可能にする</h4><p>エンジンの中核はlibavに依存しません。デコーダーはプラグイン方式で、ブラウザではWebCodecsとWebAssembly版のFFmpeg、サーバーではlibavcodecを使います。複数の映像や文字を1枚に合成する処理は1つにまとめ、文字の描画が環境によって崩れないよう調整しています。</p><p>利用者の編集内容はタイムラインとして保存し、描画用のグラフ（処理をノード、データの流れを辺で表したもの）に変換します。新しい描画バックエンドを追加するときも、このグラフを描画して既存の結果と比べ、差が許容範囲に収まるかを確かめます。</p><h4>LLMで大規模な書き換えを進める</h4><p>エンジンを丸ごと作り直す作業は、20人規模のチームでなければ無理だと考えていたといいます。転機はLLMでした。自動検証のテストを大量に書かせ、エンジニアはそのテストが妥当かどうかと、コードの構成が整理されているかを見ます。古い実装の不具合を直しながら、同じテストを新しい実装にも当てて、両者を同期させられます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xr3i59Nla-IP9gzOlRqRjw.jpeg" /></figure><p>Beauxisは、仕様を文章で書き、それをコード変更の指針にする考え方にも触れました。従来は「コードが仕様」でしたが、そうしたコードには、当時は仕方なく入れた回避策や場当たり的な処理が残っています。LLMはそうした記述に引きずられ、本来の振る舞いを読み取りにくくなることがあります。そこで、システムの望ましい振る舞いを文章で記述し、それを介してコードの変更を指示します。</p><p>この進め方で書き換えを進めており、コアはほぼ完成して、サーバー側では描画処理が行える状態になりました。近く本番に載せる予定だといいます。</p><h4>まとめ</h4><p>VLC.jsから3年、ブラウザのAPIはWebCodecsやWebGPUへと整いました。それでも、多様なデータフォーマットの取り込みと、GPUごとに異なる描画結果という2つの問題は残ります。Beauxisは、フォーマットの正規化をサーバーに任せ、描画の差は許容範囲と試験で管理し、アプリケーションのロジックをRustで1本にまとめる道を選びました</p><h3>Session 7— Extending GDB for Multimedia Developers</h3><p>by Alexandra Petlanova Hajkova（Red Hat）</p><p>GDBはプログラムを止めて状態を調べるデバッガーで、Valgrindはメモリーの誤りを見つけるツールです。Red HatでLinuxカーネルのデバッグを担当するAlexandra Petlanova Hajkovaは、この2つを組み合わせ、コードを編集して再ビルドしてもデバッグを続けられるようにする改良を紹介しました。GDBの内側からValgrindを対話的に動かし、ブレークポイントをソースの変更に追従させ、カーネルの情報までGDBに持ち込みます。</p><ul><li>関連リンク：<a href="https://www.sourceware.org/gdb/">GDB</a> / <a href="https://valgrind.org/">Valgrind</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQFWeQPBncxowB3kKcCGDQ.jpeg" /></figure><h4>ValgrindをGDBのなかから動かす</h4><p>Valgrindは通常、プログラムを動かし、終了してから結果をまとめて確認する使い方になります。メモリー誤りが起きた時点で変数の中身を調べるには、別の端末でデバッガーを起動する必要がありました。Hajkovaは、GDBからValgrindをリモートのターゲットとして起動できるようにしました。Valgrindが不正な読み出しを検出すると実行が止まり、GDBのプロンプトに戻ります。そこでスタックをたどり、変数を表示できます。</p><p>Valgrindの監視コマンドもGDBから使えます。help memcheckと入力すると、memcheckで使える監視コマンドの一覧が表示されます。エラーが出た場所のバイト列を調べれば、どのバイトが未初期化か、どこから先がアクセスできないかを確かめられます。スレッドの競合を調べるhelgrindにも固有の監視コマンドがあり、ロックの所有者をGDBから確認できます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZHEC2qpkM9IFsleVE0kXw.jpeg" /></figure><p>現在はValgrindを起動するための長いコマンドを書く必要がありますが、target valgrindだけで済むようにする計画だといいます。</p><h4>編集しても位置がずれないブレークポイント</h4><p>2つ目は、ソースの変更に追従するブレークポイントです。ファイル名と行番号を指定してブレークポイントを置き、その行を編集して同じGDBのセッションで再ビルドすると、GDBはシンボルを読み直します。しかし、元の行番号にあった命令は消えているため、ブレークポイントは無効になり、実行はそこで止まりません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPguSXRZExaEOPHehzVLDg.jpeg" /></figure><p>Hajkovaが試作したsource-tracking breakpointは、ブレークポイントの周囲のソースを保存しておき、再ビルド後に新しいソースのなかから対応する箇所を探し、ブレークポイントの位置を調整します。たとえばif文の行に置いていたブレークポイントは、編集後のif文に付け直されます。これはまだ実験的な機能だといいます。</p><h4>カーネルの情報をGDBに持ち込む</h4><p>3つ目は、GDBのPython APIで書いたコマンドです。ftrace-nextは、ソースをステップ実行するあいだに、カーネル関数の呼び出しと戻り値を記録します。システムコールが失敗したとき、カーネル側で何が起きたかを追えます。drgn_why_sleepingは、カーネルの構造をPythonから扱うdrgnライブラリを使い、待機中のスレッドがカーネルのどこで止まっているかを表示します。どの処理を待っているのかを、カーネルのコールスタックから確かめられます。</p><p>いずれも実験的な試みで、できることと制限の両方を説明する発表でした。質疑では、Valgrindには以前からデバッガーを起動する機能があったのではないかと問われました。Hajkovaは、2つの端末を用意する代わりに、GDBの内側から同じことができるようにした点が違いだといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCtJu60KB2cT3Q1eeX4ZTw.jpeg" /></figure><h4>まとめ</h4><p>Hajkovaの改良は、デバッグの途中で道具を切り替える手間を減らすものです。Valgrindの検出結果をGDBでそのまま調べられ、ソースを編集してもブレークポイントが追随し、カーネルの待機状態まで同じ画面で確認できます。マルチメディアのコードは、アセンブリやスレッド、カーネルとのやり取りが絡むぶん、デバッガーとメモリー検査ツールを行き来する場面が多くなります。その行き来を減らす今回の改良は、こうした現場でこそ役立ちます。</p><h3>Session 8— Real-Time Motion Estimation and Frame Interpolation in libplacebo</h3><p>by John Tyler</p><p>フレーム補間とは、たとえば24fpsの映像を60fpsの画面でなめらかに見せるための技術です。前後のフレームから画素の動きを推定し、その途中の時刻の絵を作ります。Google Summer of CodeでVideoLANに参加したJohn Tylerは、libplaceboにGPUで動く動き推定とフレーム補間を実装しました。メンターはlibplaceboのメンテナーであるNiklas Haasが担当しています。</p><ul><li>関連リンク：<a href="https://code.videolan.org/videolan/libplacebo">libplacebo</a> / <a href="https://summerofcode.withgoogle.com/programs/2026/projects/gB256bA7">GPU Accelerated Motion Compensation-based Video Frame Interpolation in libplacebo</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G4HDQBvRSg-4DiGu0CDxRg.jpeg" /></figure><h4>先に評価の道具を作る</h4><p>Tylerは、アルゴリズムを比べて確かめるための道具から作りました。既存の実装には、FFmpegのminterpolateフィルター、mvtools、クローズドソースのSmooth Video Project、NVIDIA Optical Flowを使う機能などがあります。研究の蓄積も多く、何をもって良い実装とするかを決める必要がありました。</p><p>評価には、動きベクトルが付いたオープンソースのアニメーション映画を使いました。速さ、正確さ、補間した映像の見た目の3点を測ります。動き推定は、推定した動きを色と明るさで可視化しました。色は動きの向き、明るさは推定を外した度合いを表します。補間の評価では、元の映像から1枚おきにフレームを間引いて半分のフレームレートにし、補間で元に戻した結果を元のフレームと比べます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QIPE6ABdPO0NT6lQtvqUAw.jpeg" /></figure><h4>動き推定はピラミッドと小さな探索で</h4><p>Tylerが実装した動き推定は、次の手順です。まず色の情報を落として明るさ（輝度）情報だけにし、解像度の異なる画像を重ねたピラミッドを作ります。もっとも粗い層から始め、前のフレームで推定した動きを出発点の候補にします。その周囲を小さな半径で総当たりし、ブロックごとの動きを決めます。続いて、ブロックを周囲の中央値で置き換えるメディアンフィルターを掛けます。これを各層で繰り返し、もっとも細かい層まで上げていきます。</p><p>この処理はGPU上で毎秒2,000フレーム程度まで処理でき、実時間で動くほかのアルゴリズムと比べても遜色ありません。作りは単純で、エンコーダーが使う動き推定にも近い形です。前のフレームの動きを出発点にするため、単純なブロック探索では捉えられない大きな動きにも追随できます。</p><p>エンコーダーの動き推定との比較も行いました。NVENCとlibx264で符号化した映像の動きと比べると、精度は近い水準です。ただし、両者の目的は同じではありません。エンコーダーはデータ量を減らすために動きを推定しており、動きベクトルの正確さだけを追っているわけではありません。Tylerの実装はフレーム補間のために動きベクトルを使うので、動きベクトルの正確さが重要になります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2PU2oGzXlq0t1_mVEe5vg.jpeg" /></figure><h4>補間は大域の動きに絞る</h4><p>補間の実装は、夏の間の成果としてあえて単純にしました。推定した動きをそのまま使うのではなく、中央値だけに圧縮します。画面全体が同じ方向へ動く場面では、これで十分に機能します。前のフレームと次のフレームから、補間する時刻の比率に合わせて画素を取ってきて、時間的な近さに応じて混ぜ合わせます。</p><p>この方法は非常に速く、モニターが表示できるどのフレームレートにも追従できます。ただし、動きが複数ある場面では崩れます。手前の物体だけが別の方向へ動く場面では、輪郭のまわりに残像が出ます。木が画面の大半を占め、文字が別に動く場面では、木に合わせた動きが文字にも適用され、文字が大きく崩れます。</p><p>課題としてTylerが挙げたのは、オクルージョン（手前の物体に隠れること）の検出と、動きの表現です。現在は縦横の並進だけを推定していますが、拡大縮小や回転を扱うにはアフィン変換やホモグラフィーが必要になります。隠れた部分の画素をどう混ぜるかも難しく、研究の余地が大きいといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gy1ODLLQjR_fEWmd-3rE9Q.jpeg" /></figure><p>今後は、ブロックごとの推定に確信度を持たせて混ぜ方に反映すること、評価用の道具を整理すること、AIを使うRIFEのような方式を試すことを挙げました。ほかのソフトウェアへ組み込むための相談も歓迎しています。</p><p>質疑では、エンコーダー以外の動き探索をGPUで行う仕組みがあるかと問われました。Tylerは、AMDとNVIDIAのGPUにオプティカルフローを計算する機能があり、NVIDIAのものは非常に良いと答えています。</p><h4>まとめ</h4><p>Tylerの実装は、ブロック単位の動き推定と、画面全体の動きを使う補間を組み合わせたものです。毎秒2,000フレームという速度と、実時間で動く既存手法に匹敵する精度を両立しました。一方で、複数の動きが混在する場面や手前の物体の残像は残り、今後の研究課題になっています。</p><h3>The Derek Challenge</h3><p>by <a href="https://www.linkedin.com/in/jbkempf/">Jean-Baptiste Kempf</a>（<a href="https://www.videolan.org/">VideoLAN</a>）</p><p>The Derek Challengeは、規格の隙を突いたメディアファイルを競うコンテストです。狙いは2つに分かれます。規格に忠実なのに、どのプレイヤーも最後まで再生できないファイル。規格から外れているのに、なぜか再生できてしまうファイル。VideoLANのJean-Baptiste Kempf（以降jb）が、寄せられた作品を紹介し、会場の投票で最優秀作を決めました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORrk6OESI0QvI_PoqKKXuQ.jpeg" /></figure><h4>規格に忠実なまま再生できないファイル</h4><p>最初に紹介されたのは、DimitriのMPEG-TSです。番組を構成するストリームの一覧を伝えるPMTの扱いを突いた作品でした。新しい版のPMTが別のPID（ストリームを識別する番号）へ移り、しかもPMTは届いた時点で有効になります。プレイヤーは移り先を追えず、数秒で再生を止めました。</p><p>H.264のFMO（柔軟なマクロブロック順序）を使った作品もありました。FMOは規格の一部ですが、FFmpegのH.264デコーダーは対応しておらず、jbの知る限り再生できる実装はありません。</p><p>Niklasの「63 layers of hell」は、MV-HEVCで63層を持つファイルです。層の依存関係は63×63の行列になり、出力レイヤーの組み合わせは3,070通り、ストリームの構成情報だけで60キロバイトに達します。次のフィールドを読むには、依存関係の推移閉包をO(n³)で計算する必要があります。どのプレイヤーでも再生できず、参照デコーダーでも正しく動かなかったといいます。</p><h4>別のフォーマットとしても開けるファイル</h4><p>Romainは、MP4として開いた場合と、別の方法で開いた場合で異なる映像が現れるファイルを提出しました。MP4のコンテナーのなかに、もう1本の映像を隠した構造です。</p><p>Françoisの作品は、MP3とAACの両方として読める音声ファイルです。AACのprivate data（規格上、用途を決めずに使える領域）とパディングの領域にMP3のフレームを埋め込み、MP3ヘッダーのビットレート表記も実際より高く偽ることで、MP3とAACのどちらのデコーダーでも正しいファイルとして読めるようにしています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mzEKONYKVtqO7THeYEtfw.jpeg" /></figure><p>Nathanは、音声コーデックが未定義のAVIにOpusを入れた作品を提出しました。Moonは、C言語のソースファイルでありながら映像としても開けるファイルを作りました。画像フォーマットのXPMにCのコードを埋め込んだもので、コンパイルすると映像を表示するプログラムになります。</p><h4>投票と結果</h4><p>会場の投票でもっとも支持を集めたのは、Niklasの63層のMV-HEVCでした。jbは、作品を公開すると述べています。</p><p>jbは、今回は十分に難しくしたと振り返りつつ、来年はさらに難しくすると述べました。</p><h4>まとめ</h4><p>作品に共通するのは、規格のなかでも誰も使わない機能や、複数のフォーマットが重なる境界を突いている点です。規格の読み方の隙を突くことが目的で、デコーダーの実装がどこまで規格を追えているかを映し出す企画になっていました。</p><h3>LT1 — Vship Fast Metric Computation on GPU</h3><p>by Line</p><p>映像エンコーダーの設定を決めるとき、何を基準に画質を測るかで結果が変わります。Vshipの発表は、その指標の選び方と、重い指標をGPUで動かす取り組みです。</p><ul><li>関連リンク：<a href="https://codeberg.org/Line-fr/Vship">Vship</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rcuLeVcm4uXWjEIYK7byqw.jpeg" /></figure><h4>評価指標の選び方に問題がある</h4><p>PSNRとSSIMは、画素の差を数値にする指標で、人が感じる画質とほとんど相関しません。ノイズが乗っていても、ぼけていても、数値が良ければ高画質と判定されます。</p><p>VMAFは知覚に近づけた指標ですが、機械学習でデータセットへの相関を学んだもので、量子化パラメーターの変化にはよく反応するものの、最適化の指針にすると指標のスコアを上げることだけを狙った映像ができがちだといいます。Lineは、これがエンコーダーの目指す姿ではないと述べました。</p><p>必要なのは、より多くの種類の劣化に対応できる頑健な指標であり、そのためには機械学習のパラメーターを減らし、人間の視覚系のモデルを充実させる必要があります。</p><h4>ColorVideoVDPをGPUへ</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ZpYVjyYLGeqYtbL6rnuvQ.jpeg" /></figure><p>その条件に合うのが<a href="https://www.cl.cam.ac.uk/research/rainbow/projects/colorvideovdp/">ColorVideoVDP</a>（CVVDP）です。人間の視覚系を丁寧にモデル化した指標で、色の見え方やコントラストの感度、マスキングといった現象を扱います。精度は高いものの、CPUで動かすと非常に遅く、実用の妨げになっていました。</p><p>Vshipは、SSIMULACRA2とCVVDPをGPUで計算するライブラリです。SSIMULACRA2は、SSIMを出発点に、人の見え方に合わせて改良した指標で、CVVDPとあわせて用途に応じて選べます。CPU版と比べて8倍から10倍速く、色変換も内部で扱います。Vulkanに対応するため、MacやIntel、AMDのGPUでも動きます。GPUバックエンド以外に依存しないC APIも用意しています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQxy5SuBrRhpRlB80c8ABw.jpeg" /></figure><p>品質指標を実時間に近い速度で回せるようになれば、エンコーダーの調整を、知覚に沿った指標で行えるようになります。指標を調整のループで回すには、計算時間が壁になるといいます。</p><h3>LT2 — Tokyo Video Tech</h3><p>by Takesato Hayashi (<a href="https://luma.com/tokyo-video-tech">Tokyo Video Tech</a>)</p><p>Tokyo Video Techは、映像とストリーミングの技術に関心を持つエンジニアのためのコミュニティです。2018年12月に発足し、東京で勉強会を開いてきました。ライトニングトークでは、これまでの活動と次回の案内が紹介されました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnyQpa9D9O5dov5e9UwCCw.jpeg" /></figure><h4>2018年から続く勉強会</h4><p>オンライン動画やストリーミングの技術を扱うエンジニアが集まる場として始まりました。運営はTakesato、Katz、Hiromineの3名で、これまで複数の勉強会を開いてきました。コーデック、配信、プレイヤーなど、映像技術の幅広い話題が扱われます。海外のカンファレンスに参加したメンバーが内容を持ち帰り、報告する場にもなっています。</p><p>2019年には東京でVDDを共催し、海外の開発者を招いて技術交流を行いました。VDD26にはこのコミュニティから2名が参加しています。<a href="https://medium.com/tokyo-video-tech">発表の内容はMediumでレポートとして公開しており</a>、イベントに参加できなかった人も後から読めるようにしています。</p><h4>次の開催と登壇者の募集</h4><p>次回のTokyo Video Techは11月25日に開催する予定です。発表者を随時募っており、東京に来られる人には連絡してほしいと呼びかけました。VDD26に登壇した開発者にも、東京での発表を呼びかけています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2jmVaGEBb_uMqGiLDagVaA.jpeg" /></figure><p>コミュニティは、海外の開発者と日本のエンジニアをつなぐ窓口の役割も担っています。VDDのような場で知り合った人を招いて話を聞くことで、最新の技術動向を国内に紹介してきました。今回のVDD26の内容も、レポートとして公開しています。</p><h3>LT3 — edge264</h3><p>by Thibault Raffaillac（edge264）</p><p><a href="https://github.com/tvlabs/edge264">edge264</a>は、手書きのアセンブリを使わず、Cのベクトル拡張でH.264をデコードする研究プロジェクトです。Thibault Raffaillacは、その一年の変化を報告しました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TtqeqnfWFOa3b9ysW6xjUA.jpeg" /></figure><h4>アセンブリを書かずに速くする</h4><p>H.264のようなコーデックの実装では、速度を出すためにSIMDのアセンブリを手で書くのが一般的です。edge264は逆の道を選びました。Cのベクトル拡張でSIMDを表現し、コンパイラーに最適化を任せます。現在はFFmpegより約20%速く、Cで書かれているため、コンパイラーが良くなればそのまま速くなります。</p><p>いまはNetflixで製品に使うための仕上げを進めており、複数スレッドへの対応とAVX-512の実装が残っています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VcBpWXDp0-Zn6tvYXxyTmg.jpeg" /></figure><h4>移植性の広がり</h4><p>この一年で、WebAssemblyのバックエンドと、ClangのSIMD拡張のバックエンドを完成させました。これでどのアーキテクチャーでも動きます。RISC-Vで動かした利用者もいて、結果はリポジトリで確認できます。Cのベクトル拡張だけで書くという方針が、実際に複数の環境で成り立つことを示した形です。</p><p>WebAssembly版を作る過程で、V8のJITであるTurboFanの性能解析も行いました。Arm向けのバックエンドでは、コンパイルと実行を合わせた時間が、SSE向けにコンパイルしたコードをArmで動かすより遅くなる逆転が起きており、その原因はシャッフル命令にあると特定しました。</p><p>数か月前に、このプロジェクトを基にしたフォークが作られました。そのフォークには、複数スレッドの実装でFFmpegをさらに上回る成果や、多くのテストが含まれています。ただし、その場しのぎの修正も多く、必要な変更だけを選んで取り込む必要があるといいます。長いベクトル拡張を使う実装は、実測で約20%遅いといいます。</p><h4>形式検証で未定義動作をなくす</h4><p>今年の新しい取り組みが形式検証です。CBMCを使い、未定義動作が起こり得ないことを証明します。1度に1つの値を処理するスカラーコードとSIMDのコードを並べ、両者が等しいという表明を置けば、その等価性も証明できます。GCCのベクトル拡張と相性がよく、edge264の書き方に合っています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qaDoOlKTG0o2riXk9hfDQQ.jpeg" /></figure><p>ただし、検証には時間がかかるため、関数ごとに実行する必要があります。相性の悪い書き方もあり、その場合はコードを直す必要があるといいます。それでも、手書きアセンブリの正しさを人手のレビューに頼ってきた世界に、機械的な保証を持ち込む試みとして注目されます。</p><h3>LT4 — CEA-608 Closed Captions in Open Source</h3><p>by Devin Heitmueller</p><p>CEA-608は1980年代に定められた字幕の規格です。欧州では「字幕」と呼ぶのが一般的ですが、米国ではクローズドキャプションとして、映像に埋め込む形で発展してきました。</p><ul><li>関連リンク：<a href="https://github.com/dheitmueller/cea608-conformance-suite">cea608-conformance-suite</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xh16Gl4ZhXDFSdwhXMn66w.jpeg" /></figure><h4>608が残る理由</h4><p>その後、2000年代にはCEA-708が定められ、近年はIMSC 1やTTMLといったウェブ向けのフォーマットも使われています。しかし、米国以外ではほとんど切り替わっていません。放送設備や受信機を入れ替える費用が大きく、既存の仕組みをそのまま使い続けるほうが安いからです。</p><p>Heitmuellerは、608からIMSC 1への変換コードを書いており、その検証に使う素材を必要としていました。公開されているストリームはライセンスの制約が重く、自由に使えません。そこで、テスト用のスイートを自作しました。</p><p>ウェブのプレイヤーは、IMSC 1やWebVTTといったフォーマットで字幕を受け取ることを前提にしています。608のデータをそのままブラウザで表示するのは容易ではありません。放送と同じ字幕をウェブでも届けるには、608からIMSC 1へ正確に変換しなければなりません。</p><h4>テストスイートで実装を比べる</h4><p>スイートは、映像を再生し、字幕を流し、期待する挙動と比べる仕組みです。位置、色、表示時間、ロールアップやポップオンの切り替えなど、目で見て確かめられる項目をそろえています。比較の作業は、AIに任せることもできます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-fVGeJ40K2VWYbQSagCmQ.jpeg" /></figure><p>608の字幕は、もともとアナログ映像信号の21本目の走査線にバイト単位で埋め込まれました。デジタル放送でも同じバイト列が伝送されます。表示位置や色を変える制御コードと文字コードが交互に並び、pop-on、roll-up、paint-onといった表示方式を、状態機械（表示状態を保ちながら制御コードを処理する仕組み）として追う必要があります。規格が古いぶん、実装ごとに解釈の差が出やすい領域です。</p><p>このスイートを既存の字幕ライブラリに当てると、出来は芳しくありませんでした。608は30年以上前の規格で、VLCにも15年以上前から実装されていますが、不具合は残っていました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMHQs2drRbqa487ECFnM0Q.jpeg" /></figure><p>ただし、多くは浅い不具合で、AIを使って素早く直せるといいます。Heitmuellerは、数時間の作業でかなり改善したと述べました。古くからある規格ほど、テストの不足が実装の質に表れやすいという例になっています。</p><h3>LT5 — Downscale-Aware ProRes Decoding</h3><p>by Kyle Swanson（Netflix）</p><p>4KのProResを素材に、1080pや540pのプロキシ素材を作る場面は珍しくありません。このとき、デコードの重い部分を途中で止められれば、変換の負荷を大きく減らせます。NetflixのKyle Swansonは、ProResの係数の並びを利用した、規格には書かれていない高速化の手法を紹介しました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1seh9nJQCbakPvmb58N0g.jpeg" /></figure><h4>ProResのデコード構造</h4><p>ProResのデコードは、大きく2つの処理に分かれます。係数の復号と、そのあとの逆DCTです。FFmpegのデコーダーで測ると、約4分の3を係数の復号が占めます。逆DCTは残りの4分の1にすぎません。</p><p>通常のダウンスケールでは、いったんすべての係数を復号し、逆DCTで画像に戻してから、Lanczosのような高品質なフィルターで縮小します。この方法では、縮小の段階で捨ててしまう高周波成分まで、復号することになります。</p><h4>低周波成分の係数だけを読む</h4><p>ProResの係数は、一般的なジグザグ順ではなく、独特な順序で格納されています。この順序のおかげで、縮小に必要な低周波成分の係数だけを読んで、残りを飛ばせます。4Kから1080pへ落とすなら上位4分の1、540pなら8分の1、270pなら16分の1を読めば事足ります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxOVPUjyvZV1UaREmMj51A.jpeg" /></figure><p>ProResのフレームはスライスに分かれ、スライスごとに係数が並びます。低い周波数の係数から順に格納されるため、途中で読むのをやめても、縮小に必要な情報はそろいます。ただし、この手法が使えるのは縮小のときだけです。拡大や高画質な縮小では高周波成分まで要るため、すべての係数を読む必要があります。</p><p>効果は大きく、1080pへの変換で2倍、540pで5.5倍、270pで14倍速くなりました。PSNRはほぼ同等です。エンコードと組み合わせたトランスコードでも、計算量を半分以下に抑えられます。</p><p>この手法は規格に書かれているものではなく、デコーダー実装側の工夫です。縮小率が決まっているプロキシ生成や、配信用の解像度をいくつも作る場面に向きます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kn5llqyAGQAXSOfQF73uMQ.jpeg" /></figure><p>配信では、1本の素材から1080p、720p、540pといった複数の解像度を作ります。それぞれで全部の係数を読むと、同じ計算を何度もやり直すことになります。必要な低周波成分だけを読む方法は、この繰り返しのコストを減らします。</p><h3>LT6 — Four views. One Bitstream</h3><p>by Rafael Carício（Netflix）</p><p>前日の発表の続編として、Rafael Carícioは、一晩で作ったAV2のデモを披露しました。AV2はAOMediaが進める次世代の映像コーデックで、複数の視点を1本のビットストリームにまとめる機能を持ちます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wJB0n1-nioVa_DwJrKGhg.jpeg" /></figure><h4>一晩で作ったデモ</h4><p>Carícioは、AV2のエンコーダーを書き、WebAssemblyにコンパイルしてブラウザで動かしました。デモは、カメラの映像を取り込み、ブラウザのなかでAV2に符号化し、同じブラウザで複数ストリームとしてデコードします。すべてブラウザ上で完結します。</p><p>AV2のマルチビューは、視点ごとのフレームを1本のストリームにまとめ、視点間の予測を使って符号化します。デモでは、ブラウザのカメラから取り込んだ映像をその場で符号化し、4視点をまとめて再生しました。</p><p>最適化はしておらず、毎秒15フレームです。生成したOBU（符号化データの単位）をダウンロードして中身を確かめることもできます。デモはQRコードから試せる形で公開され、サーバーの費用は2ドル未満でした。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kn-nn0HSULmkpSm1se2rxQ.jpeg" /></figure><h4>試すまでの手間を減らす</h4><p>発表の狙いは、デモそのものより、試すまでの手間の少なさにあります。前日の発表の翌日には、動くものがブラウザで見られる状態になりました。Carícioは、刺激を求めてこの会議に来たと話し、聴衆にも気軽に試してみてほしいと呼びかけました。</p><p>ブラウザは、いまやコーデックの実験を手軽に配布できる場です。4視点の同時再生のような重い処理でも、最適化なしで毎秒15フレームで動く、という目安を示したことになります。</p><p>マルチビューの符号化は、VRや3D、自由視点の映像で必要になります。視点ごとに独立したストリームを送るより、視点間の冗長性を削れるため、帯域を抑えられます。ブラウザでこれが動く意義は、専用のアプリを入れずに試せることにあります。</p><h3>LT7 — librist one year, seven releases</h3><p>by Sergio Ammirata（librist）</p><p>RIST（Reliable Internet Stream Transport）は、UDPの上でパケットを確実に届ける伝送方式です。届かなかったパケットだけを再送する仕組みで、暗号化と認証、複数経路の利用も備えます。Sergio Ammirataは、その参照実装であるlibristの一年を振り返りました。</p><ul><li>関連リンク：<a href="https://code.videolan.org/rist/librist">librist</a> / <a href="https://www.rist.tv/">RIST Forum</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JXsL57PEgxIVoi0VU0u0mQ.jpeg" /></figure><h4>RISTとlibrist</h4><p>RISTは、放送局や配信事業者が、専用線を使わずに映像をやり取りするために作られました。TCPのようにすべてを再送するのではなく、NACK（受信側が欠けたパケットを通知する仕組み）を使い、足りないパケットだけを要求するため、遅延を抑えながら損失を補えます。libristはBSD 3条項ライセンスで公開され、多くの企業が製品に組み込んでいます。</p><p>この一年で7回のリリースがあり、2.14から2.20になりました。大きな追加は4つです。まず、ブラウザで動くようになりました。ソケットに依存しない伝送APIを用意し、ブラウザの通信機能を差し込めるようにしました。これでWebAssemblyからも利用できます。VLC向けのモジュールもレビュー中で、WebAssembly版のVLCがRISTの配信を再生できるようになります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-bZqgpvBwqjk2tccj4iefg.jpeg" /></figure><h4>新しいプロファイルとセキュリティー</h4><p>次に、プロトコルの新しいプロファイルに対応しました。GRE（トンネル用のプロトコル）によるカプセル化をやめてRTPをそのまま使い、1MHzのクロックで送出のタイミングを細かく制御します。ブラウザにはUDPの分割機能がないため、MTUに合わせた分割と結合も自前で実装しました。</p><p>さらに、セキュリティー機能を強化しました。認証を有効にした場合、通信をつなぎ直すたびに認証のやり直しが必要になります。RISTは、そのような状況でも素早くつなぎ直せます。IPアドレスが変わっても、映像は途切れません。認証の仕組みも新しいものに更新しています。</p><p>最後に、再送の状況を確認できるメトリクスを追加しました。Prometheusでの収集や、トンネル（送受信間の仮想的な伝送路）のステータスレポートにも対応しています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LFlikViGxpZqaN_-Ux7Vg.jpeg" /></figure><p>VLC 3.0.24にはlibristが取り込まれました。WebTransport上のRISTは、標準化のためにVSF（映像伝送の業界団体）へ提案されています。Ammirata自身が仕様策定の委員会に参加しており、新しい標準になる見込みだといいます。</p><h3>LT8 — SRS. Simple Realtime Server</h3><p>by John Xiao（SRS）</p><p>SRSは、MITライセンスで公開されているリアルタイム配信サーバーです。主要な配信プロトコルとコーデックに対応し、Linux、macOS、Windowsで動きます。RISC-VやMIPSを含む幅広いCPUで動くのも特徴です。2013年にWinlinが公開して以来、13年にわたって更新が続いています。</p><ul><li>関連リンク：<a href="https://github.com/ossrs/srs">SRS</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntNKFS8HZsCFcvZ0FwRWDQ.jpeg" /></figure><h4>1台でもクラスターでも動く</h4><p>SRSは、WebRTC、RTMP、SRTで配信を受け、HLS、FLV、RTMP、SRT、WebRTCで視聴者へ届けられます。配信側と視聴側で別のプロトコルを選べ、それぞれの環境に合わせられます。</p><p>1台で動かす場合は、受け取りから配信、録画までを同じサーバーでこなします。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BD2A35iRR4n9eObZIcH6rw.jpeg" /></figure><p>クラスターは2種類あります。多数のストリームを扱うオリジンクラスターでは、各ストリームを1台のオリジンが持ち、エッジはそのサーバーへ取りに行きます。視聴者を増やすエッジクラスターでは、エッジがオリジンから一度だけ受け取り、配下の視聴者へ配ります。2つを組み合わせて、大規模な配信基盤を組めます。</p><p>オリジンは配信元を集め、エッジは視聴者に近い場所で配る役割です。同じソフトウェアで両方を組めるため、小規模な配信から大規模な基盤まで、同じ運用で済みます。</p><p>性能を支えるのが、コルーチンを使ったI/Oライブラリのstate-threadsです。非同期処理を、同期処理のような素直なコードで書けるため、コールバックを積み重ねる必要がありません。</p><h4>これから</h4><p>今後は、低遅延配信のためのMedia over QUIC、AV1などに対応するEnhanced RTMP v2、コンテナ対応を広げるためのFFmpegの活用、複数スレッドへの対応を進める予定だといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMFzvgtw6P_SN5OYv4aPyg.jpeg" /></figure><p>Xiaoは、VLCやFFmpegが音声の分野でそうであるように、配信サーバーの「万能ナイフ」を目指すと述べました。プロトコルが増え続けるなかで、1つのサーバーで受けと配信の両方をこなす立場を保つ考えです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OR3MkJrzgsEhy_el9HjALw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ECiKlP11NTr_ffIafXeag.jpeg" /></figure><p><strong>VDD 2026 Rome レポートを終えるにあたって</strong></p><p>今回VDD 2026 Romeを開催してくれたVideoLANのJean-Baptiste Kempfをはじめ、VideoLANとVideolabsのみなさん、すべての人に素晴らしい機会を提供していただきありがとうございました。</p><p>楽しく思い出深いCommunity Bonding Dayを企画してくれたJulian、そして刺激的なセッションを届けてくれたすべてのスピーカーのみなさんにも感謝しています。</p><p>そして、見事なイベントマネジメントを務めてくれたVibhoothi。世界中から多様なバックグラウンドを持つメンバーが集まるVDDの運営には、長い準備期間と多大な尽力があったことと思います。ダブリン、ロンドンに続いて今回も素晴らしいVDDをありがとう。今年は会えて本当に嬉しかったです！</p><p>素晴らしい会場を提供してくれたローマ・サピエンツァ大学（Sapienza University of Rome）、そしてTokyo Video Techのオーガナイザーにも心より感謝申し上げます。</p><p>最後に、温かい理解とサポートでこの遠征を後押ししてくれた家族や友人たちに感謝します。 KatzよりCoopelのHisashige “Qz” Hashimotoさんへ、TakesatoよりNPAWのLaia Vilagrasa、Brian Pang、Jacky Lawへ、心からの特別な感謝を伝えます。</p><p>たくさんの刺激と出会い、貴重な経験をありがとうございました。VDD 2027への参加を楽しみにしています！😉</p><p>Reported by <a href="https://www.linkedin.com/in/takesato/">Takesato Hayashi</a> &amp; <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48827ea51438" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-ja-48827ea51438">VideoLAN Developer Days 2026 Rome レポート Part 3(ja)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VideoLAN Developer Days 2026 Rome Report Part 2 (en)]]></title>
            <link>https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-2-en-f1948bf93847?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1948bf93847</guid>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[videos]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 06:38:30 GMT</pubDate>
            <atom:updated>2026-10-25T22:03:55.138Z</atom:updated>
            <content:encoded><![CDATA[<h4>Day 2: Conference Day — Opening remarks and 8 presentations covering codecs, AI, and security (Oct 17, 2026)</h4><p>From 16 to 18 October 2026, <a href="https://www.videolan.org/videolan/events/vdd26/">VideoLAN Developer Days 2026 (VDD26)</a> was held at Sapienza University of Rome, Italy. VDD is an open-source multimedia technology conference that VideoLAN holds every autumn, and this was the fifteenth edition. The main conference ran across Saturday and Sunday, with the Friday before serving as a community day, when a game was played on foot around Rome. This report summarises the opening remarks and the eight talks given on the second day, Saturday.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kd7iE7OHZFWVeVxRMpODUQ.jpeg" /></figure><p>Reported by <a href="https://medium.com/@sabaneko">Takesato Hayashi</a> &amp; <a href="https://medium.com/@ksakai">Katz Sakai</a></p><h3>Executive Summary</h3><h4>Opening Remark</h4><ul><li>Jean-Baptiste Kempf gave the opening remarks and looked back on the year’s releases. VLC’s cumulative downloads have passed 7 billion, and a single version is approaching 500 million.</li><li>Security fixes reached about 130 in one release, the largest ever. With C’s lack of memory safety as the backdrop, the issues to fix are expected to keep growing.</li><li>The two big topics of the weekend are Rust and AI. He raised the releases of VLC 4 and dav2d, and support for spatial audio, as the tasks ahead.</li></ul><h4>Session 1 — dav2d</h4><ul><li>Ronald introduced dav2d, the AV2 software decoder. AV2’s new TIP prediction interpolates motion from the surrounding frames to decide the motion for each 8x8 block without coding motion vectors.</li><li>It is currently about four times slower than dav1d, but is expected to improve to about 2.0x with SIMD optimisation of motion-vector resolution and other work.</li><li>He also shared implementation and operational challenges, such as there being no policy yet for accepting AI-generated patches.</li></ul><h4>Session 2 — An Introduction to VMAF v1</h4><ul><li>VMAF, the video quality metric that follows human perception, was revised for the first time in ten years. It improves the blind spots of v0: banding, chroma, and over-prediction on the 5H model.</li><li>Dropping the costly VIF and other changes roughly doubled the speed.</li><li>It adds vmaf_picture_convert, which takes over the image-size conversion users once did themselves, and vmaf_picture_wrap, which skips buffer copies to make multithreading effective, improving usability.</li></ul><h4>Session 3 — Memory safe Media codecs</h4><ul><li>About 70% of high-severity vulnerabilities are memory-safety bugs. Google is pursuing secure-by-design, retrofitting Rust into existing C code.</li><li>On Android, about 50% of new native code is now Rust, and memory-safety vulnerabilities fell from over 70% to below 20%.</li><li>Moving image and compression libraries to Rust also brings speedups. PNG’s zlib was 10% to 15% faster, and parts of libyuv were 20% faster than hand-written assembly.</li></ul><h4>Session 4 — Handling VLC Security Issues with LLMs</h4><ul><li>Thomas automated VLC’s security handling with LLM agents. Fuzzing found one issue in three nights, and static analysis found 22 security problems.</li><li>Triage was automated too, with rules such as never running an attacker’s proof of concept, keeping it safe. It costs 10 to 18 dollars per issue, he said.</li><li>Because access to the strongest AI models is now limited to organisations with red team access, bug reports fell; but when they come, they now come from parties with red team access, he pointed out.</li></ul><h4>Session 5 — An AV1 Encoder in a Day</h4><ul><li>Rafael of Netflix designed an environment with the specification and dav1d as a test oracle, and built an AV1 encoder in a day.</li><li>Rather than instructing the model line by line, he designed the environment and rules and let the AI run autonomously. While verifying output with dav1d, he iterated in a closed loop with no human in the middle.</li><li>The encoder was extended to a shared library, an FFmpeg filter, a CLI and WebAssembly. The six lessons were: find a test oracle, make it observable, take small steps, keep a memory, declare the rules, and make it an autonomous loop.</li></ul><h4>Session 6 — JPEG Overdrive</h4><ul><li>Luc presented an “overfitted JPEG” that brings the idea of neural compression into JPEG. JPEG’s coefficients (DCT coefficients) are re-optimised per image in the manner of neural-net training.</li><li>To obtain gradients, Huffman coding was replaced by a continuous function and quantisation was approximated continuously with detach. Any continuous distortion metric can be used.</li><li>Compared with jpegli, the state-of-the-art JPEG encoder, it achieved Q98-equivalent quality at a bitrate below Q97, about a 12% improvement. The output complies with the JPEG standard, so any JPEG decoder can display it.</li></ul><h4>Session 7 — Regrets eat speed. Fix it, Jarvis!</h4><ul><li>Pascal used AI agents on image and video encoders — sjpeg, WebP and x264 — to try improvements. On sjpeg he achieved about 40%, and 60% in places.</li><li>AI is given the tedious work, while the human decides what to try and how the experiment proceeds. He gave rules such as not taking the AI’s first answer at face value but making it justify itself, and pitting agents against each other.</li><li>From the stance that a document stating the problem and the solution makes code unnecessary, he said, “The prompt is the new code.”</li></ul><h4>Session 8 — IAMF v2</h4><ul><li>IAMF for spatial audio reached version 2. The biggest change is object-based audio, which places each sound source by position, and a standard renderer that defines how it is played back.</li><li>Playback features were enriched too, adding renderer selection, loudness normalisation to even out volume, a profile that can overlay UI sounds, a way to send IAMF over HDMI, and tools to convert from EBU ADM to IAMF.</li><li>FFmpeg does not support IAMF v2 yet, but since it is similar to v1, implementation should not be hard. On the renderer side, libspatialaudio already exists.</li></ul><h3>Opening Remarks</h3><p>by <a href="https://www.linkedin.com/in/jbkempf/">Jean-Baptiste Kempf</a> (<a href="https://www.videolan.org/">VideoLAN</a> President)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RibTdUyOq224QHpOLPhK6A.jpeg" /></figure><p>On the second day, Saturday, the main programme opened with the opening remarks of Jean-Baptiste Kempf (known as jb), who leads VideoLAN. He spoke about the past year’s achievements and the two themes the community would face over the weekend. Here is what he said.</p><p>Over the past year there were many releases across VLC, dav1d, libplacebo, libspatialaudio and other projects. VLC was ported to Vega OS, and FFmpeg reached its 8, 8.1 and 9.0 major releases. VLC 3 is still maintained and even runs on Windows XP. Security fixes, meanwhile, have been growing: a release a month ago carried about 130 fixes, the largest number ever. With C’s lack of memory safety as the backdrop, j-b expects this trend to continue for some time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lewloWQ1YsZEI9pRVVfUGQ.jpeg" /></figure><p>VLC’s cumulative downloads have passed 7 billion, and a single version is approaching 500 million. VLC sends no telemetry, so the real number of users is unknown. Even so, the figures keep accelerating. j-b recalled that ten years ago people said VLC’s usage would decline, and noted that it has not. On iOS, about 100 million people updated VLC in the last six months. The most downloads come from the United States, with India and Nigeria also active. Work has begun to bring content into VLC itself, and the iOS version now supports podcasts, radio and IPTV.</p><p>For dav1d, development is shifting towards its successor, dav2d. The AV2 decoder dav2d became functional five months after the specification was published. Its demo on an iPad was fast and stayed cool. checkasm, split out of dav1d, is now widely used.</p><p>Elsewhere, libudf can now read Windows Server ISOs correctly. libplacebo, libspatialaudio, the .NET binding LibVLCSharp, vlc.js and FFmpeg’s swscale are all active. The audio format IAMF v2 is covered today, and vlc.js tomorrow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtUjtIuWGJmlwbeaaGX5jw.jpeg" /></figure><p>Two big topics run through the event. The first is Rust. As security issues pile up in VLC and FFmpeg, projects that nobody is looking at may simply have problems that have not yet been found. The second is AI: how to use it in development, how to ship AI models inside VLC, and what policy to adopt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8xZB2gOE2PNd0xM0ZWSEQ.jpeg" /></figure><p>Finally, j-b listed VLC 4 and dav2d releases, work on Rust and AI, and support for spatial audio and IAMF v2 as the tasks ahead. This gathering is not an ordinary conference, an academic conference, or a corporate conference, he said. “If you make it cool, it will be cool. If you make it boring, it will be boring. Please don’t make it too boring.”</p><h3><strong>VDD26 Day 2 #2 dav2d</strong></h3><p>by <a href="https://www.twoorioles.com/">Ronald S. Bultje</a> (<a href="https://www.twoorioles.com/">Two Orioles</a> / VideoLAN)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omwThES7_qIcYT_Y99s_Kw.jpeg" /></figure><p>There is still no hardware decoder for AV2. Even once a specification is settled, it takes years before supporting chips reach the market. Software decoders fill that gap. Ronald S. Ronald, who leads the AV2 decoder dav2d, took TIP, one of AV2’s new coding tools, as his thread and revealed the number everyone wanted to know: how much slower is dav2d than dav1d?</p><ul><li>Links: <a href="https://code.videolan.org/videolan/dav2d">dav2d</a> / <a href="https://code.videolan.org/videolan/dav1d">dav1d</a> / <a href="https://www.twoorioles.com/">Two Orioles</a></li></ul><h4>Why AV2 needs a software decoder</h4><p>No AV2 hardware decoder is shipping yet, so dav2d was built as a software decoder to give the format a push. Historically, preparing software first has helped a specification spread. AOMedia announced AV2 in May 2026, and the development team had been preparing a decoder for months beforehand.</p><p>AV2 has many new coding tools that did not exist in AV1. Ronald picked one of them, TIP, and built his talk around it. There is also a mechanism for multiplexing streams on the client side, which suits multi-angle camera feeds and live streaming.</p><h4>AV2’s new prediction, TIP</h4><p>TIP is an inter-frame prediction that works differently from ordinary motion compensation. Block partitioning is the same as in other codecs: a 64x64 superblock is split into smaller blocks. Once you reach a 64x64 block, TIP does not code a single motion vector; it generates a field of motion vectors.</p><p>Let the frame being encoded be frame 1. The key frame before it is frame 0, and the frame after it is frame 2, which is built by referencing frame 0. Frame 2 has a motion vector pointing into frame 0, and frame 1 lies in between. Find where that motion vector crosses frame 1, then interpolate motion vectors from that point back to reference frames 0 and 2, and the motion vectors come for free, with no coding needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dReQci4jGvPFOPVI005CpA.jpeg" /></figure><p>The motion-vector resolution is finer than the block size: inside a 64x64 TIP block, each 8x8 sub-block has its own motion vector. Next comes SAD-based motion-vector refinement at each 8x8. Between the two predictors taken from frames 0 and 2, a motion search shifts the offsets by one and two pixels horizontally and vertically, computes the SAD for 25 positions, and picks the position with the least distortion. Sub-pixel refinement then uses optical flow to find, by regression, the best sub-pixel position. Because each 8x8 ends up with a different motion vector, the picture is blocked along the 8x8 edges, and only then is prediction complete. Ordinary residual coding follows.</p><p>All of this is prescribed by the specification and executed automatically by the decoder. The motion vectors need not be coded and sent; not a single bit is used for this part. Ronald rates TIP as a powerful coding tool. An encoder chooses its coding mode by balancing bits and quality (rate-distortion optimisation). Because TIP gives higher quality for the same number of bits, an encoder using only that criterion will almost always pick TIP. But TIP is far heavier to process than classic motion compensation. The more an encoder picks TIP, the heavier decoding becomes.</p><h4>How much slower than dav1d?</h4><p>dav2d currently takes about four times as long as dav1d. On 720p, 8-bit content, dav1d ran at about 750 frames per second single-threaded and about 1,500 multi-threaded. dav2d runs at around 350 frames per second multi-threaded. That is far above common video frame rates such as 60fps, so it is fast enough in practice.</p><h4>Where the time goes</h4><p>Ronald built a branch that measures which stage the processing time goes into, normalised it by pixel count, and compared it with dav1d. The biggest consumers are motion-vector resolution, intra prediction, inter prediction and post filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4ShydQlbwdr1XrLafhV_w.jpeg" /></figure><p>In motion-vector resolution, dav2d spends the same number of instructions as dav1d and has no SIMD optimisation yet. Optimising here should bring an order-of-magnitude speedup and resolve the problem. In intra prediction, directional interpolation is heavy and likewise not yet optimised. A patch generated by AI has arrived from Meta, which should give a decent speedup, but there is not yet a policy for accepting AI-generated patches. The question is how far to trust thousands of lines of AI-generated assembly.</p><p>In inter prediction, AV2’s newly added prediction tools are heavy. Even with an 8x to 10x SIMD speedup, tools such as TIP still cost five to ten times more per pixel than the classic motion compensation that existed in AV1. Ronald therefore suggests that encoders may need to include decoding cost, not just bits and quality, in the criterion they use to choose a coding mode.</p><p>In post filters, the newly added guided filter is heavy, making processing three times slower.</p><h4>What’s next for dav2d</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njQeGILVxlD3RdyuEBfc4A.jpeg" /></figure><p>The roughly fourfold figure is the current state. Ronald expects it to improve to about 2.0x once motion-vector resolution and other parts are optimised. Beyond that depends on whether encoders use decode-heavy coding methods such as TIP and the guided filter. If encoders can choose low-complexity coding like AV1’s fast mode, it could fall below 2x and approach 1x. Even so, it is expected to cost about 1.5x more than low-complexity AV1. In AV2, since the speed varies widely between coding methods, fast decode has a correspondingly large effect, Ronald said.</p><h3>VDD26 Day 2 #3 VMAF v1</h3><p>by <a href="https://github.com/kylophone">Kyle Swanson</a> (<a href="https://www.netflix.com/">Netflix</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YXsZBMOZbN1-PPUHfY1zg.jpeg" /></figure><p>Quantifying video quality along human perception sounds simple, but it is hard. VMAF has been producing that answer for about ten years. Over that time, however, blind spots had accumulated. Kyle Swanson of Netflix, who has worked on VMAF, told the story of VMAF v1, born from its first revision in a decade.</p><ul><li>Links: <a href="https://github.com/Netflix/vmaf">VMAF</a></li></ul><h4>What VMAF is</h4><p>VMAF is a video quality metric trained to follow human perception. Give it an encoded video and the original video (the reference), and it returns quality as a score from 0 to 100. The higher the value, the higher the quality. VMAF is widely used: to optimise encodes, to evaluate encoding results, and to compute BD-rate with VMAF. It was also used when evaluating the AV2 codec. It can further be used for A/B testing, QoE monitoring and decisions in adaptive streaming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pOFdtXG7A01D8Wn3AVGndg.jpeg" /></figure><p>VMAF assumes a viewing distance in all of its input features. In the 3H and 5H models, the H is the height of the screen. A 1080p screen seen from 3H gives about 60 pixels per degree. Using that value, features are mapped to the contrast sensitivity function. To develop VMAF, the team first computes several quantities (features) that measure degradation from the pixels of the video. Next, they show videos to people in a lab and collect subjective ratings. Using that data, they train a regression model with an SVM to produce the quality score.</p><h4>What v0 overlooked</h4><p>Kyle listed the blind spots VMAF v0 carried.</p><p>The first is the balance between sensitivity to compression and to scaling. In adaptive streaming you choose whether to deliver 1080p or 720p. Plot quality against bitrate (the rate-distortion curves) and the two curves cross at a point. At low bitrates 720p gives the higher quality; at high bitrates 1080p wins. VMAF v0 was less sensitive to compression degradation than to scaling, so the crossover point was off. v1 raises that sensitivity and improves the crossover decision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oE9zxVceoWa8PE_bktyfQQ.jpeg" /></figure><p>The second is banding: a very low-frequency degradation that appears as striped unevenness in gradients. VMAF v0’s features looked at too narrow a range to catch it. v1 detects it with a feature extractor called CAMBI.</p><p>The third is chroma degradation. v0 was a luma-only metric and did not evaluate chroma. Even for a clip badly broken with a chroma QP offset, v0 gives a high score. If you know the metric does not look at chroma, you can find a loophole that sacrifices appearance to earn the score. v1 includes chroma in its evaluation and closes that loophole.</p><p>The fourth is the 5H model for smartphones. v0 tended to over-predict on the 5H model, mapping a 3H score onto 5H, which is not correct from a perceptual standpoint. v1 handles 5H correctly and greatly improves the behaviour.</p><p>These improvements were confirmed not only on lab datasets but on several datasets published by the company, universities and standards bodies. Spearman’s rank correlation coefficient, which shows how closely the ranking of human subjective ratings matches the ranking of VMAF scores, also improved greatly.</p><h4>Swapping out the features VMAF uses</h4><p>VMAF is built from several basic features, and Kyle explained how they changed from v0 to v1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Swjp18oaVYTGq322xTDwMw.jpeg" /></figure><p>DLM(ADM) is a feature that looks at how much fine detail is lost, and is one of the most important in VMAF. In v1 its parameters were slightly adjusted to match human vision. VIF was one of the most costly features in v0, using a filter that looks at a wide range of about 17 pixels across multiple resolutions. But because VIF did not raise VMAF’s evaluation accuracy, v1 removes it. That was a large cost saving. Motion, the only temporal feature, captures motion masking and was kept almost as is, with a small correction.</p><p>Newly added were CAMBI, which catches banding, and a chroma feature. The chroma feature is a published standard measure fine-tuned for VMAF. As a result, the features VMAF v1 uses are ADM, motion, CAMBI and chroma, and VIF is out.</p><h4>New libvmaf APIs and speedups</h4><p>Changes also went into the software implementation, libvmaf.</p><p>vmaf_picture_convert handles the conversion needed when the encoded video and the original video differ in resolution. Comparing a 720p encode with a 4K source requires upscaling the encoded video to 4K. Previously users had to do this themselves with swscale or similar, and the choice of upscaling algorithm changed the VMAF result, a source of confusion. Since upscaling should use the same bicubic as during VMAF’s training, this new API performs the conversion of pixel format (how colour is carried) and bit depth (8-bit or 10-bit) together. The conversion uses a library called zscale, but it is not required: it is an optional build dependency.</p><p>vmaf_picture_wrap lets users use their own buffers instead of copying into VMAF’s internal buffers. It gives a large gain in multithreading, and a patch using it for FFmpeg’s libvmaf filter is ready. It is not a public API, but a mechanism for feature extractors to share processing was also added. Running the standard model (3H) and the full model (5H) at the same time lets them share common computation, giving about a 25% speedup.</p><p>Processing speed is about twice that of v0 as of the published blog post. Most of that comes from dropping VIF, and after the blog it improved by another 25% or so on x86.</p><h4>Summary</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHqj9UKJG2TqaiLgRt6JaQ.jpeg" /></figure><p>v1 is about twice as fast as v0, but ARM SIMD coverage is still thin and there is no CUDA implementation for v1. Gaps remain to be filled. Kyle encouraged the audience to ask about details at the coffee break and closed his talk.</p><h3>VDD26 Day 2 #4 Memory safe Media codecs</h3><p>by <a href="https://lucaversari.it/">Luca Versari</a>, <a href="https://www.linkedin.com/in/bastian-kersting-5a385b1b7/">Bastian Kersting</a> (<a href="https://about.google/">Google</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KBK1Ka0nnKdpLVo61VU6g.jpeg" /></figure><p>About 70% of high-severity vulnerabilities are bugs rooted in memory safety. Exploiting them used to require deep knowledge, but now AI lends a hand. Fixing bugs one by one cannot keep up, so the only way is to make things safe by design. Google chose Rust for that and is working out how to retrofit it into existing C code. The speakers were Bastian Kersting, who works on memory safety in Google’s security team, and Luca Versari, a main developer of the Rust JPEG XL implementation.</p><ul><li>Links: <a href="https://github.com/libjxl/jxl-rs">jxl-rs</a> / <a href="https://www.rust-lang.org/">Rust</a></li></ul><h4>Why Rust</h4><p>Bastian opened by saying the motivation for Rust is fixing security. Not only at Google but in the kernel and in every project written in C or C++, about 70% of high-severity vulnerabilities are memory-safety bugs. High severity means bugs that become the starting point for building a larger exploit chain.</p><p>Exploiting such bugs used to be hard and to require deep knowledge of computers and compilers. Now, however, AI makes that exploitation easy. Even without asking a coding agent, an agent solving a task on the side can find a memory corruption and assemble an attack. There are several ways to respond: fixing bugs one after another, possibly with AI, is one. Bastian’s team aims to retrofit a secure-by-design approach onto existing code and to use Rust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nV3WtZLWW0O6YoA-WIjt9w.jpeg" /></figure><p>The number of vulnerabilities is growing exponentially. The number of known exploited vulnerabilities is also rising, though not as steeply for now. Bastian called out that anyone responsible for security on an open-source project must have a full inbox. He then posed the question: when retrofitting Rust into a large C codebase, does Rust really work? Writing safe Rust prevents memory-safety bugs, but there is a boundary with C code, and retrofitting remains hard.</p><h4>What actually happened on Android</h4><p>As evidence for Rust’s effect, Bastian gave the example of Android. Android added Rust support around 2019, and in 2023 there was a strong push to use Rust for new code. Today about 50% of new native code is Rust. Android was not rewritten, and a great deal of C code remains.</p><p>Memory-safety vulnerabilities, which used to exceed the industry average of 70%, fell sharply after 2023 and are now below 20%. This correlates strongly with how much new memory-unsafe code is written, he said.</p><p>The number of review round-trips also changed. In 2023, especially for large patches, back-and-forth between reviewers and authors increased, thought to be because people were unfamiliar with Rust. As people became used to it, reviews now complete quickly even for large patches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dBB0cPYUjpqkHDNYkHKVUg.jpeg" /></figure><p>Rollback rates are lower for Rust too, and far lower than for C code especially on large patches. Because reviews are quicker and once-merged code is more likely to stay correct, Rust is easier to maintain.</p><h4>Is Rust fast?</h4><p>The next question is whether Rust can be used for parsers and media codecs where performance matters. Over about a year and a half, Bastian’s team compared, across the whole fleet and adjusted for seasonality, the time spent in image and compression libraries between the C and Rust versions.</p><p>Replacing PNG’s zlib gave a 10% to 15% speedup. Parts of libyuv rewritten in Rust were 20% faster than hand-written assembly. In many cases, simply adopting a public Rust library made things faster than the original C implementation. The exception was audio decoding, where Rust was slower; the team optimised FFmpeg’s assembly and is working with FF Labs to feed those optimisations back into the Rust crate.</p><h4>The JPEG XL decoder written in Rust</h4><p>Luca presented the example of a JPEG XL decoder written in Rust. This implementation started being used in Firefox two weeks ago. Luca was deeply involved in the C++ implementation as well, and says it helped to start writing with a clear sense of what was good and bad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5scSuzbP9sehh85upbtOA.jpeg" /></figure><p>The goal is to keep a high standard of memory safety while being as fast as possible. During development, he boasts, not a single memory-safety or undefined-behaviour vulnerability entered the library itself. He added the aside that he did find one in Rust’s standard library.</p><p>Rust has mechanisms for using C features safely. Most intrinsics can be used without unsafe code or extra memory loads. Luca wrote, with generics, an abstraction library that compiles a function for several SIMD targets. It covers SSE4.2 through AVX2 and reaches about 90% of the performance of the target. The code reads like ordinary code and is more readable than assembly, he said. Other libraries that abstract SIMD instructions are also public; Luca chose one that was small and that he could verify himself. This library holds most of the implementation’s unsafe code.</p><p>JPEG XL’s parsing has relatively few unsafe spots. With the right abstractions, almost the whole library can be written as safe code. What remains unsafe is image-buffer handling, type-erased interfaces, and multithreading. JPEG XL does not fix a bit depth for its internal computation and mostly uses floating point. Depending on the image, integers may be better, so the buffer type is not fixed, and an interface that can handle various types is needed. In multithreading, building different parts of the output image at once means Rust’s borrow checker allows only one mutable access, so unsafe code is needed to split the buffer. Elsewhere, a small utility that iterates over slices of equal length with the same stride is written with unsafe because bounds-check alignment does not work well, and a particular predictor contains unsafe only for speed.</p><p>He also checked the generated assembly. The five-tap SAD handling three channels at once is large; written in Rust through the abstraction library, its generated assembly has an inner loop of vector loads and arithmetic, and is not bad. NEON and AVX2 are similar. The previous implementation spilled a lot to the stack, so getting good assembly out of the compiler required adjusting how the code was written.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GEbN-PhInbN1A5qO-w15w.jpeg" /></figure><p>As far as Luca knows, there is no assembly implementation for decoding JPEG XL, so the only comparison is the C++ implementation. jxl-rs has long been faster than the C++ version and recently got faster still. This comparison was measured single-threaded; multi-threaded gives broadly the same result, with jxl-rs faster.</p><p>jxl-rs now ships in Firefox, and PNG’s zlib and parts of libyuv got faster with Rust. Areas that still lag remain, such as audio decoding. Luca invited the audience to ask about details at the coffee break and closed his talk.</p><h3>VDD26 Day 2 #5 Handling VLC Security Issues with LLMs</h3><p>by <a href="https://www.linkedin.com/in/thomasguillem/">Thomas Guillem</a> (<a href="https://www.videolan.org/">VideoLAN</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-f3eo_xub90xfgtysr56dg.jpeg" /></figure><p>If AI makes security problems easier to find, the defenders can use AI too. But the tools are not evenly available. Thomas Guillem of VideoLAN built a system in which LLM agents handle fuzzing and static analysis and even triage the reports that arrive. He told of an RCE case found along the way, and of the present situation in which only the attacking side can use the strongest models.</p><ul><li>Links: <a href="https://www.videolan.org/security/">VideoLAN Security</a></li></ul><h4>What counts as a security issue</h4><p>Thomas began with how to decide what counts as a security issue. The criteria of security researchers and VideoLAN’s judgement do not always agree.</p><p>Even when there is a vulnerability, those that cannot send attacked data back to an external server, or that leak nothing useful, are treated as low impact and not urgent. On the other hand, features with wide configuration that may send data to a server need care, because a leaked address becomes a clue to defeat ASLR and can lead to remote code execution. He also gave a criterion: an issue that works with a single click should be taken more seriously than one needing many UI interactions.</p><h4>How the agents run</h4><p>As an open-source maintainer, Thomas has access to models and approval from his company for security work. The agents run fully autonomously inside rootless Docker, set up so they can proceed without asking a human. From the Docker they can reach a whole toolset including the build system, and parts of the workspace are mounted read-write. They can also reach devices used for crashes and testing, he said.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*htvKzMgQEwloH9nLf-uX7A.jpeg" /></figure><h4>Fuzzing with LLMs</h4><p>The first thing he tried is what Thomas calls “LLM fuzzing”. Google’s OSS-Fuzz finds many security problems, but there is a long wait between a change and its result. So he had an agent run the fuzzing itself.</p><p>He gave the agent OSS-Fuzz’s coverage and told it to look for parts not yet tested; the agent built the dictionary seeds it needed and even created new test harnesses. He ran it overnight, and each time it found a crash it had the agent fix and commit it. In the morning, the git log showed what had been fixed. Run for just three nights on an ordinary desktop, it found one security problem OSS-Fuzz had missed. The token cost was about 13 dollars per issue.</p><h4>Static analysis and triage</h4><p>He tried static analysis too. Starting again from OSS-Fuzz’s coverage and having the agent look for uncovered parts, it began analysing video output, audio output and network code, which are hard to test. It found 22 security problems. This cost 14.5 dollars per issue, using more tokens than the fuzzing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lw7sGIMw3KANAryidxqzZA.jpeg" /></figure><p>Around the time of this work, bug reports surged: 64 since January 2026 and 38 since June of the same year. But only 15 were valid; many were duplicates or not security issues at all. Thomas also had agents triage them. The first rule was never to run the attacker’s proof of concept, because he did not want to break his own machine. Writing a Python script that reproduces a crash and produces a stack trace used to be laborious; the agent now writes it for him, so it is easy. When a mail arrives, he runs the script, and the result is either a proof of concept and a stack trace, or no reproduction. If it does not reproduce, he asks the reporter for more information. He then studies the impact, has the agent draft the vulnerability report, and checks and finishes it himself. Triage costs about 10 to 18 dollars per issue, cheaper than spending half a day on old sample code, he said.</p><h4>The RCE case</h4><p>What was presented is a case that actually led to remote code execution, starting from a bug found in the first LLM assessment two months earlier. Thomas initially overlooked its impact, but the bug had already been fixed on the development branch and the backport to the stable version had been missed. It was a controllable out-of-bounds write in the core’s image allocation, not reachable from every component.</p><p>In August 2026, someone in application security contacted him saying the issue allowed remote code execution. Around the same time two more reports arrived, both controllable out-of-bounds reads that were enough to leak memory addresses to a malicious server. That is material for remote code execution. As a result, the release of VLC 3.0.25 was rushed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUYtzyPI6zjib_X2uuo5zA.jpeg" /></figure><p>Stable releases are normally issued every two to six months, but the previous one took nine months. One reason was that 24 low-impact security fixes had piled up in a private branch. They had not been reviewed by the whole community and their commits conflicted with each other, making them hard to handle. When they were released together, reports and issues rather fell. Keeping things private and piled up was worse than making them public, it turned out. Next time, only major high-security issues will go into a private branch, he said.</p><h4>Why security bug reports fell</h4><p>Since the previous release, bug reports have fallen considerably. Thomas does not think this is because all security issues were fixed. He attributes it to the strongest models from Anthropic and OpenAI having started requiring special “red team access” for offensive work. With only defensive access, he can no longer have agents find exploits.</p><p>On the other hand, this week eight reports arrived from a security team working with Anthropic. It holds offensive access, and three of the eight were not valid. As Thomas had predicted, reports have fallen but, when they come, they come from teams with offensive access. The security fixes to handle have fallen, he summed up, far fewer than when there were 24.</p><p>The talk closed with thanks to François Cartegnie and Steve Liu, who fixed many security issues by human effort.</p><h3>VDD26 Day 2 #6 An AV1 Encoder in a Day</h3><p>by <a href="https://www.linkedin.com/in/rafaelcaricio/">Rafael Caricio</a> (<a href="https://www.netflix.com/">Netflix</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*801GPw4kW7UoyJ1fSUenqA.jpeg" /></figure><p>What happens when a software engineer who is not a video codec expert builds an AV1 encoder in a day? The speaker was Rafael Caricio, who works on the application side of the encoding team at Netflix. His idea is not to have an LLM write code but to design an environment in which the LLM can work well. He spoke about the potential of spec-driven agentic coding.</p><ul><li>Links: <a href="https://github.com/rafaelcaricio/wav1c">wav1c</a>, <a href="https://code.videolan.org/videolan/dav1d">dav1d</a></li></ul><h4>The subject and the approach</h4><p>Rafael is not a video codec expert but an application-side engineer who embeds encoders into higher-level systems and runs them at scale. He was sceptical about LLMs at first, but changed his mind at the end of 2024 and has since run experiments probing their limits.</p><p>He chose an AV1 encoder as his subject: when he thought of doing something he did not know how to do, it seemed the most complex thing he could imagine. He did not use the throw-it-over-the-wall approach of typing “build this” into a prompt and taking whatever code comes out, because earlier experiments had shown it to be bad. Instead of instructing line by line, he focused on building an environment in which the model could do its best.</p><p>He set his own constraints: target AV1, write Safe Rust, have zero dependencies, do not reuse anything existing, and verify with dav1d that the output is really valid AV1. The model he used was Opus 4.6, which was not the newest, so he had to keep the context limit in mind.</p><h4>Building the environment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C4NZ6wHZ0mPWtwCQ9B-rGg.jpeg" /></figure><p>Rafael likened the environment to a greenhouse: plant the seed of the model and let it grow. The key is the information shown to the model and the mechanism for judging it.</p><p>First, he was thorough about not trusting the model’s memory or weights. An LLM is a probabilistic model, and the specification it remembers is not necessarily correct. Rather than rely on memory, it must look up the correct specification on the spot. So he converted the AV1 specification PDF to Markdown and placed it in the environment, and prepared dav1d’s source by cloning it rather than using only the binary. Whether the AI-made encoder works correctly was judged as follows: pass raw frames generated by FFmpeg through the encoder, decode the output with dav1d, and compare it with the original frames.</p><p>He cloned dav1d’s source so the model could add logging and recompile. The binary alone cannot show, through logs, what happens during decoding. He imposed a constraint: only logging may be changed, and the decoding process itself must not be altered. The model adds logs, recompiles, and uses the output as a clue for debugging. This instruction greatly improved development. The crux is not to let the model verify its own code, but to check it against an external test oracle (a basis that supplies the correct answer), dav1d, to confirm whether the output is correct and improving.</p><h4>Phases and rules</h4><p>The encoder was not built in one go; it proceeded in phases. First a minimal frame encoder that produces output, then a solid colour, then different frame sizes, then real complex images, then adding frames and handling motion, in that order. Because the output can be checked on the spot, the agent can iterate quickly.</p><p>He also separated where memory is kept. The context window is limited and cannot be relied on. So the roadmap tracking progress went into a dedicated document, and the rules to follow and the design of the coding pipeline went into CLAUDE.md. The rules were capitalised so the model would surely read them. One of them is “do not stop and ask questions”, because he wanted to let it run while he slept. The model of the time was poor at long tasks, and he sometimes had to check in and let it continue. The condition to move to the next phase was set as: the tests pass and there is an executable that produces output.</p><p>He also made use of Rust’s toolchain. Using Cargo test and Cargo clippy kept the code readable and robust. Rafael likes Rust, and gave as another reason that ownership is local and therefore easy to review later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hDV5i_xYJ2Oz5UDuG38Bw.jpeg" /></figure><p>The loop is: plan, study the specification and dav1d, write the plan into a document, implement, write tests, verify against the test oracle, run and look at errors, add logs and recompile, run again and fix. When everything passes, run Cargo clippy and the tests, commit, and plan the next phase.</p><h4>What the human does and what the model does</h4><p>Rafael’s role was not implementation but the design of the environment. He chose dav1d as a good test oracle, set goals, stacked small phases, and read and reviewed the high-level documents and rules. The model wrote code, wrote tests, instrumented the development as needed, hunted down bugs, and kept notes on what it had implemented.</p><p>As a result, he had something that could encode in AV1. He also implemented it as a shared library, an FFmpeg filter, a shell CLI, and a WebAssembly build. He insisted on zero dependencies and pure Rust because he wanted it to run in the browser. SVT-AV1 depends heavily on threads, so it likely cannot run in the browser as is. Rafael’s implementation is small, and he confirmed it can be decoded on Apple hardware.</p><p>As a use for the encoder he made, Rafael raised rebuilding it per use case with only the needed features. The difference from existing encoders is that you can add and remove features themselves, not merely adjust parameters.</p><h4>Results and lessons</h4><p>Rafael listed six lessons from the experience: find a test oracle, make it observable, take small steps, keep a memory (even with a million-token context, keep it under about 300,000 today), declare the rules, and make it an autonomous loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDjoQsC3FvMqW9Jac0UMgQ.jpeg" /></figure><p>Finally, he encouraged structured experimentation. Many people say LLMs are useless because one prompt did not work, but you can rewrite the prompt as often as you like, and you can even have the LLM write the prompt. Rafael himself used to find LLM completion annoying, but now sees it as a tool to master while staying in control, he said.</p><h3>VDD26 Day 2 #7 JPEG Overdrive</h3><p>by <a href="https://www.linkedin.com/in/luctrudeau/">Luc Trudeau</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0o5TJRq_l61-7FO24aoig.jpeg" /></figure><p>Neural compression is a way of having a neural network learn image compression itself. At the same bitrate it can deliver higher quality than conventional codecs, but encoding takes days. Luc Trudeau wondered whether, borrowing only the idea, he could make existing JPEG better. He built an “overfitted JPEG” that re-optimises JPEG’s coefficients in the manner of neural compression, and presented it at this conference.</p><h4>The idea of overfitted compression</h4><p>“Overfitted compression” is the idea of using neural-compression techniques to build a codec specific to a single image. In ordinary compression, you first predict and then code the difference from the prediction (the residual). Overfitted compression reverses this: first there is a latent (a small piece of data representing the image), which is passed through a neural network to generate the image. In training, backpropagation optimises not just the network’s weights but the latent itself. It is like gradient descent applied directly to the pixels to approach the original image.</p><p>Luc’s idea was to treat JPEG’s DCT coefficients as the latent. Take the coefficients from an existing JPEG and make them the object of optimisation. The quantisation tables are optimised at the same time. Because changing a quantisation table affects every coefficient using that scale, he added a little code to tell PyTorch that relationship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2pNdnz83N604hUFzgyBCWA.jpeg" /></figure><p>The JPEG produced this way complies with the standard. Any JPEG decoder can parse and decode it as is.</p><p>An ordinary JPEG encoder optimises block by block, but here you start from an already-encoded JPEG. The coefficients from a JPEG made by any encoder you like are optimised together, and adjusted to be better across the whole image rather than block by block. Each 8x8 block has a gradient vector that, based on the error function and the rate, indicates where to move. Gradient descent nudges them little by little, repeating several passes for as long as time allows, to reach a global result.</p><h4>A differentiable decoder</h4><p>This method needs a continuous, that is, differentiable, decoder to obtain gradients. In neural-compression research, work is under way to make known algorithms continuous. In JPEG there are two things to replace.</p><p>One is entropy coding by Huffman coding. Choosing a bin is discrete and yields no gradient, so it is replaced by a continuous function that measures the probability over the image. JPEG also has run-length coding and other parts, leaving room to improve the rate function, but for a joke prototype he stopped here, he said.</p><p>The other is quantisation. Forward, it quantises; backward, a detach mechanism converts the same code into a continuous line to approximate the gradient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sojLBPbpovzvFSoKAKoBBw.jpeg" /></figure><p>Being able to treat it as a neural network means the distortion metric can be anything continuous. MSE, LPIPS, SSIM, MS-SSIM and others all have continuous versions available in PyTorch. They can be combined with weights and applied across the whole JPEG.</p><h4>Results</h4><p>The starting point for evaluation was jpegli, a state-of-the-art JPEG encoder. Around Q97 to Q99 it was said to be better than MozJPEG. Each point on the graph is an iteration of the algorithm, and only some of the nearly 1,000 are shown. Luc first said the processing took 29 minutes, but it was actually 13. The pink line connects the candidates with the best trade-off between quality and bitrate, showing the most interesting points. The star is the best result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yzxa2DeAof4ZIbYvt_W36A.jpeg" /></figure><p>The result was Q98-equivalent quality at a bitrate below Q97, about a 12% improvement over the state-of-the-art JPEG encoder. That is the improvement obtained for a single roughly 700x500 image with 10 to 20 minutes of encoding time. Luc said he does not know how long 4K would take, but he does not mind if someone provides the compute.</p><h4>What’s next</h4><p>Luc is developing this as an open-source project and invited anyone interested to join him. Points he wants to improve include the bitrate model and experiments around quality metrics. Because computing metrics is expensive and cannot be run every iteration, he takes only the worst one in an iteration, proceeds for a while, then re-measures.</p><p>He wants encoding faster still, saying it would be fun to process a JPEG in five minutes, or one. Running longer, conversely, gives more improvement.</p><p>JPEG is only the first step. The same idea can extend to other formats. Even picking the slowest encoder and making it slower still, it is faster than neural compression. Borrowing their techniques, we can do the same, was Luc’s argument.</p><h3>VDD26 Day 2 #8 Regrets eat speed. Fix it, Jarvis!</h3><p>by <a href="https://www.linkedin.com/in/pascalmassimino/">Pascal Massimino</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MdOMC6LTlRifxXJRdviwNA.jpeg" /></figure><p>Things you wanted to do but never got around to can be cleared up over a weekend when handed to an AI agent. Pascal Massimino presented experiments in which he turned agents loose on sjpeg, WebP and x264. More than technical detail, the talk focused on the process of working with AI.</p><ul><li>Links: <a href="https://github.com/webmproject/sjpeg">sjpeg</a></li></ul><h4>What he did over the weekend</h4><p>After leaving Google, Pascal decided to hand his mental “things I want to try” list to agents, pointing the direction and letting them do the work.</p><p>The first subject was sjpeg. He threw at the agent things such as a mechanism to adapt the quantisation table to the distribution of the image’s coefficients, a brute-force pass over assembly he had not had time to try, and AVX optimisation. As a result sjpeg became about 40% faster. The SIMD brute force alone earned a lot, reaching 60% in places. After roughly 45 commits, the rest came from adding new algorithms and features. Features he could not add at Google because they called for internal discussion — registering colour-conversion tables, progressive coding, auto-sorting, multithreading, adaptive bias according to image content — he could now try, he said.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lfl72MAXEaoCa2eAMn3ShQ.jpeg" /></figure><h4>Choosing modes with a neural network</h4><p>Next he tackled a small neural network to help choose modes during encoding. He had some unfinished code but found it a chore to start, so he handed it to an agent. It predicts, block by block, the mode likely to be good next from the given context, and was implemented as a new option with a neural-network contribution adjustable from 0 to 10.</p><p>Where perfect decisions would give up to 40% speedup, the neural network narrows the candidates to about four and applies full RDO only to that short list; on WebP this gave about 15% speedup in exchange for a slightly worse bitrate. It fills the gap left by the existing effort option and lets the speed-quality trade-off be chosen more finely. The implementation is a tiny two-layer neural network written in C or assembly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPEcr-1crQGYsMrek_dUsA.jpeg" /></figure><p>He extended the same approach to x264. Starting with pure intra, the MLP-based shortlisting first gave good results. But inter prediction, and especially each channel, got worse and did not work. Most of the time goes to motion estimation, which is hard to predict. In x264’s slowest placebo preset, reference frames are all tried in turn; having the neural network decide where to cut off (whether to stop after the first five or look as far as 15) can save a little time. Judging P-frames had some effect, but the speed-quality trade-off did not improve. On slow settings, using AI fully gave worse results than the conventional approach, and he admitted the experiment failed. It works for P-intra, but not when there are P-frames or B-frames. It was cheap, though, and fun, he added.</p><h4>AI is an assistant, not the lead</h4><p>Here is the main point. Pascal is clear that he uses AI as an assistant. He has it clear away the tedious work he does not want to do: fixing datasets, preparing samples, instrumenting libraries, running scripts, measuring. He himself makes only the decisions, gives instructions, and comes back about an hour later to check the results. In contrast to Rafael Rafael’s approach of leaving things to a closed loop, Pascal’s stance is that he wants to hold the start and the end, and the tiresome parts of the experiment, himself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CJYnBw_7bukiECG2Z0MkLA.jpeg" /></figure><p>Preparing datasets was delegated too. He had it gather the needed numbers of videos and images and had a multimodal agent read their contents, evening out the corpus by classifying things as outdoor, a web page, and so on. Once, when he dumped only realistic photos, it lacked diversity and got stuck. Ensuring diversity and automatic evening-out also helped suppress overfitting.</p><p>Instrumentation brought a lesson. If the encoder does not do exhaustive search, some modes go unused, and you cannot learn from what is not there. So he deliberately ran a slow, classic full search to try every mode and reworked the logging to feed training. He instrumented x264 and WebP to emit decisions as text or JSON for training data.</p><p>Measurement, too, falls into a trap if the agent is left alone. The agent first only compared with the original and said “it is better because the file is smaller”. It was not checking quality, so it was not clear whether it was really better. Pascal had to guide it to check that.</p><p>He also revisited the design of the input (the context) given to the neural network. The input was set to four pixels on the border outside the coding block, but by studying statistically how each input was used he found a bias in which the pixel at the top right, useful for diagonal prediction, went unused while DC values were chosen, and he adjusted the shape of the context to spread the prediction. He also experimented with replacing the three-layer network with a single approximation applied to features such as SAD and bit counts instead of pixels. In some cases that gave better results.</p><p>He says it is good to ask the agent hard questions: did you try everything, what is the worst image, what looks unnatural, find the best and the worst. Have it confirm that the feature you wrote is really used and tested. How you frame the questions matters.</p><h4>Rules for steering the agent</h4><p>Pascal listed a few of his own rules. The first answer is always wrong, so have the agent justify itself and ask whether the number is real. Pit multiple agents against each other; he has Claude and Copilot compete, and after both have answered he looks at the code and iterates. Do not rely on a single agent, he says.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WoXGAGUuvlN5qFjq4hq6NQ.jpeg" /></figure><p>Hold the question and the direction yourself. Left alone, the agent explores every possibility like all of Wikipedia. Specify the hardware and constraints in detail. When he had it change the network’s layer structure and size, it started trying every combination, so he told it to calm down, he said.</p><p>Keep sessions short, restart frequently, and keep the context small — around 100K — while still logging everything so failed experiments can be searched later. This also helps when writing slides.</p><p>He said, “The prompt is the new code.” If you have a document that precisely states the problem and the solution, you do not need the code itself. Using AI, he says, is like the difference between breadth-first search and A*. You do not just let it explore everything; guide it and you reach the solution faster.</p><h3>VDD26 Day 2 #9 IAMF v2 – The nearest sound might be behind you</h3><p>by Thomas Daede (<a href="https://www.videolan.org/">VideoLAN</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vX93ioOb7YQ3GZWFqw7PuA.jpeg" /></figure><p>IAMF is a royalty-free format for spatial audio. A little over two years after its first version in 2023, version 2 has arrived. The speaker was Thomas Daede of VideoLAN. He introduced the addition of object-based audio and the changes reflecting what implementers asked for.</p><ul><li>Links: <a href="https://aomediacodec.github.io/iamf/">IAMF</a> / <a href="https://github.com/videolan/libspatialaudio">libspatialaudio</a></li></ul><h4>What IAMF is</h4><p>IAMF is a royalty-free format for spatial audio, aiming to replace existing royalty-free methods and proprietary formats that carry royalties. For example, there is Opus multichannel for high channel counts and Opus Ambisonics for storing a 3D sound field and rendering it to speakers later, but both had limitations.</p><p>Opus multichannel has no standard way to downmix to smaller speaker layouts. Since listening in practice is centred on 5.1 and 2.0, they wanted control over that. Opus Ambisonics has no equivalent lossless compression for multichannel, and they also wanted something that works on many existing devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zgY1ia9ezK0jFtm-wZgH6Q.jpeg" /></figure><p>Another option is EBU ADM, but it is not a delivery format. It is a collection of XML and WAV files, good for authoring and as an intermediate format, but not something you send to a phone.</p><p>IAMF has a structure of a container nested inside ISO BMFF, holding mono and stereo audio streams internally. The streams can use Opus, AAC LC (now royalty-free), PCM or FLAC. Everything else is built from these mono and stereo streams.</p><p>Version 1 combined a parser defined by the specification, an external encoder handling the audio codec, and a mixer. You could define, per audio stream, how to mix to 5.1 or 2.0, guaranteeing the sound plays the same way in any environment. Version 1 was trimmed to only the features needed to ship it first.</p><h4>Object-based audio</h4><p>The biggest addition in version 2 is object-based audio. It was set aside in version 1 because it had many drawbacks. First, to play object-based audio you need a renderer that follows the specification (the process that distributes sound to each speaker). Second, it is sensitive to rendering conditions. Third, representing the surrounding environment in sound is hard, and much more metadata is needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2F1Dz8qMelUsPaZcVbjVjQ.jpeg" /></figure><p>There are advantages, too. A strongly directional point source is easier to make than with Ambisonics. Ambisonics needs a high-order representation, whereas object-based audio needs only one channel to make a point source. There are also many authoring tools built around object-based audio, and demand from producers was strong.</p><p>Version 2 adopted it, but new challenges arise. You must send the XYZ coordinates of the sound sources, render them, and the data rate becomes significant.</p><h4>Changes from v1</h4><p>The data structure changed too. In version 1 each sub-stream held audio samples, and the parameter values attached to them had the same length: a 20-millisecond block carried 20 milliseconds’ worth of parameter values. In version 2 the parameter values span several audio blocks. They considered spanning several ISO BMFF samples as well, but that requires audio keyframes, an awkward concept they avoided. Instead they made the ISO BMFF samples themselves larger: one sample holds 100 milliseconds of audio instead of 20.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LsfHolSUor7-qoSZIA-dQ.jpeg" /></figure><p>A default renderer was added too. The standard renderer is standardised separately from IAMF itself, in AOM, for reasons of how standardisation proceeded. IAMF specifies which renderer to use through metadata. You can name a specific renderer or leave it to a compatible renderer such as libspatialaudio. Because this specification is defined as a dedicated field in the data format, renderers can be added later.</p><p>For loudness, a default control method and a mechanism to apply normalisation to the output were added. A profile was added too, allowing PCM and a compressed format to be combined, answering a demand to overlay system UI sounds onto an IAMF stream. The channel-count limit was raised and the combinations of rendering widened.</p><p>An HDMI mapping was added, so IAMF can be sent over HDMI. It is better than the old AC3 mechanism and can send lossless or lossy, but HDMI has a bandwidth limit, so the stream must fit within it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLW_Gd7WiVkWsFz_v6d95A.jpeg" /></figure><h4>New implementations</h4><p>Version 1’s big weakness was that there was no reference encoder, hence no tool to produce bitstreams. There were simple tools to make reference streams, but they were not usable by end users.</p><p>What fills that gap is a new IAMF tools repository. You can author in EBU ADM and convert it to an IAMF file. It can also be embedded in commercial workstation tools. FFmpeg has no implementation yet, but since it is similar to the version 1 implementation, it should not be too hard. On the renderer side, libspatialaudio already exists. The question is how far implementations will spread.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wu-CWgzqyMkkgz5yjc_8Jg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLrEG7T8vAbiHdWRih0XUA.jpeg" /></figure><p><strong>To be continued in Part 3&lt;</strong><a href="https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-en-baf2a528d152">https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-en-baf2a528d152</a><strong>&gt;</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1948bf93847" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-2-en-f1948bf93847">VideoLAN Developer Days 2026 Rome Report Part 2 (en)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VideoLAN Developer Days 2026 Rome レポート Part 2(ja)]]></title>
            <link>https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-2-ja-f5df29d5741f?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5df29d5741f</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[videos]]></category>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[streaming]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 06:37:51 GMT</pubDate>
            <atom:updated>2026-10-25T22:08:06.403Z</atom:updated>
            <content:encoded><![CDATA[<h4>Day 2: Conference Day: 開幕挨拶と、コーデック、AI、セキュリティをめぐる8件の発表 Oct 17, 2026</h4><p>2026年10月16日から18日まで、イタリア・ローマのサピエンツァ大学で、<a href="https://www.videolan.org/videolan/events/vdd26/">VideoLAN Developer Days 2026（VDD26）</a>が開催されました。VDDはVideoLANが毎年秋に開くオープンソースのマルチメディア技術の会議で、今回で15回目です。会議の中心は土曜と日曜の2日間で、前日の金曜はコミュニティデイとして、ローマの街を歩くゲームが行われました。本レポートでは、会期2日目にあたる土曜日に行われた開幕挨拶と8件の発表の要点をお伝えします。（文中敬称略）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kd7iE7OHZFWVeVxRMpODUQ.jpeg" /></figure><p>Reported by <a href="https://medium.com/@sabaneko">Takesato Hayashi</a> &amp; <a href="https://medium.com/@ksakai">Katz Sakai</a></p><h3>エグゼクティブサマリー</h3><h4>Opening Remark</h4><ul><li>Jean-Baptiste Kempfが開幕挨拶に立ち、この1年のリリースを振り返りました。VLCの累計ダウンロードは70億回を超え、単一バージョンでも5億回に迫ります。</li><li>セキュリティ修正は1回のリリースで約130件と、過去最大になりました。C言語の安全性を背景に、修正すべき問題は今後も増え続ける見通しです。</li><li>週末の大きな議題はRustとAIです。VLC 4とdav2dのリリース、空間オーディオへの対応を、これからの作業として掲げました。</li></ul><h4>Session 1 — dav2d</h4><ul><li>AV2のソフトウェアデコーダーdav2dを紹介しました。AV2の新しい予測TIPは、前後のフレームから動きを補間して、動きベクトルを符号化せずに8x8ブロックごとの動きを決めます。</li><li>現状はdav1d比で約4倍遅いものの、動きベクトル解決のSIMD最適化などで2.0倍程度まで改善する見込みです。</li><li>AIが生成したパッチを受け入れる方針がまだないことなど、実装と運用の課題も共有しました。</li></ul><h4>Session 2 — An Introduction to VMAF v1</h4><ul><li>人の知覚を追う映像品質指標VMAFが10年ぶりに改訂されました。v0の死角だったバンディング、クロマ、5Hモデルの過大予測を改善しています。</li><li>高コストなVIFを削除するなどして、約2倍の高速化を果たしました。</li><li>利用者が自分で行っていた画像サイズ変換を肩代わりするvmaf_picture_convertや、バッファーのコピーを省いてマルチスレッドを効かせるvmaf_picture_wrapを追加し、使い勝手も改善しています。</li></ul><h4>Session 3 — Memory safe Media codecs</h4><ul><li>高深刻度の脆弱性のおよそ7割はメモリー安全性バグです。Googleは既存のCコードへRustを後付けするsecure-by-designを進めています。</li><li>Androidでは新しいネイティブコードの約50%がRustになり、メモリー安全脆弱性は70%超から20%未満へ下がりました。</li><li>画像や圧縮のライブラリーではRust移行が高速化にもつながります。PNGのzlibは10%から15%、libyuvの一部は手書きアセンブリより20%高速でした。</li></ul><h4>Session 4 — Handling VLC Security Issues with LLMs</h4><ul><li>GuillemがLLMエージェントでVLCのセキュリティ対応を自動化しました。ファジングは3晩で1件、静的解析では22件のセキュリティ問題を発見しています。</li><li>トリアージもエージェント化し、攻撃者のproof of conceptを実行しないなどのルールで安全性を確保しました。1件あたり10ドルから18ドルで済むといいます。</li><li>最強のAIモデルへのアクセスはred team accessを持っている組織に制限されたことでバグ報告は減りましたが、届くときはred team accessを持つ主体から届くという構図を指摘しました。</li></ul><h4>Session 5 — An AV1 Encoder in a Day</h4><ul><li>NetflixのCaricioが、仕様書とdav1dをテストオラクルに据えて環境を設計し、1日でAV1エンコーダーを作りました。</li><li>モデルに一行ずつ指示するのではなく、環境とルールを設計してAIを自律的に動かすようにしました。出力をdav1dで検証しながら、人間が介在しない閉じたループで試行錯誤を繰り返しました。</li><li>作ったエンコーダーは、共有ライブラリー、FFmpegフィルター、CLI、WebAssemblyへと広げました。教訓は、テストオラクルを見つけること、観測可能にすること、小さく進めること、記憶を残すこと、規則を宣言すること、自律したループにすることの6点です。</li></ul><h4>Session 6 — JPEG Overdrive</h4><ul><li>Trudeauが、ニューラル圧縮の考え方をJPEGへ持ち込む「過適合JPEG」を披露しました。JPEGの係数（DCT係数）を、ニューラルネットの学習の要領で画像ごとに最適化し直します。</li><li>勾配を取るために、ハフマン符号化を連続関数へ、量子化をdetachで連続近似しました。歪み指標は連続であれば何でも使えます。</li><li>最先端のJPEGエンコーダーであるjpegliと比べて、Q97未満のビットレートでQ98相当、およそ12%の改善を実現しました。出力はJPEG規格に準拠しているため、どんなJPEGデコーダーでも表示できます。</li></ul><h4>Session 7 — Regrets eat speed. Fix it, Jarvis!</h4><ul><li>Massiminoは、sjpeg、WebP、x264といった画像や動画のエンコーダーにAIエージェントを使い改良を試みました。sjpegではおよそ40%、場所によっては60%の高速化ができました。</li><li>AIには退屈な作業を任せ、何を試すかや実験の進め方は人間が決めます。AIからの最初の答えを鵜呑みにせず根拠を突き詰めさせる、エージェント同士を戦わせるなどのルールを示しました。</li><li>問題と解決を書いた文書があればコードは要らないという立場から、「プロンプトは新しいコードだ」と述べました。</li></ul><h4>Session 8 — IAMF v2</h4><ul><li>空間オーディオのIAMFがバージョン2になりました。いちばん大きな変更点は、音源ごとに位置を指定するオブジェクトベース音声と、その再生方法を規格で定めた標準レンダラーです。</li><li>再生まわりも充実しました。使うレンダラーの指定、音量を揃えるラウドネス正規化、UI音を重ねられるプロファイル、IAMFをHDMIで送る仕組み、EBU ADMからIAMFへ変換するツールなどを追加しています。</li><li>FFmpegはまだIAMF v2に対応していませんが、v1と似ているため実装は難しくない見込みです。レンダラー側は、libspatialaudioがすでにあります。</li></ul><h3><strong>VDD26 Day 2 #1 Opening Remarks</strong></h3><p>by <a href="https://www.linkedin.com/in/jbkempf/">Jean-Baptiste Kempf</a>（<a href="https://www.videolan.org/">VideoLAN</a> President）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RibTdUyOq224QHpOLPhK6A.jpeg" /></figure><p>会期2日目にあたる土曜日、本編はVideoLANを代表するJean-Baptiste Kempf（以降jb）の開幕挨拶で始まりました。この1年の成果と、これから向き合う2つのテーマが語られています。以下、その内容を紹介します。</p><p>この1年、VLCやdav1d、libplacebo、libspatialaudioなどで多数のリリースがありました。VLCはVega OSへ移植され、FFmpegも8系、8.1、9.0のメジャーリリースを迎えています。VLC 3は今なお保守が続き、Windows XPでも動作します。一方でセキュリティ修正は増えており、1か月前のリリースには約130件の修正が入り、過去最大になりました。C言語の安全性を背景に、この傾向はすぐには収まらないとjbは見ています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lewloWQ1YsZEI9pRVVfUGQ.jpeg" /></figure><p>VLCの累計ダウンロードは70億回を超え、単一バージョンでも5億回に迫ります。VLCはテレメトリーを送らないため、実際の利用者数は分かりません。それでも数字は加速しています。10年前に「VLCの利用は減っていく」と言われたことをjbは振り返り、そうはなっていないと述べました。iOSでは直近6か月で約1億人がVLCを更新しました。ダウンロードが多いのは米国で、インドとナイジェリアも活発です。VLCにコンテンツを取り込む取り組みも始まっており、iOS版はポッドキャスト、ラジオ、IPTVに対応しました。</p><p>dav1dは、開発の中心が後継のdav2dへ移りつつあります。AV2のdav2dは仕様公開から5か月で動作するようになりました。iPadでのデモは高速で、発熱も抑えられていました。dav1dから切り出されたcheckasmは、広く使われています。</p><p>そのほか、libudfがWindows ServerのISOを正しく読めるようになりました。libplacebo、libspatialaudio、.NETバインディングのLibVLCSharp、vlc.js、FFmpegのswscaleなども活発です。音声形式IAMFのv2は今日、vlc.jsは明日の発表で取り上げられます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtUjtIuWGJmlwbeaaGX5jw.jpeg" /></figure><p>この会期中の大きな議題は2つあります。1つはRustです。VLCやFFmpegにセキュリティ問題が積み上がるなか、誰も見ていないプロジェクトでは、問題が見つかっていないだけかもしれません。もう1つはAIです。AIをどう開発に使い、AIモデルをVLCにどう載せ、どんな方針を取るかが議題になります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8xZB2gOE2PNd0xM0ZWSEQ.jpeg" /></figure><p>最後にjbは、VLC 4とdav2dのリリース、RustとAIへの取り組み、空間オーディオやIAMF v2への対応を、これからの作業として挙げました。この集まりは通常のカンファレンスでも、学術会議でも企業の会議でもありません。「面白くしようとすれば面白くなるし、退屈にすれば退屈になる。あまり退屈にしないでほしい」と締めくくりました。</p><h3>VDD26 Day 2 #2 dav2d</h3><p>by <a href="https://www.twoorioles.com/">Ronald S. Bultje</a>（<a href="https://www.twoorioles.com/">Two Orioles</a> / VideoLAN）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omwThES7_qIcYT_Y99s_Kw.jpeg" /></figure><p>AV2のハードウェアデコーダーは、まだ存在しません。規格が決まっても、対応するチップが世に出るまでには年単位の時間がかかります。その空白を埋めるのがソフトウェアデコーダーです。AV2デコーダーdav2dを率いたRonald S. Bultjeは、AV2の新しい予測方式TIPを軸に、いちばん気になる数字を明かしました。dav2dは、dav1dよりどれくらい遅いのか。</p><ul><li>関連リンク：<a href="https://code.videolan.org/videolan/dav2d">dav2d</a> / <a href="https://code.videolan.org/videolan/dav1d">dav1d</a> / <a href="https://www.twoorioles.com/">Two Orioles</a></li></ul><h4>AV2のソフトウェアデコーダーが必要な理由</h4><p>AV2のハードウェアデコーダーはまだ出回っていません。そこで、AV2の利用を後押しするソフトウェアデコーダーとしてdav2dが作られました。いままでも、ソフトウェアを先に用意することで、規格の普及を促してきました。AOMediaがAV2を発表したのは2026年5月です。開発チームはその数か月前からデコーダーの準備に動いていました。</p><p>AV2には、AV1になかった新しい符号化ツールがいくつも入っています。Bultjeは、その1つであるTIPを軸に話を進めました。ほかにも、クライアント側でストリームを多重化できる仕組みがあり、マルチアングルのカメラ映像やライブ配信と相性がよいといいます。</p><h4>AV2の新しい予測、TIP</h4><p>TIPは、通常の動き補償とは異なるフレーム間予測です。ブロック分割は他のコーデックと同じで、64x64のスーパーブロックを小さなブロックへ分割します。64x64のブロックにたどり着くと、TIPは動きベクトルを1つ符号化するのではなく、動きベクトルの場を作ります。</p><p>符号化するフレームをフレーム1とします。その前のキーフレームがフレーム0、後ろが、フレーム0を参照して作られるフレーム2です。フレーム2はフレーム0を指す動きベクトルを持ち、フレーム1はその途中にあります。この動きベクトルがフレーム1と交わる点を求め、そこから参照フレーム0と2へ向けて補間すれば、動きベクトルが自動的に手に入ります。符号化は不要です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dReQci4jGvPFOPVI005CpA.jpeg" /></figure><p>動きベクトルの解像度は、ブロックの大きさより細かくなります。64x64のTIPブロックの内部でも、8x8のサブブロックがそれぞれ動きベクトルを持ちます。続いて、8x8ごとにSADベースの動きベクトル精緻化を行います。フレーム0と2から得た2つの予測子の間で、縦横に1画素と2画素のオフセットを動かして動き探索をかけます。25通りの位置についてSADを計算し、ひずみが最小の位置を選びます。次に、サブピクセル精緻化としてオプティカルフローを使い、最適なサブピクセル位置を回帰で求めます。8x8ごとに動きベクトルが異なるため、8x8の境界でブロック化し、ここで予測が完了します。その後に通常の残差符号化が続きます。</p><p>ここまでのTIPの処理はすべて規格で定められた手順で、デコーダーが自動的に実行します。動きベクトルを符号化して送る必要はなく、この部分では1ビットも使われません。Bultje氏はTIPを強力な符号化ツールだと評します。エンコーダーは、ビット数と画質のバランス（レートひずみ最適化）で符号化方式を選びます。TIPは同じビット数でより高い画質を出せるため、この基準だけでは、ほぼ必ずTIPが選ばれます。ところが、TIPは古典的な動き補償にくらべて処理がはるかに重い。エンコーダーがTIPを選ぶほど、デコード側の負荷も上がります。</p><h4>dav1dとくらべてどれくらい遅いか</h4><p>現時点のdav2dはdav1dの約4倍処理に時間がかかります。720p、8ビットのコンテンツで、dav1dはシングルスレッドが毎秒約750フレーム、マルチスレッドが約1500フレームでした。dav2dはマルチスレッドで毎秒350フレーム前後です。一般的な動画のフレームレート（60fpsなど）を大きく上回るため、実用上は十分な速度だといいます。</p><h4>遅さの内訳</h4><p>Bultjeは、処理時間がどの段階に費やされているかを計測するブランチを作り、画素数で正規化してdav1dと比べました。時間を食っているのは、モーションベクトル、イントラ予測、フレーム間予測、ポストフィルターです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4ShydQlbwdr1XrLafhV_w.jpeg" /></figure><p>モーションベクトルでは、dav2dはdav1dと同じ命令数を費やしており、SIMD最適化がまだ入っていません。ここを最適化すれば一桁速くなり、問題は解消する見込みです。イントラ予測では方向性補間が重く、こちらも最適化が未着手です。MetaからAIが生成したパッチが届いており、それなりの高速化が見込めます。ただ、AIが生成したパッチを受け入れる方針がまだありません。つまり、AI生成の数千行のアセンブリコードをどこまで信頼するか、ということです。</p><p>フレーム間予測では、AV2で新しく加わった予測方式の処理が重くなっています。TIPなどの新しい方式は、SIMDで8倍から10倍速くしても、画素あたりではAV1からある古典的な動き補償の5倍から10倍のコストがかかります。そこでBultje氏は、エンコーダーが符号化方式を選ぶ基準に、ビット数と画質だけでなくデコード処理の重さも加えるべきかもしれない、と指摘します。</p><p>ポストフィルターでは、新しく加わったguided filterが重く、処理が3倍遅くなっています。</p><h4>dav2dのこれから</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njQeGILVxlD3RdyuEBfc4A.jpeg" /></figure><p>約4倍という数字は現状のものです。モーションベクトルの最適化などが進めば、2.0倍程度まで改善するとBultjeは見ています。そこから先は、TIPやguided filterのようにデコード負荷の大きいエンコード手法をエンコーダーが使うかどうかによります。AV1のfastモードのように低複雑度な符号化をエンコーダーが選べば、2倍を下回って1倍に近づく可能性もあります。ただし、それでも低複雑度のAV1よりは1.5倍程度は高くつく見通しです。なお、AV2ではエンコード手法ごとの速度差が大きいぶん、fastデコードの効果も大きいとBultjeは述べました。</p><h3>VDD26 Day 2 <strong>#3 VMAF v1</strong></h3><p>by Kyle Swanson（<a href="https://www.netflix.com/">Netflix</a>）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YXsZBMOZbN1-PPUHfY1zg.jpeg" /></figure><p>動画の品質を、人の知覚に沿って数値化する。簡単そうに聞こえて、これは難しい。VMAFは公開からおよそ10年、その答えを出し続けてきた指標です。ですが、その間に積み上がった死角がありました。10年ぶりの改訂で生まれたVMAF v1について、開発に携わってきたNetflixのKyle Swansonが語りました。</p><ul><li>関連リンク：<a href="https://github.com/Netflix/vmaf">VMAF</a></li></ul><h4>VMAFとは</h4><p>VMAFは、人の知覚を追うように訓練された映像品質の指標です。エンコードした映像と元の映像（参照映像）を渡すと、品質を0から100までのスコアで返します。値が大きいほど高品質です。VMAFの用途は広く、エンコードの最適化や、エンコード結果の評価、VMAFを用いたBDレートの算出に使われます。また、AV2のコーデックを評価したときにも使われました。A/BテストやQoEのモニタリング、アダプティブストリーミングの配信判断にも利用できます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pOFdtXG7A01D8Wn3AVGndg.jpeg" /></figure><p>VMAFは、すべての入力特徴量で視距離を仮定しています。3Hモデルや5Hモデルと呼ばれるときのHは、画面の高さのことです。1080pの画面を3Hの距離から見ると、およそ60画素毎度になります。この値を基準に、特徴量をコントラスト感度関数へ対応づけます。VMAFの開発では、まず、映像の画素から劣化の度合いを測る量（特徴量）をいくつか計算します。次に、実験室で人に映像を見せて主観評価を集めます。そしてそれらデータを使って、SVMで回帰モデルを訓練することで品質スコアを算出させるようにします。</p><h4>v0が見落としていたもの</h4><p>Swansonは、VMAF v0が抱えていた死角を挙げました。</p><p>1つ目は、圧縮とスケーリングのどちらに敏感か、というバランスです。アダプティブストリーミングでは、1080pと720pのどちらを配信するかを選びます。ビットレートごとの画質（レートひずみ曲線）を描くと、2本の曲線はある点で交わります。低いビットレートでは720pのほうが高画質で、高いビットレートでは1080pが勝ちます。VMAF v0は、スケーリングに比べて圧縮による劣化への感度が低く、交点の位置がずれていました。v1はその感度を高め、交点の判断を改善しています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oE9zxVceoWa8PE_bktyfQQ.jpeg" /></figure><p>2つ目はバンディングです。グラデーションに縞状のムラが出る、周波数のとても低い劣化のことです。VMAF v0の特徴量は対象とする範囲が狭すぎて、これを捉えられませんでした。v1はCAMBIという特徴抽出器で検出します。</p><p>3つ目はクロマの劣化です。v0は輝度だけを見る指標で、クロマの劣化は評価していませんでした。クロマのQPオフセットで大きく崩したクリップでも、v0は高スコアを付けます。指標がクロマを見ていないと分かっていれば、見た目を犠牲にしてスコアだけを稼ぐ、という抜け道ができてしまいます。v1はクロマも評価に入れ、この抜け道をふさぎました。</p><p>4つ目はスマートフォン向けの5Hモデルです。v0は5Hモデルの予測を過大に出しがちで、3Hのスコアを5Hへ写像するという、知覚の観点から正しくない処理をしていました。v1では5Hを正しく扱い、挙動が大きく改善しました。</p><p>こうした改善は、実験室のデータセットだけでなく、社内や大学、標準化団体などが公開した複数のデータセットで確認しています。人の主観評価とVMAFのスコアの順位がどれだけ一致するかを示す、スピアマンの順位相関係数も大きく向上しました。</p><h4>VMAFが利用する特徴量の入れ替え</h4><p>VMAFはいくつかの基本的な特徴量で構成されており、Swansonはv0からv1でのその入れ替えを説明しました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Swjp18oaVYTGq322xTDwMw.jpeg" /></figure><p>DLM(ADM)は、映像の細部がどれだけ失われたかを見る、VMAFでもとくに重要な特徴量です。v1では、人間の視覚に合わせてパラメーターを少し調整しました。VIFはv0でもっともコストの高い特徴量の1つで、17画素ぶんという広い範囲を見るフィルターを複数の解像度で使う特徴量でした。しかし、VIFを使ってもVMAFの評価精度を上げないため、v1ではVIFを削除しました。これが大きなコスト削減になりました。唯一の時間方向の特徴量であるmotionは、動きマスキングを捉えるもので、小さな修正を加えてほぼそのまま残しています。</p><p>新しく加えたのが、バンディングを捉えるCAMBIと、クロマ向けの特徴量です。クロマ向けの特徴量は、公開されている標準的な指標をVMAF向けに微調整したものです。結果として、VMAF v1が利用する特徴量はADM、motion、CAMBI、クロマとなり、VIFは外れました。</p><h4>libvmafの新APIと高速化</h4><p>ソフトウェア実装であるlibvmafにも変更が入りました。</p><p>vmaf_picture_convertは、エンコードした映像と元の映像で解像度が違うときの変換を担います。720pのエンコードを4Kのソースと比較するには、エンコードした映像を4Kへアップスケールする必要があります。これまではVMAFの利用者がswscaleなどで自分で行うしかなく、どのアップスケーリングアルゴリズムを使うかでVMAF結果が変わるため混乱の元でした。アップスケーリングにはVMAFの学習時と同じバイキュービックを使うのが望ましいため、この新規追加したAPIでは、画素形式（色の持ち方）とビット深度（8ビットか10ビットか）の変換をまとめて行います。変換にはzscaleというライブラリを使いますが、必須ではなく、ビルド時に任意で有効にする依存です。</p><p>vmaf_picture_wrapは、VMAF内部のバッファーへコピーする代わりに、利用者のバッファーをそのまま使えるようにするAPIです。マルチスレッドで大きな効果があり、FFmpegのlibvmafフィルター向けにこれを使うパッチも用意されています。公開APIではありませんが、特徴抽出器どうしで処理を共有する仕組みも加えました。標準モデル（3H）とフルモデル（5H）を同時に使うと、共通する計算を共有でき、25%ほどの高速化になります。</p><p>処理速度は、公開したブログの時点でv0の約2倍です。大半はVIFの削除によるもので、ブログ公開後さらにx86で25%ほど改善しました。</p><h4>まとめ</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHqj9UKJG2TqaiLgRt6JaQ.jpeg" /></figure><p>v1はv0のおよそ2倍になりましたが、ARMのSIMD対応はまだ十分でなく、v1向けのCUDA実装もありません。埋めるべき穴は残っています。Swansonは、細かい話はコーヒーブレイクで、と会場に呼びかけて発表を終えました。</p><h3>VDD26 Day 2 #4 Memory safe Media codecs</h3><p>by Luca Versari, Bastian Kersting（<a href="https://about.google/">Google</a>）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KBK1Ka0nnKdpLVo61VU6g.jpeg" /></figure><p>高深刻度の脆弱性のおよそ7割は、メモリー安全性に起因するバグです。かつてこれを突くには深い知識が要りましたが、いまはAIがその手助けをします。バグを1つずつ潰すだけでは追いつきません。ならば、設計から安全にするしかない。Googleはその手段にRustを選び、既存のCコードへどう組み込むかを試しています。登壇したのは、Googleセキュリティチームでメモリー安全性に取り組むBastian Kerstingと、RustによるJPEG XL実装の主要な開発者であるLuca Versariです。</p><ul><li>関連リンク：<a href="https://github.com/libjxl/jxl-rs">jxl-rs</a> / <a href="https://www.rust-lang.org/">Rust</a></li></ul><h4>なぜRustか</h4><p>Kerstingは、Rust採用の動機はセキュリティ修正にあると切り出しました。Googleに限らず、カーネルやC、C++で書かれたあらゆるプロジェクトで、高深刻度の脆弱性のおよそ70%はメモリー安全性のバグです。高深刻度とは、より大きな攻撃チェーンを組み立てる出発点になるようなバグを指します。</p><p>以前はこうしたバグの悪用が難しく、コンピューターやコンパイラーの深い知識が必要でした。ところが今は、AIがその悪用を容易にします。コーディングエージェントに頼まなくても、あるタスクを解かせている横でメモリー破壊を見つけ、攻撃を組み立ててしまうことがあります。直す方法はいくつかあります。バグを片端から潰していくのも1つで、AIを使って進めることもできます。Kerstingのチームが目指すのは、既存のコードにsecure-by-designの考え方を後付けし、Rustを使うことです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nV3WtZLWW0O6YoA-WIjt9w.jpeg" /></figure><p>脆弱性の数は指数関数的に増えています。すでに悪用が確認されている脆弱性も増えてはいますが、いまのところそこまで急ではありません。Kerstingは、オープンソースプロジェクトのセキュリティ担当者ならメールの受信箱が埋まっているはずだと呼びかけました。そのうえで、大きなCのコードベースにRustを組み込むとき、Rustは本当に効くのかという問いを立てました。安全なRustを書けばメモリー安全性のバグは防げますが、Cコードとの境界があり、後付けの難しさも残ります。</p><h4>Androidで実際にどうなったか</h4><p>Rustの効果を示すデータとして、KerstingはAndroidの例を挙げました。Androidは2019年ごろにRustのサポートを追加し、2023年には新しいコードでRustを使う強い後押しがありました。いまでは新しいネイティブコードのおよそ50%がRustです。Androidが書き直されたわけではなく、いまも大量のCコードが残っています。</p><p>メモリー安全性の脆弱性は、導入前は業界平均の70%を上回っていました。2023年を境に急速に下がり、いまでは20%を切っています。これは、新しく書かれるメモリー安全でないコードの量と強く相関しているといいます。</p><p>レビューの往復回数も変化しました。2023年は、とくに大きなパッチでレビュアーと作者のやり取りが増えました。それはRustに不慣れだったためと考えられます。時間が経つにつれ慣れが進み、いまでは大きなパッチでもレビューが短時間で済むようになりました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dBB0cPYUjpqkHDNYkHKVUg.jpeg" /></figure><p>ロールバック率もRustのほうが低く、とくに大きなパッチではCのコードよりはるかに少なくなっています。レビューに時間がかからず、いったん入ったコードが正しく残りやすいぶん、Rustは保守しやすいということになります。</p><h4>Rustは速いのか</h4><p>性能が重視されるパーサやメディアコーデックでRustが使えるのかが、次の問いです。Kerstingのチームは1年半ほど、画像や圧縮のライブラリーを対象に、C版とRust版でライブラリーに費やした時間をフリート全体で比較し、季節変動をならして計測してきました。</p><p>PNGのzlibを置き換えたところ、10%から15%の高速化が見られました。libyuvの一部をRustで書き直したものは、手書きのアセンブリより20%速くなっています。多くの場合、公開されているRustのライブラリーを導入するだけで、Cで書かれた元の実装より速くなりました。例外は音声デコードで、Rustのほうが遅かったため、FFmpegのアセンブリを最適化し、その最適化をRustクレートへ戻す取り組みをFF Labsと進めています。</p><h4>Rustで書いたJPEG XLデコーダー</h4><p>Versariは、RustによるJPEG XLデコーダーの例を紹介しました。この実装は2週間前にFirefoxで使われるようになったばかりです。VersariはC++版の実装にも深く関わっており、何がよく何が悪いかを分かったうえで書き始められたことが助けになったといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5scSuzbP9sehh85upbtOA.jpeg" /></figure><p>目標は、メモリー安全性の高い基準を保ちながら、できるだけ速くすることです。開発のあいだ、ライブラリー自体にメモリー安全性や未定義動作の脆弱性は一度も入らなかったと胸を張りました。ただし、Rustの標準ライブラリー側で1件見つけてしまった、という余談も添えました。</p><p>Rustには、安全にCの機能を使うための仕組みがあります。ほとんどの組み込み命令は、unsafeなコードや余分なメモリー読み込みなしに使えます。Versariは、ある関数を複数のSIMDターゲット向けにコンパイルする抽象ライブラリーを、ジェネリクスで書きました。SSE4.2からAVX2まで対応でき、対象ターゲットの9割ほどの性能に届きます。コードは通常のコードのように読め、アセンブリよりは読みやすいと述べました。同じようにSIMD命令を抽象化するライブラリーは、ほかにも公開されています。Versariはそのなかから、小さく自分で検証できるものを選びました。このライブラリーには、実装の大部分のunsafeコードが集まっています。</p><p>JPEG XLのパース処理には、unsafeな箇所はそれほど多くありません。適切な抽象を用意すれば、ライブラリーのほとんどを安全なコードとして書けます。unsafeが残るのは、画像バッファーの扱い、型を消したインターフェイス、そしてマルチスレッドのためです。JPEG XLの内部計算はビット深度を固定しておらず、ほとんどは浮動小数点で行います。画像によっては整数のほうが適する場面もあり、扱うバッファーの型が一定しません。そのため、さまざまな型を扱えるインターフェイスが必要になります。マルチスレッドでは、出力画像の異なる部分を同時に作ろうとすると、Rustの借用チェッカーが可変アクセスを1つに制限するため、バッファーを分割するunsafeが必要になります。ほかには、同じ長さの複数のスライスを同じ歩幅で反復する小さなユーティリティも、境界チェックの整列がうまくいかないためunsafeで書き、特定の予測器も高速化のためだけにunsafeを含みます。</p><p>生成されるアセンブリも確認しました。3チャンネルを同時に扱う5タップのSADは大きく、抽象ライブラリー経由のRustで書いたものの、生成されるアセンブリは内側のループがベクトルの読み込みと演算の繰り返しになっており、悪くない出来です。NEONやAVX2でも同様です。以前の実装はスタックへの退避が多く、コンパイラーによいアセンブリを出させるには、コードの書き方を工夫する必要がありました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GEbN-PhInbN1A5qO-w15w.jpeg" /></figure><p>JPEG XLをデコードするアセンブリ実装はVersariの知る限り存在しないため、比較対象はC++実装だけです。jxl-rsは以前からC++版より速く、最近またさらに速くなりました。この比較はシングルスレッドのデコードで測ったものです。マルチスレッドでも、jxl-rsが速いという結果は概ね同じです。</p><p>jxl-rsはFirefoxに載り、PNGのzlibやlibyuvの一部はRustで速くなりました。音声デコードのように、まだ後れを取る領域も残っています。Versariは、細かい話はコーヒーブレイクで、と会場に呼びかけて発表を終えました。</p><h3>VDD26 Day 2 #5 Handling VLC Security Issues with LLMs, Including an RCE Case Study</h3><p>by Thomas Guillem（<a href="https://www.videolan.org/">VideoLAN</a>）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-f3eo_xub90xfgtysr56dg.jpeg" /></figure><p>AIがセキュリティ問題を見つけやすくするなら、防御側もAIを使えばよい。ですが、その手段は対等には使えません。VideoLANのThomas Guillemは、LLMエージェントにファジングと静的解析を任せ、届いた報告のトリアージまでこなす仕組みを作りました。その取り組みのなかで見つかったリモートコード実行の事例と、強いモデルを使えるのが攻撃側に限られるようになった現在の状況を語っています。</p><ul><li>関連リンク：<a href="https://www.videolan.org/security/">VideoLAN Security</a></li></ul><h4>何をセキュリティ問題として扱うか</h4><p>Guillemはまず、何をセキュリティ問題として扱うかの判断から始めました。一般的なセキュリティ研究者の基準と、VideoLANの判断は必ずしも一致しません。</p><p>脆弱性があっても、攻撃者が得たデータを外部のサーバーへ送り返せないものや、有用な情報が漏れないものは、影響が小さく緊急性も低いとみなします。一方で、設定の幅が広く、データをサーバーへ送り得る機能は注意が必要です。アドレスが漏れればASLRを破る手がかりになり、リモートコード実行につながるからです。クリック1回で成立する問題は、多くのUI操作を要する問題より重く扱うべきだという基準も示しました。</p><h4>AIエージェントをどう動かすか</h4><p>Guillemは、オープンソースのメンテナーとしてモデルへのアクセスを得て、会社からもセキュリティ作業の承認を受けています。エージェントはrootless Dockerの中で完全に自律させ、人間に確認を求めずに作業を進められるようにしています。Dockerからはビルドシステムを含むツール一式に触れられ、ワークスペースの一部を読み書き可でマウントしています。クラッシュやテストに使うためのデバイスにもアクセスできるようにしているといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*htvKzMgQEwloH9nLf-uX7A.jpeg" /></figure><h4>LLMによるファジング</h4><p>最初に試したのが、Guillemが「LLMファジング」と呼ぶものです。GoogleのOSS-Fuzzは多くのセキュリティ問題を見つけますが、修正と結果のあいだに長く待つ必要があります。そこで、ファジングそのものをエージェントに走らせることにしました。</p><p>エージェントにOSS-Fuzzのカバレッジを渡し、まだテストが及んでいない部分を探すよう指示すると、必要な辞書のシードを自分で作り、新しいテストハーネスも作成しました。それを夜通し走らせ、クラッシュを見つけるたびに修正してコミットさせます。翌朝には、git logを見れば何を直したか分かります。普通のデスクトップで3晩走らせただけで、OSS-Fuzzが見つけられなかったセキュリティ問題を1件見つけました。1件あたりのトークン代はおよそ13ドルでした。</p><h4>静的解析とトリアージ</h4><p>静的な解析も試しました。同じくOSS-Fuzzのカバレッジから始め、カバレッジが及んでいない部分を探させると、テストが難しい映像出力、音声出力、ネットワークのコードを解析し始めました。結果として22件のセキュリティ問題が見つかりました。こちらは1件あたり14.5ドルで、ファジングより多くのトークンを使いました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lw7sGIMw3KANAryidxqzZA.jpeg" /></figure><p>ちょうどこの作業をしていた時期に、バグレポートが急増します。2026年1月以降で64件、同年6月以降で38件です。しかし報告のうち有効だったのは15件だけで、多くは重複か、そもそもセキュリティ問題ではないものでした。<br>Guillemはトリアージもエージェントに任せるようにしました。最初のルールは、攻撃者のproof of conceptを決して実行しないことです。自分のマシンを壊したくないからです。クラッシュを再現してスタックトレースを出すPythonスクリプトを書くのは、以前は手間のかかる作業でした。エージェントがそれを代わりに書いてくれるので、いまは簡単です。メールを受け取ったらスクリプトを走らせ、proof of conceptとスタックトレースが得られるか、再現しないかのどちらかになります。再現しなければバグレポーターに追加情報を求めます。その後に影響を調べ、エージェントに脆弱性レポートの下書きを作らせ、Guillem自身が確認して手で仕上げます。トリアージは1件あたり10ドルから18ドル程度で、古いサンプルコードを半日かけて調べるより安く済むと述べました。</p><h4>RCEの事例</h4><p>紹介されたのは、実際にリモートコード実行につながった事例です。発端は、2か月前の最初のLLM評価で見つかったバグでした。Guillemは当初その影響を見落としていましたが、そのバグは開発ブランチではすでに修正済みで、安定版へのバックポートが漏れていました。コアの画像確保処理に関わる、制御可能な範囲のout-of-bounds writeで、すべてのコンポーネントから到達できるわけではありませんでした。</p><p>2026年8月に、アプリケーションセキュリティの担当者から、この問題でリモートコード実行が可能だという連絡が届きます。同じ時期に2件の報告も届いており、いずれも制御可能なout-of-bounds readで、悪意あるサーバーへメモリーアドレスを漏らすのに十分なものでした。これはリモートコード実行の材料になります。これを受けて、VLC 3.0.25のリリースを急ぐことになりました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUYtzyPI6zjib_X2uuo5zA.jpeg" /></figure><p>通常、安定版は2か月から6か月ごとに出す方針ですが、前回は9か月かかりました。その一因は、低影響のセキュリティ修正24件を非公開ブランチにため込んでいたことです。それらはコミュニティ全体のレビューを受けておらず、互いにコミットが衝突して、扱いに困っていました。そこでそれらをまとめて公開したところ、報告とissueはむしろ減りました。非公開でため込むより、公開したほうがよいということでした。次回は、非公開ブランチに置くのは大きな高セキュリティの問題だけにする予定だといいます。</p><h4>セキュリティーバグ報告が減った理由</h4><p>前回のリリース以降、バグ報告はかなり減りました。Guillemは、報告が減ったのはセキュリティ問題をすべて直したからだとは考えていません。理由として挙げたのは、AnthropicやOpenAIの最強のモデルが、攻撃的な作業には「red team access」と呼ばれる特別なアクセスを要求するようになったことです。Guillemは防御側のアクセスしか持たないため、エージェントでexploitを見つけることができなくなりました。</p><p>その一方で今週、Anthropicと協力するセキュリティチームから8件の報告が届きました。攻撃側のアクセスを持つチームで、8件のうち3件は有効ではありませんでした。Guillemの見立てどおり、報告は減ったものの、届くときは攻撃側のアクセスを持つチームから届いています。対応すべきセキュリティ修正は減ったものの、24件を抱えていたときよりはるかに少ないとまとめました。</p><p>発表は、人間の力で多くのセキュリティ問題を修正してきたFrançois CartegnieとSteve Liuへの感謝で締めくくられました。</p><h3>VDD26 Day 2 #6 An AV1 Encoder in a Day</h3><p>by Rafael Caricio（<a href="https://www.netflix.com/">Netflix</a>）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*801GPw4kW7UoyJ1fSUenqA.jpeg" /></figure><p>動画コーデックの専門家でもないソフトウェアエンジニアが、AV1エンコーダーを1日で作ったらどうなるか。登壇したのは、Netflixのエンコードチームでアプリケーション側を担うRafael Caricioです。LLMにコードを書かせるのではなく、LLMが動きやすい環境を設計するという考え方で、仕様に基づくエージェントコーディングの可能性を語りました。</p><ul><li>関連リンク：<a href="https://github.com/rafaelcaricio/wav1c">wav1c</a>, <a href="https://code.videolan.org/videolan/dav1d">dav1d</a></li></ul><h4>題材と方針</h4><p>Caricioは、動画コーデックの専門家ではなく、エンコーダーを上位の仕組みに組み込んで大規模に動かす、応用側のエンジニアです。以前はLLMに懐疑的でしたが、2024年末に考えが変わり、その限界を探る実験を重ねてきました。</p><p>題材に選んだのはAV1エンコーダーです。自分が知らないことをやろうと考えたときに、もっとも複雑だと思えたものだからです。プロンプトに「これを作って」とだけ投げてコードを出させる、いわゆる丸投げの使い方はしません。以前の実験で良くないと分かっていたからです。代わりに、一行ずつ指示するのではなく、モデルが力を発揮できる環境を作ることに集中しました。</p><p>制約も自分で決めました。AV1を対象にすること、Safe Rustで書くこと、依存をゼロにすること、既存のものを流用しないこと、そしてdav1dでデコードして本当に有効なAV1であることを確かめることです。使ったモデルはOpus 4.6で、最新ではなかったためコンテキストの上限も意識する必要がありました。</p><h4>環境を作る</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C4NZ6wHZ0mPWtwCQ9B-rGg.jpeg" /></figure><p>Caricioは、環境を温室にたとえました。モデルという種を植え、育つように仕向けます。鍵になるのが、モデルに見せる情報と、判定の仕組みです。</p><p>まず、モデルの記憶や重みを信用しないことを徹底しました。LLMは確率的なモデルで、覚えている仕様が正しいとは限りません。記憶に頼らず、正しい仕様をその場で参照させる必要があります。そこでAV1の仕様書のPDFをMarkdownへ変換して環境に置き、dav1dのソースコードもバイナリだけでなくcloneして用意しました。AIが作ったエンコーダーが正しく動くかどうかは、次のように判定しました。FFmpegが生成した生のフレームをエンコーダーに通し、その出力をdav1dでデコードして、元のフレームと比べます。</p><p>dav1dのソースをcloneしたのは、モデルがログを足して再コンパイルできるようにするためです。バイナリだけでは、デコードの途中経過をログで確かめられません。変えてよいのはログ出力だけで、デコードの処理そのものは変えてはならない、という制約は付けました。ログを足して再コンパイルし、その出力を手がかりにデバッグします。この指示が開発を大きく改善しました。肝心なのは、モデル自身に自分のコードを検証させず、外部のdav1dというテストオラクル（正解を教えてくれる基準）に当てて、出力が正しいか、良くなっているかを確かめることです。</p><h4>フェーズとルール</h4><p>エンコーダーは一気に作らず、フェーズに分けて進めました。まず最小限に動いて出力を生むフレームエンコーダー、次に単色、別々のフレームサイズ、実際の複雑な画像、その後にフレームを増やし、動きを扱う、という順序です。出力が正しいかをその場で確かめられるため、エージェントは素早く試行錯誤を繰り返せます。</p><p>記憶の置き場所も分けました。コンテキストウィンドウは限られていて、あてにできません。そこで、作業の進行を追うロードマップは専用の文書に、守るべき規則とコーディングのパイプラインの設計はCLAUDE.mdにまとめました。規則は大文字にして、モデルが確実に読むようにしました。そのひとつが「止まって質問しない」です。寝ている間に動かし続けたかったからです。当時のモデルは長時間のタスクが苦手で、ときどき様子を見て続行させる必要もありました。次のフェーズへ進む条件は、テストが通っていること、出力を生む実行ファイルがあることとしました。</p><p>Rustのツールチェーンも活かしました。Cargo testやCargo clippyを使い、コードを読める状態で堅牢に保ちます。CaricioはRustを好んでおり、所有権の扱いが局所的なので後からレビューしやすいことも理由に挙げました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hDV5i_xYJ2Oz5UDuG38Bw.jpeg" /></figure><p>ループは、計画し、仕様とdav1dを調べ、計画を文書にし、実装し、テストを書き、テストオラクルに当てて検証し、実行してエラーを見て、ログを足して再コンパイルし、また実行して直す、という流れです。すべて通ればCargo clippyとテストを通してコミットし、次のフェーズを計画します。</p><h4>何を人がやり、何をモデルがやるか</h4><p>Caricioが担ったのは、実装ではなく環境の設計です。良いテストオラクルであるdav1dを選び、目標を定め、小さなフェーズを重ね、高レベルの文書と規則を読んでレビューしました。モデルはコードを書き、テストを書き、必要に応じて開発を計装し、バグを突き止め、何を実装したかをノートに記録しました。</p><p>成果として、AV1でエンコードできるものになりました。さらに共有ライブラリー、FFmpegフィルター、シェルのCLI、そしてWebAssemblyへのコンパイルまで実装しています。依存をゼロにして純粋なRustにこだわったのは、ブラウザーで動かしたかったからです。SVT-AV1はスレッドに強く依存するため、そのままではブラウザーで動かせないと考えられます。Caricioの実装は小さく、Appleのハードウェアでもデコードできることを確認しました。</p><p>Caricioは、こうして作成したエンコーダーの使い道として、用途ごとに必要な機能だけを残して作り直すことを挙げました。既存のエンコーダーのようにパラメーターを調整するだけでなく、機能そのものを足し引きできるのが違いです。</p><h4>成果と教訓</h4><p>Caricioは、この経験から得た6つの教訓を挙げました。テストオラクルを見つけること、それを観測可能にすること、小さく進めること、記憶を残すこと（100万トークンのコンテキストがあっても、いまは30万以下に抑えるのがよい）、規則を宣言すること、そして自律したループにすることです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDjoQsC3FvMqW9Jac0UMgQ.jpeg" /></figure><p>最後にCaricioは、構造化して試すことを勧めました。「頼んでもうまくいかないから役に立たない」と言う人は多いものの、プロンプトは何度でも書き直せますし、LLM自身にプロンプトを書かせることもできます。Caricio氏自身も、以前はLLMの補完を邪魔に感じていましたが、制御を保ちながら使いこなすツールだと捉え直したと語りました。</p><h3>VDD26 Day 2 #7 JPEG Overdrive</h3><p>by Luc Trudeau</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0o5TJRq_l61-7FO24aoig.jpeg" /></figure><p>ニューラル圧縮とは、ニューラルネットに画像の圧縮そのものを学習させる方式です。同じビットレートなら、従来のコーデックより高い画質を出せますが、エンコードに何日もかかります。登壇したLuc Trudeauは、その考え方だけを借りて、既存のJPEGをもっと良くできないかと考えました。JPEGの係数をニューラル圧縮の要領で最適化し直す「過適合JPEG」を、この会議で披露しました。</p><h4>過適合圧縮という発想</h4><p>「過適合圧縮」は、ニューラル圧縮の技術で1枚の画像専用のコーデックを作る考え方です。通常の圧縮では、まず予測し、その予測との差（残差）を符号化します。過適合圧縮はこれを逆にして、まず潜在表現（画像を表す小さなデータ）を用意し、それをニューラルネットに通して画像を生成します。学習の逆伝播では、ネットワークの重みだけでなく、その潜在表現そのものも最適化します。画素を直接調整して元の画像に近づける、勾配降下のような作業です。</p><p>そこでTrudeauが思いついたのが、JPEGのDCT係数を潜在表現とみなす方法でした。既存のJPEGから係数を取り出し、それを最適化の対象にします。量子化テーブルも同時に最適化します。量子化テーブルを変えると、そのスケールを使うすべての係数に影響するため、PyTorchにその関係を伝えるコードを少し加えました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2pNdnz83N604hUFzgyBCWA.jpeg" /></figure><p>この方法で得られるJPEGは、規格に準拠しています。どんなJPEGデコーダーでも、そのまま解析してデコードできます。</p><p>通常のJPEGエンコーダーはブロックごとに最適化しますが、ここではすでにエンコード済みのJPEGから始めます。好みのエンコーダーで作ったJPEGの係数をすべてまとめて最適化し、ブロック単位ではなく画像全体で見て良くなるように調整します。8x8ブロックごとに勾配のベクトルを持ち、誤差関数とレートに基づいて、どこへ動かせばよいかを示します。勾配降下がそれらを少しずつ動かし、複数回のパスを、時間の許すかぎり繰り返して、大域的な結果を得ます。</p><h4>微分可能なデコーダー</h4><p>この手法には、勾配を取り出すための連続的、つまり微分可能なデコーダーが必要です。ニューラル圧縮の研究では、既知のアルゴリズムを連続化する取り組みが進んでいます。JPEGで置き換えるべきものは2つあります。</p><p>1つはハフマン符号化によるエントロピー符号化です。ビンを選ぶ操作は離散的で、勾配が取れません。そこで、画像上での確率を測る連続関数に置き換えます。JPEGにはランレングス符号化などもあり、より良いレート関数に改善できる余地はありますが、冗談のための試作としてはここまでにしたといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sojLBPbpovzvFSoKAKoBBw.jpeg" /></figure><p>もう1つは量子化です。順方向では量子化を行い、逆伝播のときにはdetachの仕組みで、同じコードを連続的な直線へ変換し、勾配の近似を得ます。</p><p>ニューラルネットとして扱えるおかげで、歪み指標は連続であれば何でも選べます。MSEやLPIPS、SSIM、MS-SSIMなど、多くの指標に連続版があり、PyTorchにも揃っています。これらを重み付きで組み合わせ、JPEG全体に対して適用できます。</p><h4>結果</h4><p>評価の出発点には、最先端のJPEGエンコーダーであるjpegliを使いました。Q97からQ99あたりで、MozJPEGより良い結果だったとしています。グラフの各点はアルゴリズムの反復で、1000回近くあるうちの一部だけが示されています。Trudeauは最初に処理時間を29分と言いましたが、実際には13分でした。ピンクの線は、画質とビットレートのトレードオフが最良になる候補を結んだもので、もっとも興味深い点を示します。星印が最良の結果です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yzxa2DeAof4ZIbYvt_W36A.jpeg" /></figure><p>結果として、Q97を下回るビットレートでQ98相当の品質が得られ、最先端のJPEGエンコーダーからおよそ12%の改善になりました。これは、700x500ほどの画像1枚に対して、10分から20分のエンコード時間をかければ得られる改善です。4Kでどれくらいかかるかは分からないが、計算資源を出してくれるなら構わない、とTrudeauは述べました。</p><h4>これから</h4><p>Trudeauはこの取り組みをオープンソースのプロジェクトとして進めており、興味があれば一緒にやろうと呼びかけました。改善したい点として、ビットレートモデルの改良、品質指標まわりの実験を挙げています。指標の計算は高コストで毎回は回せないため、その反復ではもっとも悪いものだけを取り、しばらく進めてから測り直す、といった工夫をしているといいます。</p><p>エンコードはさらに速くしたいとして、JPEG1枚を5分や1分で処理できたらおもしろいと述べました。逆に長く回せば、より多くの改善が得られます。</p><p>JPEGは最初の一歩にすぎません。同じ考え方は他のフォーマットにも広げられます。もっとも遅いエンコーダーを選んでさらに遅くしても、ニューラル圧縮よりはまだ速い。彼らの技術を借りて、こちらも同じことができる、というのがTrudeauの主張です。</p><h3>VDD26 Day 2 #8 Regrets eat speed. Fix it, Jarvis!</h3><p>by Pascal Massimino</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MdOMC6LTlRifxXJRdviwNA.jpeg" /></figure><p>「いつかやりたい」と思いながら手を付けられなかったことが、AIエージェントに任せると週末で片付いてしまう。登壇したPascal Massiminoは、sjpegやWebP、x264にエージェントを投入した実験を紹介しました。技術の細部よりも、AIとどう働くかというプロセスに焦点を当てた発表です。</p><ul><li>関連リンク：<a href="https://github.com/webmproject/sjpeg">sjpeg</a></li></ul><h4>週末にやったこと</h4><p>Massiminoは、Googleを離れてから、頭の中にあった「試したいことリスト」をエージェントに任せてみることにしました。自分は方向を示すだけにして、あとは手を動かさせる、という進め方です。</p><p>最初の題材はsjpegです。画像の係数の分布に応じて量子化テーブルを適応的に変える仕組み、時間がなくて試せなかったアセンブリの総当たり、AVXの最適化などをエージェントに投げました。結果としてsjpegをおよそ40%の高速化できました。SIMDの総当たりだけで大きく稼ぎ、部分によっては60%に達しています。45回ほどのコミットで、残りは新しいアルゴリズムや機能の追加によるものです。色変換のテーブルを登録する処理、プログレッシブ符号化、自動ソート、マルチスレッド、画像内容に応じた適応バイアスなど、Googleにいたときは社内で議論を呼ぶため入れられなかった機能も、いまは試せたといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lfl72MAXEaoCa2eAMn3ShQ.jpeg" /></figure><h4>ニューラルネットでモード選択</h4><p>次に取り組んだのが、エンコード時のモード選択を助ける小さなニューラルネットです。書きかけのコードはあったものの、着手するのが面倒だったため、エージェントに投げました。ブロックごとに、与えられた文脈から次に使うとよさそうなモードを予測する仕組みで、ニューラルネットの寄与を0から10まで調整できる新しいオプションとして実装されました。</p><p>完璧な判断ができるなら最大40%の高速化が見込めるところ、ニューラルネットが候補を4つほどに絞り込み、その短いリストだけに本格的なRDOを適用する方式で、WebPではビットレートが多少悪くなる代わりに、15%ほど速くなりました。既存のeffort指定のオプションが埋められていなかった隙間を埋め、速度と品質のトレードオフをより細かく選べるようにします。実装は2層のごく小さなニューラルネットで、Cかアセンブリで書かれています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPEcr-1crQGYsMrek_dUsA.jpeg" /></figure><p>同じやり方をx264にも広げました。まず純粋なイントラから始めると、同じようにMLPで候補を絞る方式が最初は良い結果を出しました。ところがフレーム間予測、とくに各チャンネルで悪化し、うまくいきませんでした。時間の大半は動き推定が占め、これは予測が難しいためです。x264のもっとも遅いplaceboプリセットでは、参照フレームを順にすべて試します。どこで打ち切るか（最初の5つで止めるか、15まで見るか）をニューラルネットに判断させれば、少し時間を稼げます。Pフレームの判断でも多少の効果はありましたが、速度と品質のトレードオフは改善しませんでした。遅い設定では、MassiminoがAIを全面的に使うより、従来のほうが良い結果になり、失敗した実験だったと認めています。P-intraには使えますが、PフレームやBフレームがあると機能しません。ただし、安く済んだので楽しめたとも述べました。</p><h4>AIは助手であって主体ではない</h4><p>ここからが本題です。Massiminoは、AIを助手として使うと割り切っています。データセットの修正、サンプルの用意、ライブラリーの計装、スクリプトの実行、測定といった、自分がやりたくない退屈な作業を片付けさせます。Massimino自身は判断だけを担い、指示を出したら1時間ほどして戻って結果を確認します。Rafael Caricioの閉じたループに任せるやり方とは対照的に、始まりと終わり、そして実験の面倒な部分は自分で握りたい、というのがMassiminoの立場です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CJYnBw_7bukiECG2Z0MkLA.jpeg" /></figure><p>データセットの用意も任せました。必要な本数の動画や画像を集めさせ、マルチモーダルのエージェントに中身を読ませて、屋外か、ウェブページかといった分類でコーパスを均等に整えます。一度、写実的な写真だけをまとめて流し込んだところ、多様性を欠いて行き詰まりました。多様性の確保と自動的な均等化は、過学習の抑制にも効きました。</p><p>計装には反省もあります。エンコーダーで網羅的な探索をしていないと、使われなかったモードがあり、存在しないものからは学べません。そこで、あえて遅い古典的な全探索を回してすべてのモードを試し、ログを取って学習に使えるようにし直しました。x264やWebPに出力を仕込み、決定の入力をテキストやJSONで吐き出させ、学習データにします。</p><p>測定も、エージェントを放っておくと罠にはまります。エージェントは、まず元画像と比べて「ファイルが小さいから良い」と言うだけでした。画質を確かめておらず、本当に良いのかは分かりません。そこでMassiminoは、そこを確かめるようエージェントを導く必要がありました。</p><p>ニューラルネットに与える入力（文脈）の設計も見直しました。ニューラルネットの入力は符号化ブロックの外側の境界4画素としたものの、各入力の使われ方を統計で調べ、対角予測で効く右上の画素が使われずDC値ばかり選ばれる偏りを見つけて、予測が広がるよう文脈の形を調整しました。3層のネットを、画素の代わりにSADやビット数といった特徴量に単一の近似を当てる形へ置き換える実験もしています。場合によってはそちらのほうが良い結果になりました。</p><p>エージェントには難しい質問を投げかけるのがよいといいます。すべて試したか、最悪の画像はどれか、何が不自然か、最良と最悪を探せ。書いた機能が本当に使われ、テストされているかを確認させる。こうした問いの立て方が重要です。</p><h4>エージェントを導くルール</h4><p>Massiminoは、自分のルールをいくつか挙げました。最初の答えは常に間違っているので、本当の数値なのかと突き詰めさせること。複数のエージェントを戦わせること。Massiminoは、ClaudeとCopilotを互いに競わせ、両者の答えが出そろってからコードを見て反復します。1つのエージェントだけに頼らないのがよいといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WoXGAGUuvlN5qFjq4hq6NQ.jpeg" /></figure><p>問いと方向は自分が持つこと。放置すれば、アルゴリズムのあらゆる可能性をWikipediaのごとく探索してしまいます。ハードウェアや制約を細かく指定すること。ニューラルネットの層の構成やサイズを変えようとしたところ、エージェントはあらゆる組み合わせを試し始めました。そこで「落ち着け」と伝えたといいます。</p><p>セッションは短く区切り、頻繁に再起動してコンテキストを小さく保ちます。100K程度にとどめ、それでもすべてをログに残して、失敗した実験を後から検索できるようにします。これはスライドを書くときにも役立ちます。</p><p>Massiminoは「プロンプトは新しいコードだ」と述べました。問題と解決のしかたを正確に書いた文書があれば、コードそのものは要らないという考えです。AIの使い方は、幅優先探索とA*の違いに似ているといいます。すべての可能性を探索させればよいというものではなく、導けば解に速くたどり着けます。</p><h3>VDD26 Day 2 #9 IAMF v2 — The nearest sound might be behind you</h3><p>by Thomas Daede（<a href="https://www.videolan.org/">VideoLAN</a>）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vX93ioOb7YQ3GZWFqw7PuA.jpeg" /></figure><p>空間オーディオのためのロイヤリティフリーなフォーマット、IAMF。2023年の初版から2年あまりを経て、バージョン2が登場しました。登壇したのはVideoLANのThomas Daedeです。オブジェクトベース音声の追加と、実装者の要望を反映した変更点を紹介しました。</p><ul><li>関連リンク：<a href="https://aomediacodec.github.io/iamf/">IAMF</a> / <a href="https://github.com/videolan/libspatialaudio">libspatialaudio</a></li></ul><h4>IAMFとは</h4><p>IAMFは空間オーディオのためのロイヤリティフリーなフォーマットで、既存のロイヤリティフリー方式やロイヤリティを伴う独自形式に代わるものを目指しています。たとえば、多数のチャンネルを扱うOpus multichannelや、3Dの音場を保存して後からスピーカーへレンダリングするOpus Ambisonicsがありますが、いずれも限界がありました。</p><p>Opus multichannelには、より小さなスピーカー構成へ規格に沿ってダウンミックスする手段がありません。実際の聴取は5.1や2.0が中心なので、その制御を効かせたかったといいます。Opus Ambisonicsには、マルチチャンネル向けの可逆圧縮に相当するものがなく、既存の多くの機器で動くものも求めていました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zgY1ia9ezK0jFtm-wZgH6Q.jpeg" /></figure><p>ほかの選択肢としてEBU ADMがありますが、これは配信用のフォーマットではありません。XMLとWAVの集まりで、オーサリングや中間形式としてはよくても、携帯電話へ送るものではありません。</p><p>IAMFはISO BMFFの中にコンテナーを重ねる構造で、内部にモノラルやステレオの音声ストリームを持ちます。ストリームにはOpus、現在はロイヤリティフリーになったAAC LC、PCM、FLACを使えます。そのほかのすべては、これらのモノラルとステレオのストリームから構成されます。</p><p>バージョン1では、規格で定めるパーサ、音声コーデックを担う外部エンコーダー、そしてミキサーを組み合わせていました。音声ストリームごとに5.1や2.0などへのミックスのしかたを定義でき、どの環境でも同じように鳴ることを保証できます。バージョン1は、まずリリースするために必要な機能だけに絞ったものでした。</p><h4>オブジェクトベース音声</h4><p>バージョン2でもっとも大きな追加がオブジェクトベース音声です。バージョン1で見送ったのは、難点が多かったからです。まず、オブジェクトベース音声を鳴らすには、規格に沿ったレンダラー（音を各スピーカーへ振り分ける処理）が欠かせません。次に、レンダリングの条件に左右されやすい。さらに、周囲の環境を音で表すのが難しく、メタデータも多く必要です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2F1Dz8qMelUsPaZcVbjVjQ.jpeg" /></figure><p>一方で利点もあります。方向性の強い点音源を、Ambisonicsより容易に作れます。Ambisonicsでは高次の表現が必要ですが、オブジェクトベースなら点音源を作るのに1チャンネルで済みます。オブジェクトベースを前提としたオーサリングツールも多く、制作側からの要望も強くありました。</p><p>バージョン2ではこれを取り入れましたが、新たな課題もあります。音源のXYZ座標を送る必要があり、レンダリングも必要で、データレートも無視できない大きさになります。</p><h4>v1からの変更点</h4><p>データ構造も変わりました。バージョン1では各サブストリームに音声サンプルがあり、それに付随するパラメーター値は同じ長さでした。20ミリ秒のブロックには20ミリ秒ぶんのパラメーター値が付きます。バージョン2では、パラメーター値が複数の音声ブロックにまたがります。ISO BMFFのサンプルをまたがらせる案も検討しましたが、音声キーフレームが必要になり、厄介な概念なので避けました。代わりに、ISO BMFFのサンプル自体を大きくしました。1つのサンプルに、20ミリ秒ではなく100ミリ秒ぶんの音声を入れます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LsfHolSUor7-qoSZIA-dQ.jpeg" /></figure><p>デフォルトレンダラーも加わりました。標準レンダラーは、標準化の進め方の都合でIAMF本体とは別に、AOMで規格化されています。IAMFは、使うレンダラーをメタデータで指定します。特定のレンダラーを名指しすることも、libspatialaudioのように互換性のあるレンダラーに任せることもできます。この指定はデータ形式の専用項目（フィールド）として定義されているため、将来レンダラーを増やせます。</p><p>ラウドネスについては、既定の制御方法と、出力に正規化を適用する仕組みが加わりました。プロファイルも追加され、PCMと圧縮形式を組み合わせられるようになりました。システムのUI音をIAMFストリームに重ねたいという要望に応えるものです。チャンネル数の上限も増え、レンダリングの組み合わせも広がりました。</p><p>HDMIのマッピングも加わり、IAMFをHDMIで送れるようになりました。従来のAC3の仕組みより良く、可逆でも非可逆でも送れますが、HDMIの帯域制限があり、ストリームはその範囲に収める必要があります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLW_Gd7WiVkWsFz_v6d95A.jpeg" /></figure><h4>新しい実装</h4><p>バージョン1の大きな弱点は、リファレンスエンコーダーがなく、ビットストリームを生成するツールがなかったことです。参照用のストリームを作る簡単なツールはありましたが、エンドユーザーが使えるものではありませんでした。</p><p>これを補うのが、新しいIAMF toolsのリポジトリです。EBU ADMでオーサリングし、それをIAMFファイルへ変換できます。市販のワークステーション向けツールに組み込むこともできます。FFmpegにはまだ実装がありませんが、バージョン1の実装とよく似ているため、それほど難しくはないはずです。libspatialaudioの実装はすでにあります。あとは、実装がどこまで広がるかです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wu-CWgzqyMkkgz5yjc_8Jg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLrEG7T8vAbiHdWRih0XUA.jpeg" /></figure><p><strong>Part 3へ続きます&lt;</strong><a href="https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-ja-48827ea51438">https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-3-ja-48827ea51438</a><strong>&gt;</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5df29d5741f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/videolan-developer-days-2026-rome-report-part-2-ja-f5df29d5741f">VideoLAN Developer Days 2026 Rome レポート Part 2(ja)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Cost-Effective, ZDR-Compliant Code Review System with Pullfrog + Ollama Cloud]]></title>
            <link>https://medium.com/@ksakai/building-a-cost-effective-zdr-compliant-code-review-system-with-pullfrog-ollama-cloud-a8b85e785e42?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8b85e785e42</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 02:26:49 GMT</pubDate>
            <atom:updated>2026-10-05T02:26:49.309Z</atom:updated>
            <content:encoded><![CDATA[<p>Thorough code review on pull requests lets you catch bugs early in the development cycle, such as misused libraries and APIs or gaps in the logic. Fixing a bug at that stage costs far less than fixing the same bug later.<br>Still, human review has its limits. When you’re tired, for example, you might approve with a “good enough” shrug.<br>So what can we do?</p><p>Have a smart AI model with cheap tokens review the code thoroughly.<br>AI doesn’t get tired, and it doesn’t get grumpy when you show it bad code.<br>You can have it review as many rounds as it takes until you’re satisfied, so problems get fixed before merge.</p><p>In this article, I describe how I connected Pullfrog, a coding agent that runs on GitHub Actions, to DeepSeek V4.1 Flash, a model that Ollama serves on its cloud with Zero Data Retention (ZDR), to build a setup that can run code reviews again and again at a nearly flat cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AlcVAzSwwkBCvHNLlvUf-g.jpeg" /></figure><h3>Why run code reviews many times?</h3><p>Code review isn’t something you do once and are done with. You want problematic code caught before merge, and every time the pull request changes, you want someone to check whether new problems have crept in.<br>In other words, you want code review to look at things like these:</p><ul><li>Is it inconsistent with the existing code?</li><li>Does it miss any cases in the spec the pull request is meant to implement?</li><li>Without taking the code and comments at face value, does it hold up across a variety of scenarios?</li><li>Are there any security holes?</li><li>If it pulls in open source libraries, is the usage consistent with the library code itself, checked by actually reading that code?</li><li>When the pull request’s code is changed, does the change introduce new problems?</li></ul><p>It goes without saying that having AI do all of this burns through tokens.<br>According to the official documentation, Claude’s Code Review feature costs $15–25 per review. When every review carries a noticeable cost, you naturally start rationing how often you run it.<br>With a sufficiently cheap AI model, on the other hand, you can iterate on the code as many times as you like without worrying about cost, and merge pull requests with more confidence.</p><p>There’s also the human side: asking a person to look at nearly the same code again and again feels awkward.<br>For example, you can have AI review the code repeatedly until you’re confident in it, and only then hand it over for human review.</p><h3>System architecture</h3><p><a href="https://pullfrog.com/">Pullfrog</a>, which I used here, is a coding agent that runs on GitHub Actions.<br>When you open a pull request, it reads the description and the diff, reviews the code, and comments on any problems it finds. You can also have Pullfrog write commits that fix what it pointed out.<br>Beyond code review, it can triage and label issues and take requests to fix broken CI.<br>Pullfrog charges a flat fee regardless of the number of users ($30/month per organization for GitHub organization accounts, free for personal accounts), so even large teams can use it without worrying about seat counts.</p><p>Pullfrog can connect to any AI model. You can connect it to OpenAI or Claude with API keys your company already has, or to Ollama Cloud as I did here.</p><p>I chose Ollama Cloud for this setup because it excels in cost and inference speed, and it supports ZDR.<br>Ollama’s Pro plan costs $20 a month and comes with a whopping $60 in credits every month. Companies with multiple users will probably go with the Team plan, which allows unlimited users who share credits ($500 a month with $1,000 in credits). Of course, Ollama isn’t just for code review, so credits you don’t spend on code review can go to other uses.<br>With DeepSeek V4.1 Flash as the model on Ollama Cloud, inference speed usually exceeds 150 tokens per second, so it’s comfortable to use, and it’s very cheap: at non-peak hour per million tokens, $0.15 for input, $0.003 for cached input, and $0.60 for output.<br><em>The </em><a href="https://ollamatps.com/models/ollama/deepseek-v4.1-flash/"><em>DeepSeek V4.1 Flash tokens per second</em></a><em> page on Ollama TPS shows the model’s historical TPS.</em></p><p>Since you’re having it review your code, you’ll probably want to know how Ollama handles your data. Automated code review sends not only the diff but also related code to the AI. That’s why you’ll want to confirm whether the data you send is stored or used for training before you even look at accuracy or cost.<br>Ollama states explicitly that it does not store the prompts you send and does not use them to train models.<br>Note, however, that inference runs in US and European regions. Depending on your company’s policies, you may need to check separately whether your data is allowed to leave your country.</p><p>When choosing the model, I also took into account that <a href="https://pc.watch.impress.co.jp/docs/news/2140010.html">DeepSeek V4.1 Flash scores close to Claude Opus 5 on some benchmarks</a> (in Japanese).<br>That said, benchmark scores alone don’t tell you how useful a model will be for code review.<br>Later in this article, I’ll show the findings I actually got when it reviewed pull requests.</p><h3>Connecting Pullfrog to Ollama Cloud</h3><p>First, sign up for both Pullfrog and Ollama.<br>Next, configure Pullfrog to call Ollama’s models. As of September 22, 2026, connecting Pullfrog to Ollama Cloud requires the “Custom: OpenAI-compatible endpoints” option.<br>To use DeepSeek V4.1 Flash, enter the following settings in the Pullfrog console.</p><ul><li>OPENAI_COMPATIBLE_BASE_URL:https://ollama.com/v1</li><li>OPENAI_COMPATIBLE_API_KEY: <em>An API key issued from the Ollama dashboard</em></li><li>OPENAI_COMPATIBLE_MODEL:deepseek-v4.1-flash</li><li>OPENAI_COMPATIBLE_CONTEXT:1000000</li><li>OPENAI_COMPATIBLE_MAX_OUTPUT:384000</li></ul><p>Then install Pullfrog on your repository, and it will run when you open a pull request or mention @pullfrog.<br>See <a href="https://docs.pullfrog.com/getting-started">Pullfrog&#39;s Getting started guide</a> for details.</p><h3>What findings came back?</h3><p>After installing Pullfrog, I had it review code without any special configuration, and it came back with findings like these:</p><ul><li>A library required at runtime isn’t declared as a dependency and is only depended on implicitly. It should be added explicitly rather than relied on implicitly.</li><li>A comment says the code keeps working after a major version upgrade of a library, but an investigation of the library’s issues shows the upgrade is still waiting on upstream, so the comment is inconsistent with reality.</li><li>The pull request’s code installs the library in both the server and client environments, but the pull request description says “client environment only,” which is inconsistent.</li><li>The pull request’s E2E tests fail because the library it uses has no GitHub Release. The tarball can’t be fetched from GitHub Releases, which causes an installation error. Fixing this requires installing the library another way.</li></ul><p>It investigated the library’s code and issues before answering, and it also analyzed failures in the E2E tests already running on GitHub Actions. That shows it goes beyond code review in the narrow sense and looks at whether the code is safe to merge.</p><p>The following is an example of a review comment raised by Pullfrog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*EPAnmqmzind7x1cA.png" /></figure><h3>Time and cost per review</h3><p>The cost of the review system is the monthly Ollama and Pullfrog subscriptions plus GitHub Actions usage for running Pullfrog.<br>When I had it review several pull requests, Pullfrog ran for about 10–20 minutes per review and consumed about $0.15 in DeepSeek V4.1 Flash credits.<br>The estimates below assume 20 minutes and $0.15 in model credits per review.</p><h3>Private repositories on a personal account</h3><p>With Ollama’s $20/month Pro plan and Pullfrog’s free plan, the costs look roughly like this.</p><p>The $60 in credits that come with Ollama’s $20 Pro plan cover about 400 reviews, and after that you can pay as you go.<br>GitHub Actions on the Free plan includes 2,000 free minutes, enough for about 100 reviews. After that, a review costs only about 0.006 USD / min * 20 min = $0.12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*gOYwi1N-bvXARA35GP9K4A.png" /></figure><h3>Private repositories on an organization account</h3><p>With Ollama’s $500/month Team plan and Pullfrog’s $30/month plan, the costs look roughly like this.</p><p>The $1,000 in credits that come with Ollama’s $500 Team plan cover about 6,700 reviews, and after that you can pay as you go.<br>GitHub Actions on the Team plan includes 3,000 free minutes, enough for about 150 reviews. After that, a review costs only about 0.006 USD / min * 20 min = $0.12.<br><em>If GitHub Actions’ standard runners feel too expensive, you could use a service such as </em><a href="https://www.blacksmith.sh/"><em>Blacksmith</em></a><em> or </em><a href="https://depot.dev/products/ci"><em>Depot CI</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*VJ9sVlgm4Qmp1qgkxVlOmw.png" /></figure><p>In short, for up to roughly 100–150 reviews a month, you pay a flat cost: just the Ollama subscription at $20 on a personal account, or $530 for Ollama and Pullfrog combined on an organization account. Beyond that, each review still costs only about $0.12–$0.27.</p><p>At this price, you lose more by not running thorough code reviews than by running them.</p><h3>Summary</h3><p>This article showed how to build an automated code review setup on GitHub with Pullfrog and Ollama Cloud that you can run again and again without worrying much about cost.<br>Using Ollama Cloud with ZDR also keeps your prompts and responses from being stored or used for training without you realizing it.<br>If you’re interested, start small with a personal repository.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8b85e785e42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2026–10–02 MoQ Meetup Japan #1 Seminar Report (en)]]></title>
            <link>https://medium.com/tokyo-video-tech/2026-10-02-moq-meetup-japan-1-en-fe11b0968a6b?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe11b0968a6b</guid>
            <category><![CDATA[videos]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[meetup]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sat, 03 Oct 2026 06:55:27 GMT</pubDate>
            <atom:updated>2026-10-05T21:12:45.410Z</atom:updated>
            <content:encoded><![CDATA[<p>On October 2, 2026, MoQ Meetup Japan #1 was held at docomo R&amp;D OPEN LAB ODAIBA.</p><p>How far has MoQ standardization progressed, and how far is it now usable? How do you make track switching during playback seamless with MoQ? How far can MoQ be applied to real-world events, point-cloud streaming, and game networking?</p><p>This time MoQ Meetup Japan welcomed four speakers: Ali C. Begen, developer of MOQtail; Ryo Kikuchi of Bootstrap Inc.; Kota Yatagai of Keio University; and Ryo Takehara of SEGA. This report covers their talks, from the state of standardization to implementation in the field.</p><p>MoQ Meetup Japan is a friend of the Tokyo Video Tech community.</p><p>Report by: <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a><br>(<a href="https://medium.com/tokyo-video-tech/2026-10-02-moq-meetup-japan-1-ja-975157fccfe1">本レポートの日本語版はこちらからご覧いただけます</a>)</p><p>A <a href="https://youtube.com/live/yUneU7UzI8Y">recording of the seminar</a> is also available on YouTube.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3ihXEJlHA7YMpwG5xe2lA.jpeg" /></figure><h3>Executive Summary</h3><h4>Session 1 — The Art of The Switch: Seamless Rate Adaptation in MOQtail</h4><ul><li>Ali C. Begen, developer of MOQtail, explained track switching (ABR) in low-latency environments. He showed how hard it is: switching can only happen at GOP boundaries, and you must avoid receiving unnecessary stream data.</li><li>As stream-switching approaches, he compared the naive combination of unsubscribe and subscribe with the SWITCH message, in which the relay carries the subscription across. SWITCH minimizes waste while achieving seamless switching with a single control message, and he described the working-group discussion and the two pull requests.</li><li>He introduced fast ABR switching using different GOP lengths, as well as a relay-side switching approach that uses a latency budget and active stream depth. In the demo, the client selected tracks with different GOP lengths and switched seamlessly between them.</li></ul><h4>Session 2 — MoQ in a Real-Event Platform for Virtual Talent: HYPER STUDIO</h4><ul><li>Ryo Kikuchi of Bootstrap Inc. introduced AIAI, a real-event platform for virtual talent, and HYPER STUDIO, an app that unifies calls and streaming. With off-the-shelf systems, quality would drop and stay low, the app window would show on screen, and managing multiple screens was cumbersome.</li><li>The HYPER STUDIO prototype used the WebRTC library LiveKit, but they moved on to a Cloudflare’s MoQ relay in a short time. They gained control over delivery latency (50–400 ms), bitrate (up to 10 Mbps), and resolution.</li><li>With MoQ, they had to implement playback using WebCodecs, audio/video synchronization, and click-noise handling themselves. They also shared challenges involving the protocol, its implementations, and browser and network environments: announcements stopping, the request-ID limit, OBS audio dropouts, and connection failures on iOS Safari and Android.</li></ul><h4>Session 3 — MoQ Optimization in Point-cloud Streaming</h4><ul><li>Kota Yatagai, an undergraduate at Keio University’s SFC, implemented field-of-view adaptive streaming of point-cloud volumetric video with MoQ. Even mid-quality data reaches 2.4 Gbps, so sending only the parts the viewer can see makes it practical.</li><li>Tracing frame drops, he identified that on unsubscribe, RESET_STREAM discards frames awaiting transmission in the relay’s send queue. By using the forward parameter to keep the subscription alive, he raised the reception rate to nearly 100%.</li><li>He requested higher quality for segments closer to the predicted viewpoint and used Subscriber Priority to give them higher forwarding priority. Under the same bandwidth, nearby players became visibly clearer. Distance-based prioritization does not necessarily match viewers’ preferences, however, and he continues to examine this design.</li></ul><h4>Session 4 — QUIC and MoQ Seen from Game Real-Time Communication</h4><ul><li>Ryo Takehara of SEGA organized the requirements unique to game real-time communication along four axes. Even within one title, different data have different characteristics, and requirements change with genre, network, and device.</li><li>In Sonic Rumble, the TCP fallback rate was only 0.014%, lower than expected. The deployment also confirmed that QUIC can serve as a real-time protocol even for many-player, high-frequency communication. Packet counts, including ACKs, however, became an operational issue. Adding QUIC to SPHINGO led to the conclusion that even with a Connection Migration specification, implementation, verification, and operations still require work.</li><li>For MoQ, he saw promise in in-game live streaming and in synchronizing object state in MMORPGs, but noted that game-specific design is still needed — which player publishes what, where state is managed, and so on. He also introduced the current discussion in the Game Real-Time Communication Protocol community.</li></ul><h3>Opening Remark</h3><p>by <a href="https://www.linkedin.com/in/tetta-maeda-3bb03917a/">Tetta Maeda</a> (MoQ Meetup Japan organizers)</p><p>The first MoQ Meetup Japan began with an opening address by Maeda on behalf of the organizers.</p><p>This event is a place for people who love Media over QUIC (MoQ) to discuss and exchange ideas to their heart’s content. Standardization at the IETF has advanced considerably, and draft-22 was released just yesterday. Implementations are increasing, and there are more and more topics people want to talk about. So we wanted to create a place where people who want to share and people who want to learn can get together — that is how this event came about. It is timed to coincide with the visit of Ali, a MoQ specialist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ue2W3j1jFM_jTY15j0ZBtQ.jpeg" /></figure><p>Today’s flow is four sessions beginning with Ali, followed by a networking session.</p><p>Today’s food and drinks are provided by Bootstrap Inc. Thank you very much.</p><p>We would also love for you to post what you learn on X, Facebook, and other social media with the hashtags #MoQMeetup and #MoQJP.</p><p>Also, MoQ Meetup Japan is looking for organizing members, speakers, and sponsors for the next open meetup. If you are interested, please come talk to us afterward.</p><p>Now, let’s get started. Our first session is Ali.</p><h3>The Art of The Switch: Seamless Rate Adaptation in MOQtail</h3><p>by <a href="https://ali.begen.net/">Ali C. Begen</a> (Özyeğin University / Networked Media)</p><p>When you switch video quality mid-playback, the picture must not stall or break up. That sounds obvious, but it is very hard — especially in an ultra-low-latency world under one second, where there is almost no room to switch.</p><p>The speaker was Ali C. Begen, developer of the MoQ implementation <a href="https://moqtail.dev/">MOQtail</a>. He is a professor at Özyeğin University in Istanbul and leads Networked Media, an IP-video consultancy. At Cisco he worked on the low-latency DASH specification, and this was his sixth or seventh visit to Tokyo.</p><p>“Today I’m going to talk about track switching, which is essential for adaptive bitrate streaming.” With that, Ali began by explaining QUIC, the foundation of MoQ.</p><ul><li>Links: <a href="https://moqtail.dev/">MOQtail</a> / <a href="https://abr.moqtail.dev/">ABR demo</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7A6Rd7wcX7KzE6lxQH2PmA.jpeg" /></figure><h4>QUIC as the Foundation</h4><p>The foundation of MoQ is <strong>QUIC</strong>. Google developed it and then brought it to the IETF, where it became RFC 9000. It has been a standard for five or six years now, and Safari, Edge, Chrome, and Firefox all support it. HTTP/3 was built on QUIC as its transport.</p><p>Why is it so significant? Ali explained it by contrast with TCP. TCP carries a single byte stream, which introduces <strong>head-of-line blocking</strong> — fatal for media streaming. QUIC, by contrast, is like a multi-lane highway: over a single connection it can run multiple streams in parallel, and each lane can have its own priority.</p><p>In a video conference, for example, audio and text messages get the highest priority. Video is sent only when there is bandwidth to spare. If the available bandwidth is only enough for audio, only the high-priority data goes out.</p><p>QUIC runs in user space, so the congestion-control algorithm and the retransmission machinery can be customized to your requirements. Streams can be canceled at any time. Suppose you are sending real-time video, bandwidth is short, and data starts to pile up. There is no point in receiving video from five seconds ago in a video conference. Cancel the stalled stream and open a new one starting from a new I-frame, and the video keeps flowing with almost no buffer or queueing delay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mf4FjJ5FAvtUwyT94sHdsg.jpeg" /></figure><p>Everything is encrypted, too. All an ISP sees is a single UDP connection between two machines; it cannot tell how many streams there are or what they carry.</p><h4>The Character of MoQ Transport</h4><p>MoQ transport, first, is <strong>latency-tunable</strong>: you decide the delivery deadline. It is cache-friendly. And rather than HTTP/2’s request-response model, it is a <strong>publish-subscribe</strong> protocol closer to RTSP.</p><p>Media sources become publishers, viewers become subscribers, and in between sit one or more <strong>relays</strong> that provide caching. To reach a million people, you need a relay network that fans the content out. When a subscriber sends a subscribe message, it travels relay by relay up to the publisher, and media starts to flow until the subscriber unsubscribes or the publisher finishes. The data travels as a QUIC application, or as a <strong>WebTransport</strong> session in a browser. WebTransport is itself being standardized at the IETF and should become an RFC before long.</p><p>Ali stressed that although the working group designs the protocol, much is left to the implementer. For example, what to do when the network has a problem, when there is not enough bandwidth. How to implement that is left to the implementer, and it is his research theme.</p><h4>When Latency Matters, and When It Doesn’t — The Gap Existing Protocols Can’t Fill</h4><p>Ali then laid out streaming latency as a spectrum.</p><p>Many live services — YouTube Live, Netflix, Hulu, Disney — run at high latency, 45 seconds or more. Applications using somewhat shorter segments, in the 15-to-45-second range, get by fine with DASH or HLS. To bring latency down to cable-TV or IPTV levels, you use low-latency DASH or HLS. That gets you to three to five seconds, but at three seconds it becomes very fragile and can stall at any time; playback algorithms often cannot keep up.</p><p>For real-time applications — conferencing, robots, drones, the metaverse — there is <strong>WebRTC</strong>. Ali focused instead on delivery at around one second of latency. In this range, he explained, combining the scalability of DASH/HLS delivery with WebRTC’s real-time capabilities presents a challenge.</p><p>WebRTC also presents challenges when used as a delivery platform, including connection establishment using STUN, ICE, and TURN, and the design and operation of SFU-based delivery systems. It does not provide the same content caching and distribution model as an HTTP-based CDN. Latency control, available codecs, and DRM support also have constraints that depend on the browser and implementation.</p><p>“If we have the existing APIs and a few new ones, we can cover the entire spectrum.” That was Ali’s thought. MoQ transport can serve on-demand, live, and real-time alike. That is why it is attracting attention now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rgy8bsiUV7voRFc4KwYElQ.jpeg" /></figure><p>To summarize its features: tunable latency, adaptive and prioritized delivery, synchronized playback, and scalability through a relay network. On synchronization, he gave the example of Amazon Prime Video using SAI to keep playback synchronized across players; the rights holder for American football uses SAI for distribution so everyone sees the same scene at the same time. The same is possible with MoQ, and Ali’s team has already built demos.</p><h4>Why Track Switching in Live Streaming Is Necessary, and Why It’s Hard</h4><p>Take, for example, a live stream like this. A live video source — Japan versus Turkey in soccer — is encoded in real time and published at multiple resolutions: 4K, 2K, 1K, SD. Audio is prepared in Turkish, Japanese, and English, with subtitles. The player subscribes to each track and receives the content through a relay. Only one video track is used at a time, but all of them need to be available on the relay.</p><p>The reasons for track switching fall into ABR-related and non-ABR-related categories.</p><p>ABR-related switching is driven by adjustments such as lowering the resolution when the client’s available bandwidth drops, reducing quality to avoid stalling when the buffer runs low, or raising quality when there is headroom. Content type matters too. For soccer you want low latency even at some cost in quality; for a movie you don’t care about latency, so you want to keep a larger buffer at 4K.</p><p>Non-ABR reasons come from user actions: switching cameras, turning your head in 360-degree video, changing language — or mobile data. Ali bought an eSIM in Japan, and it has a data cap. In an eSIM environment like that, he doesn’t want to watch 4K, and on a small iPhone screen 4K is unnecessary anyway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*po3OC79aajXl5VkJWX1Q8A.jpeg" /></figure><p>Here the information asymmetry matters. The client knows a great deal about the player — buffer, bandwidth — but nothing about the state of tracks on the relay. The relay knows what is available on the relay but nothing about the player’s condition. <strong>Neither has perfect information.</strong> How to combine the two to make a perfect switch is the key point.</p><h4>What a Switch Must Do</h4><p>Ali listed the requirements for track switching. Don’t stop playback — you should not halt just because you are changing quality. When you switch, the picture must not jump forward or backward — you might miss an important scene. And minimize waste: receiving data you will not use is waste, and subscribing to two tracks at once while using only one is a typical waste.</p><p>Switching can happen only at <strong>GOP (Group of Pictures) boundaries</strong>. In DASH and HLS that is the segment boundary; in MoQ it is the start of the group where a new I-frame appears. You cannot start decoding anywhere else.</p><h4>The Evolution of Switching Methods</h4><p>The simplest approach is to unsubscribe from the old track and then subscribe to the new one. If the new track is not available on the relay, however, it must be fetched from an upstream relay, potentially leaving a gap before the new data starts arriving. Waiting to buffer enough data to cover that gap stops playback.</p><p>Next is late unsubscribe. You start receiving the new track and then unsubscribe from the old one, so at least there is no gap. But during that time you receive two tracks at once, which makes things worse when you are doing ABR for bandwidth reasons.</p><p>Against this, Ali and his student proposed <strong>Switch Track</strong> four years ago. When switching to track 2, you subscribe with the information “I am coming from track 1.” The relay starts sending track 2’s objects and stops track 1 at the same time. No redundant data is produced, and the switch is seamless. Ali recalls it as “a very neat solution.” But it was a little early for the working group, and it was not adopted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTKQ6Knvc2vSUT3ACo84lA.jpeg" /></figure><p>Later, the working group realized it could do better: subscribe to both tracks at once, with one set to <strong>forward 1</strong> and the other to <strong>forward 0</strong> (meaning no data is sent). On a switch, you send a request update, stopping one and flowing the other. This avoids the upstream-fetch delay, but it does not handle the case where the two tracks’ groups are not aligned.</p><p>Unaligned groups look like an exceptional case, but they can arise routinely in many implementations. Groups from different tracks do not necessarily arrive at the relay at the same time. At 30 fps, a two-frame difference is about 67 milliseconds — easily possible. If the target track is behind, the relay must wait for data from the next group, but playback stops if that lag exceeds the available playback buffer. If the target track is ahead, you need the I-frame from a <strong>Joining Fetch</strong> and then continue the subscription.</p><p>Ali also noted that a student’s paper comparing these approaches was presented the previous week at IEEE MMSP 2026 in Istanbul. That conference featured “Zero Gap, Zero Waste: Subscriber-Initiated, Relay-Executed Track Switching in MOQ Transport” and “Relay-Side Latency-Budget-Aware Rate Adaptation in MOQ Transport.”</p><h4>Fast ABR: Multi-Variant Encoding</h4><p>Now to the main topic: how to switch fast in a low-latency regime.</p><p>Switching only at GOP boundaries is the same as in DASH and HLS. If the GOP is long, there is no opportunity to switch in between. If you switch to 4K and a moment later find bandwidth is insufficient, you must wait until the next boundary. But make the GOP too short and encoding efficiency drops and quality degrades.</p><p>The answer is <strong>multi-variant encoding</strong>, as used in low-latency DASH: encode the same content into multiple tracks with different GOP lengths — 0.5, 2, and 6 seconds. Normally you stay on the highest-quality 6-second GOP and use the short-GOP tracks only when switching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCxhgIXbsf2g8cYk-ZCnYQ.jpeg" /></figure><p>With variants at 6, 2, and 0.5 seconds, the 0.5-second blocks contain more I-frames. When the viewer switches, the relay first delivers an I-frame from a 0.5-second block, then transitions to a 2-second block, and finally to the 6-second block. The aim is to minimize switching delay while returning to high quality as quickly as possible.</p><h4>Relay-Side Track Switching and the Latency Budget</h4><p>The other approach is <strong>sender-side track switching</strong>, where the relay chooses the track.</p><p>The subscriber tells the relay about several representations — 4K, 2K, HD — and the minimum bandwidth each needs. Using bandwidth information, the relay selects, at each group boundary, the highest-quality track whose bandwidth requirement does not exceed the available bandwidth. All three tracks are subscribed, but only one is forwarded. This is regular switching, not fast switching.</p><p>On top of that they add a <strong>latency budget</strong>. The initial information carries a condition such as “I want the delivery latency within 500 milliseconds.” For live sports that must be watched in real time, 500 ms; for time-shifted viewing, five seconds. Even if bandwidth would allow a track, if it cannot arrive within the latency budget it drops out of the options.</p><p>Bandwidth information from the QUIC layer, however, is not straightforward. It behaves differently depending on the congestion-control algorithm — Cubic, BBR, Copa — and the values are noisy. So instead of measuring bandwidth directly, Ali’s team focused on the number of <strong>active streams</strong>.</p><p>In MoQ, sending the next group opens a new stream. With headroom, the relay can send one group and close its stream before the next group arrives, so only one stream is ever open at a time. When bandwidth is short, the next group arrives before the previous one has been sent, and a second stream overlaps it. If bandwidth shrinks further, three or four streams pile up.</p><p>In other words, <strong>the number of overlapping streams is itself the degree to which the sender is falling behind</strong>. Rather than measuring absolute bandwidth, the system counts how much is still queued. When that depth rises, the relay can judge that congestion has set in and lower the rate. Ali says the method is surprisingly simple and works well.</p><h4>Standardizing the SWITCH Message</h4><p>Ali summarized the approaches.</p><p>The <strong>SWITCH</strong> message they developed first achieves minimal waste and seamless switching with a single control message; other methods need four. The details are in a paper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHcJkKllkHzyxMNMG6T2wQ.jpeg" /></figure><p>Through working-group discussion, the message converged on a simpler design. Ali’s team’s proposal is filed as two pull requests. Ali said he very much hopes the pull request is merged, because without this message ABR will not work well.</p><p>Relay-side track switching, too, works well with the active-stream-depth method, and there is an implementation and a paper.</p><h4>The Demo</h4><p>Finally, a demo was shown.</p><p>The demo environment has four relays around the world — Osaka, Singapore, Europe, and Chicago in North America — plus a development relay in Frankfurt that hosts their other demos. The closest relay, Osaka, was selected. Ali had shown the demo a few weeks earlier at IBC in Amsterdam. It is available on MOQtail’s ABR demo site (<a href="https://abr.moqtail.dev/">abr.moqtail.dev</a>).</p><p>The video is pre-recorded but encoded in real time and treated as a live source. Full HD, 6-second GOP, latency about 600 milliseconds. Delivery continued even as he lowered latency to 300 ms and then 180 ms — four to five frames at 25 fps — including encoding, packaging, transport, and playback buffer. You could see the playback speed being adjusted to grow or shrink the buffer.</p><p>Resolutions 540p, 720p, and 1080p, and GOP lengths of 6, 2, and 0.5 seconds, give nine tracks. For the same resolution the bitrate is the same, but longer GOPs give better quality. When down-switching to 720p, if the 6-second GOP boundary is near, the client jumps straight to that track; if it just missed it, it jumps to the 0.5- or 2-second track and then returns to the 6-second block as soon as possible. The client picked tracks intelligently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaI8RMndZqTfTRCnJ2pkcw.jpeg" /></figure><p>The settings include a network emulator for delay, packet loss, and bandwidth profiles. A stats button shows buffer level, latency, playback rate relative to real time, and stall duration.</p><p>The demo also includes manual switching, and relay-side switching is marked “coming soon.” The next challenge is ABR decided entirely on the client without relay assistance, which he hopes to have ready within a few months.</p><p>To close, Ali introduced <strong>OpenMOQ</strong>, an industry consortium that includes universities and develops open-source MoQ software, especially relay components. MOQtail takes part, and he invited anyone interested to visit the site and join.</p><p>Finally, Ali asked the audience whether the TV show used in the demo was popular in Japan — the one about a chemistry teacher who turns violent. The room laughed, and the talk ended on a warm note.</p><h3>MoQ in a Real-Event Platform for Virtual Talent: HYPER STUDIO</h3><p>by Ryo Kikuchi (<a href="https://bt-strap.com/">Bootstrap Inc.</a>)</p><p>A virtual talent talks with fans at a real venue. It sounds simple, but connecting a remote talent to screens at the venue and making two-way conversation and video delivery work at the same time is not easy at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2LfrBlPvEfb1Odpsewrr3g.jpeg" /></figure><p>The speaker was Ryo Kikuchi of Bootstrap Inc. The company runs <a href="https://aiai-s.com/">AIAI</a>, a real-event platform for virtual talent and VTubers, jointly with Activ8 Inc., and develops HYPER STUDIO, an app that unifies calls and streaming.</p><ul><li>Links: <a href="https://aiai-s.com/">AIAI</a> / <a href="https://hyper-studio.app/">HYPER STUDIO</a></li></ul><h4>Starting with AIAI</h4><p>AIAI is a platform that supports virtual talents holding fan meetings, talk events, mini-lives, and DJ events at real venues, handling everything from planning consultation to ticket sales, day-of operations, and revenue settlement.</p><p>An up-and-coming virtual talent who wants to hold an event often cannot find a venue. At ordinary venues the break-even line tends to be around 100 people, so without that draw it is hard to go ahead. AIAI was built to make it easier to hold smaller events, even with only a small audience.</p><p>The first venue is <a href="https://x.com/kaiwai_hatsudai">KAIWAI Hatsudai</a>, a bar in Hatsudai, Tokyo. The talent appears remotely and is shown on the venue’s screens. Fans enjoy drinks while talking with the talent on screen. The actual venue has two displays side by side, where the talent joins.</p><h4>The Limits of Off-the-Shelf Tools</h4><p>At first they used Discord for streaming and calls. But there were problems.</p><p>Once the streaming quality dropped, it would sometimes stay low and not recover, and the event would continue that way. Another issue was that Discord’s interface or the mouse cursor could appear on the venue’s screens during operation. And with multiple screens at the venue, managing and operating them was a lot of work. They wanted to improve the event experience, so they decided to build their own app.</p><h4>The HYPER STUDIO App</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wq88mKUPTGjrZvX1dA5jqw.jpeg" /></figure><p>The result is HYPER STUDIO, an app that connects a remote talent and the venue. Its feel is close to Discord: the talent joins a room and sends video to the venue using a virtual camera or screen sharing. It tunes the balance between latency and quality to maximize the event experience.</p><p>In the console, the talent can review their own stream while also monitoring how it is actually being delivered to the venue.</p><p>The architecture includes call sessions and audio, a satellite app on the venue terminal, and a server for streaming directly from OBS, which most talents use. Outside OBS, video and audio are carried with NDI, while the OBS side uses WebRTC. Data is sent to a bridge, which repackages it. Sessions and satellites are controlled via GraphQL on Cloudflare Workers, connected over WebSocket.</p><h4>From WebRTC to MoQ</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2WUgzw9pOShxosioppPQw.jpeg" /></figure><p>Kikuchi’s team did not start with MoQ. In the prototype stage they implemented with the WebRTC library <a href="https://livekit.io/">LiveKit</a>. But that setup needed around four containers, and running many servers for small, brand-new service felt like too much. So they turned to Cloudflare’s realtime SFU. Just as they were moving forward with experiments, they saw news that Cloudflare was opening its MoQ relay, until then in tech preview, to general availability. They decided to give it a try, almost casually.</p><p>In practice, the adoption took almost no code and reached testing in a single day. Switching from LiveKit to the realtime SFU took about 30 minutes, and from the realtime SFU to the MoQ relay another 30 minutes. “We were able to adopt it really casually,” Kikuchi recalled.</p><h4>What Adoption Bought Them</h4><p>Cloudflare’s MoQ relay is free during the beta. That makes experimentation easy — small tests, streaming to all the venue’s screens, going live, trying storage — with no cost, Kikuchi said. But since it is a beta service, it is not guaranteed to be always available. As a fallback, they also run their own MoQ relay and can switch to it.</p><p>The infrastructure changed too. Previously everything ran in containers; now most of it is serverless. Only the relays, which must keep running, still run in containers and are operated remotely.</p><p>The multiple terminals at the venue turned out to be an opportunity rather than a burden. They are exploring running a MoQ relay inside the satellite app on each terminal and distributing to multiple screens, though this is still in preparation and experimentation.</p><p>Best of all, they gained a degree of control over quality and latency. Latency ranges from about 50 to 400 ms, resolution is 700×400, and bandwidth goes up to about 10 Mbps, adjusted flexibly per talent’s connection during rehearsal. It is easier to handle than WebRTC, Kikuchi said. Latency and bandwidth information is sent over HTTP to the console so staff can check it.</p><h4>What Was Hard with MoQ</h4><p>It was not all smooth. In fact, this is today’s main topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKG6OIcRgaWt8NnNKdo58Q.jpeg" /></figure><p>With WebRTC, the browser handles audio delay adjustment, pauses, and audio/video sync on your behalf; the user hardly has to think about it. With MoQ, you must implement playback of the received data yourself using WebCodecs. When audio arrives first and video lags, the voice and picture drift apart. They had to implement audio/video synchronization themselves.</p><p>Keeping latency low makes audio problems appear: when a packet is lost, the sound breaks up or click noise becomes frequent. They implemented receiver-side processing that WebRTC would otherwise handle internally, including playback-speed adjustments in response to latency.</p><p>Playback speed was another headache. WebRTC can speed up by as much as about 2×, but in this service a talent sometimes performs music, and changing the speed is a problem. They therefore adjust audio playback speed gradually to make the changes less noticeable.</p><p>There were also several problems around the MoQ protocol itself. Kikuchi used draft-16 of MOQT and MoQ Lite. Locally, encoding and packaging worked fine, but once data flowed through Cloudflare’s relay, the following problems appeared.</p><ul><li>The list of streams arrives via announcements, but it stops partway through, and video and audio stop flowing mid-event. Their conclusion was that they needed to aggregate and centralize communication state.</li><li>The request ID grows with each connection; after about 50 starts it reaches a limit and the server replies that it can accept no more requests. Their workaround was to add a new connection when the limit is reached and send subsequent data from there.</li><li>OBS audio drops out. The bridge groups audio and sends it in separate groups at intervals, which mitigated the symptom.</li><li>Some environments cannot connect at all. On iOS Safari, communication stops after a while — reported as a WebKit bug that will not be fixed soon. Some Android environments cannot connect over QUIC. They keep calls working in these environments through measures such as switching to their own relay and communicating over WebSocket.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*On-3ovuGn-VHI-gLRmBdmw.jpeg" /></figure><p>Differences between draft-16 and MoQ Lite, and connection failures, were resolved one by one by feeding them back to the app, the bridge, and the libraries.</p><h4>Living with the Standardization Process</h4><p>HYPER STUDIO took shape as an app that unifies calls and streaming and carries video and audio over MoQ. Thanks to Cloudflare, they could start small and gained control over delivery. In exchange, they had to rebuild the playback that WebRTC used to handle for them. That was Kikuchi’s summary.</p><p>Until the specification is standardized, they will keep building while following the drafts. Even so, by staying close to the protocol and including in-house development, he believes they can keep up.</p><p>The talk ended with a look at the actual console. The talent joins a session, starts streaming from OBS, and it connects to the bridge and reaches the venue terminal. You can see at a glance the current latency and the bandwidth at which the video is being sent — a real tool for making virtual-talent events run smoothly.</p><h3>MoQ Optimization in Point-cloud Streaming</h3><p>by <a href="https://kota-yata.com/">Kota Yatagai</a> (Keio University, Faculty of Environment and Information Studies)</p><p>Watching a baseball game in 3D from your phone. Moving around a player and viewing the play from any angle you like. “If a service like that existed, I’d pay three times the current subscription,” Kota Yatagai joked as he introduced his research.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKLOWNGkgxLLwgzd9gvxDg.jpeg" /></figure><p>The speaker was Kota Yatagai, an undergraduate at Keio University’s SFC, researching volumetric video streaming for sports. He has contributed to Jitsi, Wireshark, and MoQ-related software, and is currently developing a MoQ client library with minimal dependencies so it can be used in heavy applications like Unreal Engine.</p><ul><li>Slides: <a href="https://slide.kota-yata.com/moq-meetup-japan/">https://slide.kota-yata.com/moq-meetup-japan/</a></li><li>Links: <a href="https://kota-yata.com/">kota-yata.com</a> / <a href="https://github.com/kota-yata">GitHub</a></li></ul><h4>What Point-Cloud Volumetric Video Is</h4><p>Point-cloud volumetric video is 3D video made of a great many points. Captured with multiple cameras surrounding the subject, it can be viewed from any position and angle. Meshes or 3D Gaussian splatting can be generated from point clouds, but for real-time use, bare point clouds are used because they are easier to encode.</p><p>In recent years, volumetric video has been used to generate sports replays — winter Olympic skating, baseball at Tokyo Dome. At Tokyo Dome, 150 cameras around the field generate a replay in three seconds. Yatagai studies live streaming of the volumetric video itself. For his research dataset, he recreated the Tokyo Dome setup in Unreal Engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tqnn5-6rqp5RE8bxwE4yOg.jpeg" /></figure><p>Existing replay generation simply moves a virtual camera inside the scene; it does not send 3D objects to the viewer’s device. To stream the 3D objects themselves live, the stumbling block is data size. Measuring his own dataset, Yatagai found that even mid-quality video reaches 2.4 Gbps. No ordinary home Wi-Fi can carry that.</p><h4>Field-of-View Adaptive Streaming</h4><p>The technique used here is <strong>field-of-view adaptive streaming</strong>: send only the parts the viewer is looking at.</p><p>The sender first splits the scene into segments — for a baseball field, imagine cutting it into uniform cubes or tiles. The viewer’s application predicts the field of view a few frames ahead — about 150 milliseconds in Yatagai’s implementation — and requests the segments intersecting that predicted view. Prediction runs every frame, or at least once every five frames. The transport must reflect these frequent updates, demanding fine-grained control and low latency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ul4A_FRq-fUDx1Y27bGFtA.jpeg" /></figure><h4>Why MoQ</h4><p>Is MoQ a candidate as the delivery protocol? Yatagai’s answer was yes.</p><p>Segment-based protocols like HLS and DASH can reflect prediction results only per segment or block, usually two to five seconds, so they do not fit well here. WebRTC is excellent for real time, but to send arbitrary binary data like point clouds you must use a data channel and layer on a custom media protocol for requests, replies, and control semantics. MoQ is a media-agnostic publish-subscribe protocol: you can put any payload on it and still use the core functions. Designed for low-latency, scalable media transmission, it is the closest protocol for volumetric video streaming, Yatagai argued.</p><h4>Building the System with MoQ</h4><p>Yatagai built a field-of-view adaptive streaming system with MoQ. One MoQ track corresponds to one segment stream. He used his own MoQ library on the client side and a MoQ relay for the relay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQb8Y_Anm25nsEBNd2C8qw.jpeg" /></figure><p>Normally the publisher would generate video on the fly, but real-time encoding needs a GPU. Not having one, Yatagai pre-encoded a seven-second dataset and had the publisher repeatedly stream it. The subscriber sends subscribe messages for the tracks inside the predicted view and signals stop for tracks that leave the prediction. “It sounds simple, but building this system took my whole summer break,” he recalled.</p><h4>The Cause of the Frame Drops: reset stream</h4><p>Now to the main topic: optimization.</p><p>What Yatagai first noticed was that frames dropped from time to time; objects blinked. And it happened almost constantly.</p><p>He first suspected that frequent subscription changes were using all of the relay’s CPU capacity. That was wrong. Subscription updates can occur every frame in the worst case, but even with ten cores assigned to MoQtail’s Tokio runtime, at most three were used — whether he scaled to 50 or 100 subscribers. The relay was not the overhead.</p><p>Digging deeper, he found <strong>reset stream</strong>. In recent MoQ, when a subscriber unsubscribes, it first sends STOP_SENDING as a control message on the request stream. The relay then sends RESET_STREAM to all streams in the subscription, canceling them immediately. This also destroys the objects already queued in the relay’s send queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zG2o5Jo5tlM7H50NBWMJtA.jpeg" /></figure><p>The problem was that in this application the subscriber itself does the prediction, so even after sending stop, there are still frames it wants to receive sitting in the send queue. Those frames were canceled before reaching the network. In fact, most of the frames lost during the experiment were in the last two frames of the stream.</p><h4>Fixing It with the forward Parameter</h4><p>Knowing the cause, Yatagai solved this problem with the <strong>forward parameter</strong>.</p><p>forward is a binary parameter on a subscription. Sending a SUBSCRIBE_UPDATE with forward 0 pauses object forwarding while keeping the subscription itself in place. Crucially, unlike unsubscribing, this does not immediately cancel existing streams. In Yatagai’s tests, switching to this method prevented stream resets from discarding the data for tail frames still in the send queue.</p><p>forward was originally defined to pre-warm subscriptions and lower latency, but it also proved useful for tracking field-of-view prediction. After switching to the forward-based approach, the object reception rate rose to nearly 100%, and the flickering caused by frames being discarded on unsubscribe disappeared. Other flickering remained in bandwidth-limited environments, however.</p><h4>High Quality Where You Look: Subscriber Priority</h4><p>Not everything was fixed. At 4 Mbps Wi-Fi the video still flickered, and when watching baseball the field of view often includes the whole infield, so the bandwidth savings were limited.</p><p>So Yatagai changed the system to request higher quality for segments closer to the predicted position. Previously all segments were requested at low quality for bandwidth reasons; now a segment containing the predicted position is requested at mid quality, while others stay low.</p><p>He also assigned higher priority to closer segments using <strong>Subscriber Priority</strong> — a per-subscription priority set by the subscriber, on which the relay bases what to send next. MoQ also has Publisher Priority and Group Order, but Subscriber Priority is considered first when determining the order in which objects are sent. Yatagai calculated segment priorities using distance and angle from the predicted position, dividing them into eight priority levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iCRPIsri6_J5qm37QJUy0A.jpeg" /></figure><p>As a result, under the same bandwidth, closer segments — the shortstop, the runner going to second — became visibly clearer. Other objects were sent less. However, prioritizing delivery of regions close to the viewpoint does not necessarily suit everyone’s preferences. Some viewers may want everything at lower quality, or may prefer to watch the runner at first base rather than a high-quality shortstop. Yatagai acknowledged that there is room to improve this design, and he continues to examine it.</p><h4>Conclusion</h4><p>Yatagai closed with this summary: forward helped prevent subscription updates driven by field-of-view prediction from discarding data for tail frames that were still needed, and Subscriber Priority helped improve the quality of segments close to the viewpoint. As far as he has tried, field-of-view adaptive streaming of volumetric video appears to work well in real environments.</p><p>With a final “Happy Moqing,” the talk made a compelling case for the possibilities of free-viewpoint video.</p><h3>QUIC and MoQ Seen from Game Real-Time Communication</h3><p>by <a href="https://x.com/takehara3586">Ryo Takehara</a> (<a href="https://www.sega.co.jp/">SEGA</a>)</p><p>Game real-time communication, as a single phrase, hides a surprising diversity of requirements. Within one title, communications of completely different natures coexist. That is exactly why deciding where to apply QUIC or MoQ is not easy.</p><p>The speaker was Ryo Takehara of SEGA. He works in a development-support division, providing development support for automation, sound, and real-time communication. At CEDEC he speaks about AI development, and he also does protocol-development verification on his own and organizes the Game Real-Time Communication Protocol community. This time, he was invited through that community.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mFXb5Ir76b2KqAb393wsw.jpeg" /></figure><p>Takehara rarely gets to talk about real-time communication to people outside the game industry, so he began with what makes games special.</p><ul><li>Slides: <a href="https://speakerdeck.com/segadevtech/quic-and-moq-from-the-perspective-of-real-time-game-networking">QUIC and MoQ from the Perspective of Real-Time Game Networking</a></li><li>Related Slides: <a href="https://www.slideshare.net/slideshow/cedec-2025-quic-936f/282204153">CEDEC 2025, “Examples of Introducing QUIC into Game Real-Time Communication”</a></li><li>Links: <a href="https://github.com/TakeharaR/game-realtime-protocol">Game Real-Time Communication Protocol community</a></li></ul><h4>The Requirements of Game Real-Time Communication</h4><p>Takehara organized the requirements unique to game real-time communication along four axes.</p><p>First, even within one game, different data have different characteristics. Gameplay alone involves input, state synchronization for character position and HP, and events such as item acquisition. Some games also need chat, or voice and video. The meaning and importance of each kind of data differ.</p><p>For example, when communicating another player’s movement, the design often prioritizes learning the latest position quickly and tolerates some loss or reordering. Item acquisition, by contrast, must uniquely determine who got an item — two players must not both acquire it. Party position and status must show the current correct value but do not need to be as frequent as position. In other words, it is not simply a matter of reliable versus unreliable; the handling must match each game’s design.</p><p>Second, genre matters. In a fighting game, the timing of a button press affects the outcome: immediate reflection and identical attack/defense results are critical. In an MMORPG with many players, moving through the world involves many players and objects, so traffic and processing load become problems; for example, you prioritize communicating what is happening around your own player. In a turn-based card game, accepting actions in order and confirming how a result was settled matters, but real-time responsiveness is less important and latency is tolerable.</p><p>Third, network environments and devices vary. Games are played all over the world, so you must assume home connections and wireless environments everywhere. Working well for as many people as possible, equitably, is important. Video and audio services share this challenge, but games have multiple players interacting bidirectionally around the same event, so deciding how long to wait and how much to correct under latency is the hard part.</p><p>Fourth, cross-platform. Games are often deployed on PC, smartphones, and game consoles, with play across all of them. Development environments and the constraints on embeddable libraries differ by platform. Even with an open-source library you would like to adopt, it may not be usable as is: porting, engine integration, device testing, and ongoing maintenance are often required. On closed platforms with little public information, you cannot judge suitability from public information alone, and verification and integration costs can be very high.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLUP2GHnTciKrMYvk71k_w.jpeg" /></figure><h4>Techniques Unique to Games</h4><p>Against these requirements, games have accumulated their own techniques. Takehara introduced five, most of them aimed not at satisfying requirements directly but at making the user experience comfortable.</p><p>The first is client-side prediction. In a fighting game, for example, if you waited for the server’s reply every time the player pressed the move button, the character would move late by the latency and the experience would suffer. So the game computes the input locally first and reflects it on screen, then corrects it if the server’s result differs because of interactions with other players. It is close to the optimistic display of a web “like” button. But in games, another player may act while you are waiting for the reply, which makes it more complex and difficult.</p><p>The second is interpolation. If you reflected an opponent’s position every time it arrived, the motion would be jerky — the data does not arrive at perfectly regular intervals. So you store a little past position data and interpolate it with the latest to make movement look smooth. It resembles how voice calls absorb variation in packet arrival with a buffer. Increasing the buffer adds latency, so it trades off against responsiveness such as a character moving the instant you press a button.</p><p>The third is rollback. In games like fighting games, where latency directly affects the experience, waiting for the opponent’s input each time ruins the experience. So the game predicts the input it has not received and advances. Suppose it predicts the opponent is standing and proceeds; if 0.3 seconds later it learns the opponent was crouching, it recomputes the game state and rolls back. The idea resembles client-side prediction, but rolling the whole game back 0.3 seconds requires the game to be designed and built to allow it — which is quite hard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8NDMwVf0sjoKJJSEfu5ozg.jpeg" /></figure><p>The fourth is input redundancy. By including recent past inputs alongside the latest, you can compensate for inputs lost to packet loss. This follows the same redundancy principle as the in-band FEC used by Opus in voice calls. Traffic increases, but game data is small, so it is rarely a problem.</p><p>The fifth is thinning by importance. A player so far away as to be nearly invisible is low-importance, and so is their data, so it is thinned out. Faraway player data may be omitted or reduced to a tenth, and the frequency raised as they approach, so the experience is not affected.</p><h4>Introducing QUIC in Sonic Rumble</h4><p>Now to real cases of applying QUIC to games, drawn from Takehara’s CEDEC 2025 talk.</p><p>The first is SEGA’s Sonic Rumble. In the game industry, real-time communication is very often implemented with a custom RUDP, but maintaining its implementation and specification has become harder over time. So Sonic Rumble adopted QUIC as its protocol.</p><p>Because Sonic Rumble uses Unity (C#), however, it needed wrappers to use the native implementation from C#, plus per-platform builds, so cross-platform support came at a cost. QUIC streams and datagrams are used according to the nature of the data and the actual connection environment. A TCP fallback is in place for when QUIC cannot connect, but the actual fallback rate after launch was 0.014% — far smaller than expected. Takehara suggested that unreachable UDP or QUIC environments may no longer need much concern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*It0y66pa5LEKi7_uvDOP-Q.jpeg" /></figure><p>Next, Takehara presented results evaluating whether QUIC can serve as a real-time communication protocol in settings with many players and frequent communication, such as Sonic Rumble. Sonic Rumble is a race-like game in which many players gather and head for the goal in real time. In measurements, RTT showed some jitter but was fairly stable overall; it did not deviate much from theory and varied with distance to the peer. From this, the talk concluded that QUIC can be a real-time communication protocol even in many-player, high-frequency games.</p><p>In operation, however, issues appeared. After launch, a certain share of cases led to disconnection determination. Investigation suggested that the implementation produced many packets relative to the data volume, causing packet loss on network equipment. They aggregated in-game data and temporarily switched some communication to UDP to cut the ACK packets. As a result, disconnections fell, and aggregating sent data within a range that did not change the feel reduced them further.</p><p>Games tend to send small data frequently and one-directionally, unlike the web’s request-response model. In this case, the number of sent packets, including ACKs, became an operational issue. There is a need to keep responsiveness while adjusting packet count, and Takehara expressed hope for the QUIC discussion on ACK Frequency, which allows tuning ACK frequency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8r_lWcPDHbB48QvMT_qMg.jpeg" /></figure><h4>Adding QUIC to SPHINGO</h4><p>Next, Takehara described adding QUIC to SPHINGO, SEGA’s in-house real-time network library. SPHINGO is a network library for real-time matches among several to a few dozen players, used within SEGA for many years and adopted by multiple titles. It did not replace all proprietary protocols with QUIC.</p><p>The backdrop was a need to restore communication automatically when a client switches from one network connection to another. Building and maintaining such a mechanism in-house is costly, so they added QUIC, which has Connection Migration as a standard specification.</p><p>QUIC accommodates changes in network paths through Connection Migration. But having the specification does not make implementation automatically easy. For example, the Windows network stack may absorb address changes internally without notifying the application of the network path change, so the application does not know when to migrate. In such cases, communication continues despite an IP address change, producing no communication error. The application therefore cannot use a communication error as the trigger for detecting that the network path has changed. NAT state and switch timing are environment-dependent, and what works in a virtual environment often does not behave the same across real Wi-Fi, mobile networks, devices, and OS combinations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VBv0fkKEWQ-pyFm_TtG03g.jpeg" /></figure><p>Even so, Takehara concluded that the value of Connection Migration is not in solving all these problems but in at least sparing you from defining connection-continuation specifications from scratch.</p><h4>MoQ and Games</h4><p>Since this was a MoQ Meetup, Takehara also thought personally about applying MoQ to game use cases.</p><p>The clearest fit is in-game live streaming: delivering video and audio continuously to many users.</p><p>Another possibility he considered was synchronizing object state in an MMORPG-like world with many players. It might be possible to use MoQ to synchronize object status. But doing so still requires game-specific design: which player publishes what, where game state is managed, how to handle data loss. Whether MoQ is really the right choice remains to be considered, he said.</p><p>Thinking about protocol design from the game side’s requirements is an ongoing theme in the Game Real-Time Communication Protocol community.</p><p>That community is a non-profit effort to exchange information on the protocols used in game real-time communication and improve quality across the industry. Initially they set out to collect QUIC adoption case studies, organize the elements required for game real-time communication, compare them, and propose a game-specific protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GLnBTi9hEDZqhnRFspKwA.jpeg" /></figure><p>As work progressed, however, publicly available QUIC adoption cases turned out to be fewer than expected. There are almost no published cases, anywhere in the world, of games actually using QUIC. Comparing multiple cases to design a game protocol became difficult.</p><p>So the community shifted: rather than starting from a single protocol, it now starts from use cases, organizes requirements, and defines trade-offs and evaluation metrics. It then evaluates how far standard protocols like QUIC fit game real-time communication, and if missing features become clear, considers extensions or a game-specific protocol. That is where the discussion stands today.</p><h4>Conclusion</h4><p>Takehara closed with a summary.</p><p>That different uses have different communication requirements is not unique to games. But games have communications of different natures coexisting within one title, and requirements vary greatly with design, so the range of what is demanded of real-time communication is very wide. Games meet that diversity by combining transport protocols with game-side techniques such as client-side prediction and interpolation.</p><p>Whether to adopt QUIC or MoQ for game real-time communication should likewise be evaluated by asking which in-game communication it fits, from the perspective of both the desired experience and implementation and operations.</p><p>The talk was full of practical insights built up by working across both game development and protocol design.</p><p>Interested in these topics? Join us at a future Tokyo Video Tech event! Visit <a href="https://luma.com/tokyo-video-tech?utm_source=medium_cta">Tokyo Video Tech on Luma</a> and click “Follow” to receive announcements about upcoming events. We look forward to seeing you there!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe11b0968a6b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/2026-10-02-moq-meetup-japan-1-en-fe11b0968a6b">2026–10–02 MoQ Meetup Japan #1 Seminar Report (en)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2026–10–02 MoQ Meetup Japan #1 開催レポート (ja)]]></title>
            <link>https://medium.com/tokyo-video-tech/2026-10-02-moq-meetup-japan-1-ja-975157fccfe1?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/975157fccfe1</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[videos]]></category>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[meetup]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sat, 03 Oct 2026 06:55:26 GMT</pubDate>
            <atom:updated>2026-10-05T21:07:07.088Z</atom:updated>
            <content:encoded><![CDATA[<p>2026年10月2日（金）、docomo R&amp;D OPEN LAB ODAIBAにて第1回MoQ Meetup Japanが開催されました。</p><p>MoQの標準化はどこまで進み、どこまで使えるようになっているのか。MoQで再生中の動画トラック切り替えを、どうシームレスに実現するのか。リアルイベントや点群ストリーミング、そしてゲームの通信に、MoQはどこまで活用できるのか。</p><p>今回は、MOQtailの開発者であるAli C. Begen氏、株式会社ブートストラップの菊地諒氏、慶應義塾大学の八谷航太氏、株式会社セガの竹原涼氏という4名の登壇者を迎えました。MoQの標準化の動向から現場の実装まで、それぞれの立場で語った発表をレポートします。</p><p>MoQ Meetup Japanは、Tokyo Video Techと親交のあるコミュニティです。</p><p>Report by: <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a><br>(<a href="https://medium.com/tokyo-video-tech/2026-10-02-moq-meetup-japan-1-en-fe11b0968a6b">The English version of this report is available here</a>)</p><p>当日のセミナーの模様は、<a href="https://youtube.com/live/yUneU7UzI8Y">アーカイブ動画</a>でもご覧いただけます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3ihXEJlHA7YMpwG5xe2lA.jpeg" /></figure><h3>エグゼクティブサマリー</h3><h4>セッション1 — The Art of The Switch: Seamless Rate Adaptation in MOQtail</h4><ul><li>MOQtailの開発者であるAli C. Begen氏が、低遅延環境でのトラック切り替え（ABR）を解説。切り替えはGOP境界でしか行えないこと、不必要なストリームデータを受け取らないことが求められる難しさを示した。</li><li>ストリームの切り替え方式として、購読解除と購読を組み合わせる素朴な方式から、リレーが購読を引き継ぐSWITCHメッセージまでを比較。SWITCHは無駄を最小化しつつ、制御メッセージ1つでシームレスな切り替えを実現するとして、ワーキンググループでの議論と2本のPRの現状も紹介した。</li><li>異なるGOP長を用いた高速ABR切り替えと、レイテンシバジェットやアクティブストリーム数を利用するリレー側の切り替え方式を紹介。デモでは、クライアント側でGOP長の異なるトラックを選び、シームレスに切り替える様子を示した。</li></ul><h4>セッション2 — バーチャルタレントのリアルイベントを支えるMoQ — HYPER STUDIOの採用事例</h4><ul><li>株式会社ブートストラップの菊地諒氏が、バーチャルタレント向けリアルイベント基盤「AIAI」と、通話と配信を統合したアプリ「HYPER STUDIO」を紹介。既成のシステムでは、画質が落ちたまま戻らない、アプリ画面が映り込む、複数スクリーンの管理が大変といった課題があった。</li><li>HYPER STUDIOのプロトタイプはWebRTCライブラリのLiveKitを使ったが、CloudflareのMoQリレーへと短時間で移行。配信遅延50〜400ミリ秒、ビットレート最大10メガビット毎秒、解像度を自分たちで制御できるようになった。</li><li>一方で、MoQではWebCodecsを使った再生処理や映像・音声の同期、クリックノイズへの対処を自前で実装する必要があった。さらに、アナウンス停止、リクエストIDの上限、OBS音声の途切れ、iOS SafariやAndroidの接続問題など、プロトコルや実装、ブラウザ・ネットワーク環境に関わる課題も共有した。</li></ul><h4>セッション3 — MoQ Optimization in Point-cloud Streaming</h4><ul><li>慶應義塾大学SFCの八谷航太氏が、点群ボリュメトリック映像の視野適応ストリーミングをMoQで実装。中品質でも毎秒2.4ギガビットに達するデータを、視聴者が見ている部分だけ送ることで現実的に扱えるようにした。</li><li>フレームドロップの原因を追い、購読解除時のRESET_STREAMによってリレーの送信キュー上にある送信待ちフレームが破棄されてしまうことを特定。forwardパラメーターで購読を保持することで、受信率をほぼ100%に改善した。</li><li>予測した視点位置に近いセグメントには高い画質を要求し、Subscriber Priorityを使って転送優先度も高く設定。同じ帯域でも近くの選手がはっきり見えるようになった一方、距離に基づく優先順位が視聴者の好みに合うとは限らず、この設計については検討を続けているとした。</li></ul><h4>セッション4 — ゲームのリアルタイム通信から見たQUICとMoQ</h4><ul><li>株式会社セガの竹原涼氏が、ゲームのリアルタイム通信に特有の要求を4つの観点から整理。同じタイトルの中でもデータごとに求められる特性が異なり、ジャンルや回線、端末によっても要求が変わることを示した。</li><li>Sonic RumbleでのQUIC導入では、TCPへのフォールバック率が0.014%と想定より小さく、多人数・高頻度の通信でもリアルタイム通信プロトコルとしてQUICが成立することを確認。一方で、ACKを含むパケット数が運用課題になった。SPHINGOへのQUIC追加では、Connection Migrationの仕様があっても、実装・検証・運用の仕事は残ると結論づけた。</li><li>MoQについては、ゲーム内のライブ配信やMMORPGのオブジェクト同期に可能性があるとしつつ、どのプレイヤーに何を発信するか、状態をどこで管理するかなど、ゲーム固有の設計が必要だと指摘。ゲームリアルタイム通信プロトコルコミュニティの現在の議論も紹介した。</li></ul><h3>Opening Remark</h3><p>by <a href="https://www.linkedin.com/in/tetta-maeda-3bb03917a/">Tetta Maeda</a>（MoQ Meetup Japan 運営）</p><p>初開催となるMoQ Meetup Japanは、運営を代表する前田氏の開会挨拶で始まりました。以下、その内容を紹介します。</p><p>このイベントは、Media over QUIC（MoQ）が好きな人たちが、思う存分に意見交換をするための場です。MoQはIETFでの標準化がかなり進んできていて、昨日draft-22がリリースされたばかりです。実装も増えてきて、話したいトピックがいろいろ出てきている時期だと思います。そこで、「話したい人と聞きたい人が集まれる場所を作ろう」と、今回の開催に至りました。今回の開催は、MoQのスペシャリストであるAliさんが来日するのに合わせたものです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ue2W3j1jFM_jTY15j0ZBtQ.jpeg" /></figure><p>本日の流れは、Aliさんのセッションから始まる4つのセッションのあとに、懇親会という予定です。</p><p>本日の飲食は、株式会社ブートストラップ様にご提供いただけることになりました。ありがとうございます。</p><p>参加者の皆さんには、学びがあれば「#MoQMeetup」「#MoQJP」のハッシュタグを付けて、XやFacebookなどのソーシャルメディアにどんどん投稿していただきたいと思います。</p><p>また、MoQ Meetup Japanでは次回のオープンミートアップに向けて、運営メンバーも登壇者もスポンサーも募集しています。興味のある方は、ぜひ後で声をかけてください。</p><p>それでは、本編に入りましょう。最初のセッションは、Aliさんです。</p><h3>The Art of The Switch: Seamless Rate Adaptation in MOQtail</h3><p>by <a href="https://ali.begen.net/">Ali C. Begen</a>（Özyeğin大学 / Networked Media）</p><p>動画の再生中に画質を切り替えても、映像が止まったり途切れたりしてはいけない。当たり前に思えて、これはとても難しい。ましてやレイテンシーが1秒を切るような超低遅延配信の世界では、切り替えのために与えられる猶予がほとんどありません。</p><p>登壇したのは、MoQの実装「<a href="https://moqtail.dev/">MOQtail</a>」の開発者であるAli C. Begen氏です。イスタンブールのÖzyeğin大学教授で、IPビデオを専門とするNetworked Mediaを率いています。シスコ時代には低遅延DASHの仕様策定に関わり、東京を訪れるのは今回で6、7回目だといいます。</p><p>「今日はトラック切り替えの話をします。アダプティブビットレートストリーミングには欠かせない技術だ」。そう切り出したAli氏は、まずMoQの土台であるQUICの説明から始めました。</p><ul><li>関連リンク：<a href="https://moqtail.dev/">MOQtail</a> / <a href="https://abr.moqtail.dev/">ABRデモ</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7A6Rd7wcX7KzE6lxQH2PmA.jpeg" /></figure><h4>QUICという土台</h4><p>MoQの土台にあるのが<strong>QUIC</strong>です。Googleが開発し、その後IETFに持ち込まれてRFC 9000として標準化されました。標準になってから5、6年が経ち、Safari、Edge、Chrome、Firefoxの主要ブラウザはすでに対応しています。QUICをトランスポートとして、HTTP/3も生まれました。</p><p>何が画期的なのか。Ali氏はTCPとの対比で説明します。TCPは単一のバイトストリームを運ぶプロトコルで、そこで<strong>ヘッドオブラインブロッキング</strong>が起きます。これはメディアストリーミングにとって致命的です。対してQUICは「多車線の高速道路」のようなもので、1本のコネクションの上で複数のストリームを並行して走らせられます。しかも、車線ごとに優先度を付けられます。</p><p>たとえばビデオ会議なら、音声とテキストメッセージを最優先にする。映像は、帯域に余裕があるときにだけ送ればいい。利用可能な帯域が音声だけで精一杯なら、優先度の高いものだけを送ります。</p><p>QUICはユーザー空間で動くので、輻輳制御アルゴリズムも再送の仕組みも、要件に応じてカスタマイズできます。ストリームはいつでもキャンセルできます。リアルタイムで映像を送っているとき、帯域が足りずにデータが溜まっていくとします。しかしビデオ会議で5秒前の映像を受け取っても意味がありません。滞留したストリームをキャンセルし、新しいIフレームから始まるストリームを開けば、バッファー遅延やキュー遅延をほとんど生まずに映像を流し続けられます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mf4FjJ5FAvtUwyT94sHdsg.jpeg" /></figure><p>すべてが暗号化されている点も重要です。ISPから見えるのは、あるマシンから別のマシンへのUDPコネクションが1本あるという事実だけ。中にいくつのストリームがあり、何が流れているかは分かりません。</p><h4>MoQトランスポートの性格</h4><p>MoQトランスポートの特徴は、まず<strong>遅延を調整できる</strong>ことです。配信のデッドラインを自分で決められます。次にキャッシュに向いていること。そしてHTTP/2のようなリクエスト・レスポンスではなく、RTSPに近い<strong>パブリッシュ・サブスクライブ</strong>型のプロトコルであることです。</p><p>メディアソースがパブリッシャーになり、視聴者がサブスクライバーになります。その間には、キャッシュ機能を担う1台以上の<strong>リレー</strong>が入ります。100万人に届けたいなら、100万人分を配るリレーネットワークが要ります。サブスクライバーが購読メッセージを送ると、それは次のリレーへ、さらに次のリレーへとパブリッシャーまで伝わり、そこからメディアが流れ始めます。購読解除するか、パブリッシャーが配信を終えるまで続きます。データはQUICアプリケーションとして、ブラウザなら<strong>WebTransport</strong>セッションとして運ばれます。WebTransportもIETFが標準化を進めており、まもなくRFCになる予定です。</p><p>Ali氏は、プロトコルはワーキンググループが設計するが、多くのことは実装者に委ねられていると強調します。たとえば、ネットワークに問題があるとき、帯域が足りないときにどう振る舞うか。その実装は実装者に委ねられており、それがAli氏の研究テーマです。</p><h4>遅延が問題になる場面と、ならない場面 — 既存プロトコルが埋められない隙間</h4><p>ここでAli氏は、ストリーミングの遅延をスペクトルとして整理しました。</p><p>YouTube LiveやNetflix、Hulu、Disneyといったライブ配信の多くは、45秒以上という高い遅延で動いています。もう少し短いセグメントを使い、15秒から45秒程度に収めるアプリケーションなら、DASHやHLSで十分に機能します。遅延をケーブルテレビやIPTV並みに下げたいなら、低遅延DASHや低遅延HLSを使います。これで3秒から5秒まで下がりますが、3秒まで縮めると非常に脆く、いつストールしてもおかしくありません。再生アルゴリズムが追いつけないことが多いのです。</p><p>リアルタイムの領域、つまり会議、ロボット、ドローン、メタバースのような用途にはWebRTCがあります。一方、Ali氏が着目したのは、遅延が1秒程度の配信です。この領域では、DASH/HLSによる配信のスケーラビリティと、WebRTCのリアルタイム性を両立することに課題があると説明しました。</p><p>WebRTCには、配信基盤として使う際の難しさもあります。STUN、ICE、TURNを用いた接続確立や、SFUを使った配信構成の設計・運用が必要になります。また、HTTPベースのCDNと同じようにコンテンツをキャッシュして配る仕組みではありません。遅延の制御や利用できるコーデック、DRMへの対応にも、ブラウザや実装による制約があります。</p><p>「既存のAPIと、いくつかの新しいAPIがあれば、このスペクトル全体をカバーできる」。Ali氏はそう考えました。オンデマンドにも、ライブにも、リアルタイムにもMoQトランスポートを使える。だからこそ今、MoQトランスポートが注目されているのです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rgy8bsiUV7voRFc4KwYElQ.jpeg" /></figure><p>MoQトランスポートの特徴をまとめると、遅延量が調整可能、適応的で優先度付きの配信、同期再生、そしてリレーネットワークによるスケーラビリティです。同期再生については、Amazon Prime VideoがSAIを使って複数プレイヤー間の再生を同期させている例を挙げました。アメリカンフットボールの権利元がSAIを配信に使い、全員が同じシーンを同時に見ているといいます。同じことはMoQでもでき、Ali氏らはすでにデモを作っています。</p><h4>ライブ配信のトラック切り替えはなぜ必要で、なぜ難しいのか</h4><p>たとえば、次のようなライブ配信をするとします。ライブ映像ソースとして日本対トルコのサッカーの試合をリアルタイムにエンコードし、4K、2K、1K、SDといった複数の解像度でパブリッシュします。音声もトルコ語、日本語、英語と複数用意し、字幕も付けます。プレイヤーはそれぞれのトラックを購読し、リレーを経由してコンテンツを受け取ります。映像トラックは同時に1つだけ使いますが、リレー上にはすべてが揃っている必要があります。</p><p>トラック切り替えが起きる理由は、ABRに関わるものと、そうでないものに分けられます。</p><p>ABRに関わる理由とは、クライアント側の利用可能帯域が下がれば解像度を下げた動画に切り替え、バッファーが少なければストールを避けるために画質を下げ、余裕があれば画質を上げる、といった制御によるものです。コンテンツの種類も関係してきます。サッカーなら低遅延で見たいので多少画質を犠牲にし、映画なら遅延を気にしないので4K映像を、再生バッファーを多めに確保して見たいといった具合です。</p><p>ABRに関わらない理由は、ユーザーの操作に起因します。カメラを切り替える、360度映像で頭を動かす、言語を切り替える。あるいはデータ通信です。Ali氏は日本でeSIMを買ったそうですが、データ容量には上限があります。そのようなeSIM通信環境では、4Kを見たくないし、小さなiPhoneの画面で4Kは必要ありません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*po3OC79aajXl5VkJWX1Q8A.jpeg" /></figure><p>ここで問題になるのが情報の非対称性です。クライアントはバッファーや帯域などプレイヤーの状態をよく知っていますが、リレー上のトラックの状態は知りません。リレーはリレー上に何があるかを知っていますが、プレイヤーの状態は知りません。<strong>どちらも完全な情報を持ってはいない</strong>。両者の情報をどう混ぜ合わせ、完璧な切り替えにつなげるかがポイントです。</p><h4>トラック切り替えに求められること</h4><p>Ali氏は、トラック切り替えの要件を挙げました。再生を止めないこと。切り替えるからといって再生を停止してはなりません。切り替えたときに映像が飛んだり巻き戻ったりしないこと。大事なシーンを見逃しかねません。そして無駄を最小化すること。再生に使わないデータを受け取るのは無駄であり、2つのトラックを同時に購読して片方しか使わないのは典型的な無駄です。</p><p>切り替えが起きうるのは<strong>GOP (Group of Pictures) 境界</strong>だけです。DASHやHLSではセグメント境界にあたり、MoQでは新しいIフレームが現れるグループの先頭がそれに相当します。そこからでなければデコードを始められません。</p><h4>切り替え方式の変遷</h4><p>もっとも素朴なのは、古いトラックの購読を解除してから、新しいトラックを購読する方式です。しかし、リレー上に新しいトラックがなければ上流リレーまで取りに行く必要があり、新しいデータの受信が始まるまでにギャップが生じる可能性があります。ギャップを埋めようとバッファリングすれば、再生が止まります。</p><p>次は、解除を遅らせる方式です。新しいトラックを受け取り始めてから古いトラックを解除するので、少なくともギャップは生じません。ただしその間は2つのトラックを同時に受信することになり、帯域を理由にABRをしている場合には状況を悪化させます。</p><p>これに対してAli氏らが4年前、学生とともに考案したのが「<strong>Switch Track</strong>」の提案でした。トラック2へ切り替えたいとき、「トラック1から来た」という情報を添えて購読します。リレーはトラック2のオブジェクトを送り始めると同時にトラック1を止めます。冗長なデータは発生せず、切り替えはシームレスになります。Ali氏は「とてもきれいな解法だった」と振り返ります。ですが当時のワーキンググループには少し早すぎ、採用は見送られました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTKQ6Knvc2vSUT3ACo84lA.jpeg" /></figure><p>その後、ワーキンググループはもっとうまくやれると気づきます。両方のトラックを同時に購読しつつ、片方を<strong>forward 1</strong>、もう片方を<strong>forward 0</strong>（データを送らない指定）にする方式です。切り替え時にrequest updateを送り、片方を止めてもう片方を流します。上流から取りに行く遅延は避けられますが、トラック間でグループが揃っていないケースには対応できません。</p><p>グループが揃わない問題は、例外的な状況のようでいて、多くの実装ではむしろ日常的に発生しうるといいます。異なるトラックのグループが同時にリレーへ届くとは限りません。30fpsなら2フレームのずれは67ミリ秒程度で、十分に起こりえます。切り替え先のトラックが遅れていれば、リレーは次のグループのデータを待つ必要がありますが、そのズレがバッファー量を超えれば再生が止まります。逆に切り替え先が早ければ、Iフレームを<strong>Joining Fetch</strong>の仕組みで取得したうえで購読を続けることになります。</p><p>Ali氏は、先週イスタンブールで開かれたIEEE MMSP 2026で、これらの方式を比較した学生の論文が発表されたことにも触れました。同会議では、サブスクライバー主導・リレー実行のトラック切り替えを論じた「Zero Gap, Zero Waste: Subscriber-Initiated, Relay-Executed Track Switching in MOQ Transport」と、リレー側でレイテンシ予算を考慮するレート適応を論じた「Relay-Side Latency-Budget-Aware Rate Adaptation in MOQ Transport」の2本が発表されています。</p><h4>マルチバリアント符号化を活用した高速ABR</h4><p>ここからが本題です。低遅延の世界で、いかに速く切り替えるか。</p><p>GOP境界でしか切り替えられないという性質は、DASHやHLSと同じです。長いGOPにしてしまうと、切り替えの機会がその間訪れません。4Kに切り替えた直後に帯域が足りないと気づいても、次のGOP境界まで待つしかありません。かといってGOPを短くしすぎると、符号化効率が落ち、画質が劣化します。</p><p>このジレンマへの答えが、低遅延DASHでも使われた<strong>マルチバリアント符号化</strong>です。同じコンテンツを、0.5秒、2秒、6秒といった異なるGOP長で複数のトラックに符号化しておく。通常はもっとも高画質な6秒GOPに留まり、切り替えのときだけ短いGOPのトラックを使います。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCxhgIXbsf2g8cYk-ZCnYQ.jpeg" /></figure><p>6秒、2秒、0.5秒の3つのバリアントを例にすると、0.5秒ブロックはIフレームの頻度が高い。視聴者が切り替えを選ぶと、まず0.5秒ブロックでIフレームを掴み、次に2秒ブロック、そして最終的に6秒ブロックへと移っていきます。切り替え遅延を最小化しつつ、できるだけ早く高画質へ戻す狙いです。</p><h4>リレー側トラック切り替えとレイテンシバジェット</h4><p>もうひとつの方式が、リレー側でトラックを選ぶ<strong>sender-side track switching</strong>です。</p><p>サブスクライバーは、4K、2K、HDといった複数のrepresentationと、それぞれに必要な最小帯域をリレーに伝えます。リレーは帯域の情報をもとに、各グループ境界で、利用可能帯域以下でもっとも高画質なトラックを選びます。3つのトラックを購読はするものの、実際に転送されるのは1つだけ。これは高速な切り替えではなく、通常の切り替えです。</p><p>ここに<strong>レイテンシバジェット</strong>という考え方を付け足します。初期情報に「配信レイテンシーは500ミリ秒以内にしたい」といった条件を付けて伝えるのです。リアルタイムで見る必要があるライブスポーツ映像なら500ミリ秒、タイムシフトで見ているなら5秒、といった具合です。帯域が足りていても、そのトラックがレイテンシバジェット内に届かなければ選択肢から外れます。</p><p>ただし、QUIC層から得られる帯域情報はそれほど素直ではありません。Cubic、BBR、Copaといった輻輳制御アルゴリズムによって挙動が変わり、値はノイズを含みやすい。そこでAli氏らは、帯域を直接測るのではなく、メディアの<strong>アクティブストリーム数</strong>に着目しました。</p><p>MoQでは、次のグループを送るときに新しいストリームを開きます。帯域に余裕があれば、1つのグループを次のグループが来る前に送り切ってストリームを閉じられるので、同時に開いているストリームは常に1本です。ところが帯域が足りないと、前のグループを送り切る前に次のグループが来てしまい、2本目のストリームが重なります。さらに細くなれば、3本、4本と積み上がっていきます。</p><p>つまり、<strong>重なったストリームの本数が、そのまま「送り切れていない度合い」</strong>を表します。絶対的な帯域を測るのではなく、送信キューにどれだけ滞留しているかを数えているわけです。この深さが増えれば輻輳していると判断してレートを下げられます。Ali氏は、この方法が驚くほど簡単で、よく機能するといいます。</p><h4>SWITCHメッセージの標準化</h4><p>ここまでの方式を、Ali氏は次のように整理しました。</p><p>最初に開発した<strong>SWITCH</strong>メッセージは、むだの最小化とシームレスな切り替えを両立し、必要な制御メッセージは1つだけです。ほかの方式では4つを要します。詳細は論文にまとめられています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHcJkKllkHzyxMNMG6T2wQ.jpeg" /></figure><p>ワーキンググループでの議論を経て、このメッセージはより単純な設計へと収束していきました。Ali氏らの提案はPull Requestとして提出されており、2本のPRが存在します。Ali氏は「このPRは是非マージされてほしい。このメッセージがなければABRはうまく機能しない」と述べました。</p><p>リレー側トラック切り替えのほうも、アクティブストリーム数による方式がよく機能し、実装も論文もあるといいます。</p><h4>デモ</h4><p>最後にデモが披露されました。</p><p>デモ環境には世界各地の4台のリレーがあり、大阪、シンガポール、ヨーロッパ、北米シカゴに置かれています。開発用にはフランクフルトのリレーもあり、これまでのデモもそこで動いています。会場からはもっとも近い大阪のリレーが選ばれました。Ali氏は数週間前にIBC（アムステルダム）でこのデモを披露したばかりだといいます。デモはMOQtailのABRデモサイト（<a href="https://abr.moqtail.dev/">abr.moqtail.dev</a>）で公開されています。</p><p>映像は事前収録されたものですが、リアルタイムにエンコードされ、ライブソースとして扱われます。フルHD、6秒GOPで、遅延は約600ミリ秒。そこから300ミリ秒、さらに180ミリ秒まで下げても配信が行えています。25fps映像なので、4〜5フレーム分の遅延です。エンコード、パッケージング、転送、再生バッファーをすべて含めてこの遅延量だといいます。バッファーを増減させるために再生速度を調整していることも、画面越しに確認できました。</p><p>解像度は540p、720p、1080pの3種類、GOP長は6秒、2秒、0.5秒の3種類で、合計9トラック。同じ解像度ならビットレートは同じでも、GOPが長いほど画質がよくなります。720pへダウンスイッチするとき、6秒のGOP境界が近ければそのトラックへそのまま移り、逃していれば0.5秒や2秒のトラックへジャンプし、できるだけ早く6秒ブロックへ戻ります。クライアントが的確にトラックを選んでいる様子が示されました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaI8RMndZqTfTRCnJ2pkcw.jpeg" /></figure><p>設定画面にはネットワークエミュレーターもあり、遅延やパケットロス、帯域プロファイルを適用できます。統計ボタンを押すと、バッファー残量、遅延、リアルタイムに対する再生速度、ストール時間が表示されます。</p><p>デモには手動切り替えもあり、リレー側の切り替えは「coming soon」として用意されています。今後の課題は、リレーの支援を受けずにクライアントだけでABRを判断する方式だといいます。「数か月以内には実現したい」とAli氏は語りました。</p><p>締めくくりに、Ali氏は<strong>OpenMOQ</strong>を紹介しました。大学も参加する業界コンソーシアムで、オープンソースのMoQソフトウェア、とくにリレーコンポーネントの開発を進めています。MOQtailもこの活動に参加しているとして、興味があればサイトを見て、ぜひ参加してほしいと呼びかけました。</p><p>デモに使われた画像について、Ali氏はそれが日本でも人気だったかを会場に尋ねました。化学教師が凶暴化していくという、あの海外ドラマです。会場からは笑いが起こり、発表は和やかに幕を閉じました。</p><h3>バーチャルタレントのリアルイベントを支えるMoQ — HYPER STUDIOの採用事例</h3><p>by 菊地諒（<a href="https://bt-strap.com/">株式会社ブートストラップ</a>）</p><p>バーチャルタレントがリアルの会場にいるファンと会話する。言葉にすると単純ですが、遠隔地のタレントと会場のスクリーンをつなぎ、双方向の会話と映像配信を同時に成立させるのは、そう簡単なことではありません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2LfrBlPvEfb1Odpsewrr3g.jpeg" /></figure><p>登壇したのは、株式会社ブートストラップの菊地諒氏です。同社は、バーチャルタレント・VTuber向けのリアルイベントプラットフォーム「<a href="https://aiai-s.com/">AIAI</a>」をActiv8株式会社と共同で展開し、通話と配信を統合したアプリ「HYPER STUDIO」を開発しています。</p><ul><li>関連リンク：<a href="https://aiai-s.com/">AIAI</a> / <a href="https://hyper-studio.app/">HYPER STUDIO</a></li></ul><h4>まずはAIAIの話から</h4><p>バーチャルタレントがリアルの会場でファンミーティングやトークイベント、ミニライブ、DJイベントを開くために、企画の相談からチケット販売、当日の運営、売上の精算までを一貫して支えるプラットフォームがAIAIです。</p><p>駆け出しのバーチャルタレントがイベントを開こうと思っても、会場がなかなかありません。通常の会場では採算ラインが100人規模になりがちで、それだけの動員が見込めないと開催に踏み切れないのです。そこでAIAIは、もっと小規模でも気軽にイベントを開けるようにと、少人数でも開催できるように作られました。</p><p>最初の会場は、東京・初台にあるバーの「<a href="https://x.com/kaiwai_hatsudai">KAIWAI初台</a>」です。タレントは遠隔地から出演し、店舗のスクリーンに映ります。来場したファンはお酒を楽しみながら、画面のタレントと会話できます。実際の会場にはディスプレイが2台並んでいて、ここにタレントが参加する形です。</p><h4>既成ツールの限界</h4><p>当初、配信と通話にはDiscordを使っていました。ところが、いくつか困ったことがありました。</p><p>配信品質が一度でも低下すると画質が落ちたまま戻らないことがあり、そのままイベントが進んでしまう。また、会場での操作時にDiscordの画面やマウスカーソルがスクリーンに映り込むことも、課題でした。しかも会場にはスクリーンが複数あり、その管理と運用が大変でした。イベントの体験として、ここは何とかしたい。そうして自前のアプリを作ることになりました。</p><h4>HYPER STUDIOというアプリ</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wq88mKUPTGjrZvX1dA5jqw.jpeg" /></figure><p>こうして生まれたのが、遠隔地のタレントと店舗をつなぐアプリ「HYPER STUDIO」です。操作感はDiscordに近く、タレントはルームに入り、バーチャルカメラや画面共有を使って映像を現地へ届けます。遅延と画質のバランスを調整し、イベントの体験品質を最大化することを狙っています。</p><p>コンソールの画面では、タレントが自分の配信映像を確認しながら、実際に店舗へ配信している様子もモニタリングできます。</p><p>システム構成としては、通話セッションとオーディオ、店舗に置く端末用のサテライトアプリ、そしてタレントがよく使うOBSから直接配信するためのサーバーがあります。OBS以外の映像と音声の伝送にはNDIを使い、OBSまわりはWebRTCを使います。データはいったんブリッジへ送り、そこで載せ替えます。セッションやサテライトは、Cloudflare Workers上でGraphQLを通し、WebSocketで接続して制御しています。</p><h4>WebRTCからMoQへ</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2WUgzw9pOShxosioppPQw.jpeg" /></figure><p>菊地氏らは、最初からMoQを使っていたわけではありません。プロトタイプの段階では、WebRTCのライブラリである<a href="https://livekit.io/">LiveKit</a>を使って実装していたといいます。ただ、この構成だとコンテナが4台ほど必要になり、できたばかりの小さなサービスのために多くのサーバーを立てて動かすのは正直しんどいと感じていました。</p><p>そこで目を付けたのが、CloudflareのリアルタイムSFUでした。実験で使ってみようと進めていたちょうどその頃、CloudflareがTech Preview中だったMoQリレーを一般公開し始めたニュースを見て、「じゃあ試しに使ってみよう」という軽い気持ちで導入したといいます。</p><p>実際、導入はほとんどコードを書くことなく、1日でテストまでたどり着きました。LiveKitからリアルタイムSFUへの切り替えが30分ほど、リアルタイムSFUからMoQリレーへの切り替えも30分ほど。「本当に気軽に導入できた」と菊地氏は振り返ります。</p><h4>導入してよかったこと</h4><p>CloudflareのMoQリレーは、ベータとして使う間は無料です。小さなテストはもちろん、店舗全体のスクリーンに流したり、ライブで配信したり、ストレージを試したりしてもコストがかからないため、実験がしやすいと菊地氏は言います。ただしテスト中のサービスなので、常に必ず使える保証はありません。動かない場合に備えて、自前でMoQリレーを動かし、そちらへ切り替える構成も用意しています。</p><p>インフラの面でも変化がありました。以前はすべてをコンテナで動かしていましたが、いまはほとんどがサーバーレスです。継続的に動かし続ける必要があるリレーだけをコンテナで動かし、リモートで運用しています。</p><p>店舗の端末が複数ある点も、逆に活かせるのではないかと考えています。端末に入れたサテライトアプリの中でMoQリレーを動かし、複数のスクリーンへ配る。まだ準備と実験の段階ですが、そんな構成も見えてきたといいます。</p><p>何よりよかったのは、画質と遅延を自分たちである程度制御できるようになったことです。遅延はおよそ50ミリ秒から400ミリ秒、解像度は700×400、帯域は最大10メガビット毎秒程度まで、タレントのインターネット回線に合わせて、リハーサルの段階で柔軟に上げ下げできます。WebRTCに比べて扱いやすくなったと菊地氏は言います。遅延や帯域の情報もHTTPで流し、端末からコンソールへ出してスタッフが確認できるようになりました。</p><h4>MoQで苦労したこと</h4><p>いいことばかりではありません。むしろ、ここからが今日の本題です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKG6OIcRgaWt8NnNKdo58Q.jpeg" /></figure><p>WebRTCでは、音声の遅延調整やいったんの休止、音と映像のずれの補正まで、ブラウザが全部面倒を見てくれます。使う側はほとんど意識しなくて済む。ところがMoQでは、届いたデータをWebCodecsで再生する部分を自分で作らなければなりません。音声が先に届いて映像が遅れてしまうと、喋っている声と映像がずれる。映像と音声を合わせる実装が必要でした。</p><p>遅延をなるべく小さくしようとすると、パケットが欠けた瞬間に音が途切れたり、クリックノイズが頻発したりします。受信側で遅延に合わせて再生速度を調整するといった、WebRTCなら内部でやられているような処理を自前で実装しました。</p><p>再生速度も悩ましい問題でした。WebRTCは最速で2倍速ほどまで早回しできますが、このサービスではタレントが楽曲を演奏することもあります。音のスピードが変わると困るのです。そこで、音声の再生速度は、変化が気づかれにくいよう緩やかに調整しています。</p><p>MoQのプロトコルまわりでも、いくつも問題が起きました。菊地氏が使ったのは、MOQTのドラフト16と、MoQ Liteです。ローカルでエンコード・パッケージングする分には問題なく動いても、Cloudflareのリレーを経由して実際にデータを流すと、次のような問題が現れました。</p><ul><li>配信の一覧がアナウンスで届くものの、それが途中で止まってしまい、配信中に映像や音声が流れなくなる。通信状況を集約して一元的に管理する必要があるという結論に至った。</li><li>接続ごとに増えていくリクエストIDが、50回ほど起動すると上限に達し、「それ以上リクエストを受けられない」と返ってくる。上限に達したら新しい接続を追加し、そこから次のデータを送るようにした。</li><li>OBSの音声が途切れる。ブリッジで音声を一定時間ごとに別のグループにまとめて送ることで、症状をやわらげた。</li><li>そもそも接続できない環境がある。iOSのSafariでは、しばらく通信したあとに止まってしまう現象があり、これはWebKitのバグとして報告されていて、すぐには直らない。AndroidでもQUICがつながらない環境がある。こうした環境向けには、自前のリレーへの切り替えや、WebSocket経由での通信によって、通話を継続できるようにした。</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*On-3ovuGn-VHI-gLRmBdmw.jpeg" /></figure><p>ドラフト16とMoQ Liteの仕様の違いや、つながらない問題は、アプリやブリッジ、ライブラリへフィードバックしながら1つずつ解決していきました。</p><h4>標準化までの付き合い方</h4><p>HYPER STUDIOは、通話と配信を統合し、映像と音声をMoQで運ぶアプリとして形になりました。Cloudflareのおかげで、小さく手を動かして始められ、配信を自分たちでコントロールできるようになった。その代わりに、WebRTCなら誰かがやってくれていた再生の部分を、自分たちで作り直すことになった。菊地氏はそう総括します。</p><p>この仕様が標準化されるまでは、ドラフトを追いかけながら作っていくことになります。それでも、プロトコルに寄り添いながら、自社開発も含めて何とか追いかけていけるのではないか。菊地氏はそう見ているようです。</p><p>発表の最後には、実際のコンソールの画面が披露されました。タレントがセッションに入り、OBSから配信を始めると、それがブリッジに接続され、現地の端末へ届く。いまどれくらいの遅延で、どれくらいの帯域で映像が送られているかが一目で分かります。バーチャルタレントのイベントを円滑に進めるための、現場のツールがそこにありました。</p><h3>MoQ Optimization in Point-cloud Streaming</h3><p>by <a href="https://kota-yata.com/">八谷航太（Kota Yatagai）</a>（慶應義塾大学 環境情報学部）</p><p>野球の試合を、スマートフォンから3Dの視点で見られたら。選手の周りを自由に動きながら、好きな角度からプレーを眺められたら。八谷航太氏は「そんなサービスがあるなら、今のサブスク料金の3倍は払う」と笑いながら、その研究を紹介しました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKLOWNGkgxLLwgzd9gvxDg.jpeg" /></figure><p>登壇したのは、慶應義塾大学SFCの学部生で、スポーツ向けのボリュメトリック映像ストリーミングを研究する八谷氏です。JitsiやWireshark、MoQ関連のソフトウェアにも貢献し、いまはUnreal Engineのような重いアプリケーションでも使えるよう、依存関係を小さく抑えたMoQクライアントライブラリを開発しています。</p><ul><li>発表スライド: <a href="https://slide.kota-yata.com/moq-meetup-japan/">https://slide.kota-yata.com/moq-meetup-japan/</a></li><li>関連リンク：<a href="https://kota-yata.com/">kota-yata.com</a> / <a href="https://github.com/kota-yata">GitHub</a></li></ul><h4>点群ボリュメトリック映像とは</h4><p>点群（point cloud）のボリュメトリック映像は、たくさんの点でできた3D映像です。周囲を複数のカメラで撮影することで、どの位置からでも、どの角度からでも見ることができます。点群からメッシュや3Dガウシアンスプラッティングを生成することもできますが、リアルタイムの用途では、符号化のしやすさから生の点群が使われます。</p><p>近年、ボリュメトリック映像はスポーツのリプレイ映像生成に使われています。冬のオリンピックのスケート、東京ドームの野球などが例として挙げられました。東京ドームでは球場を囲む150台のカメラで撮影し、3秒でリプレイを生成しているといいます。八谷氏は、ボリュメトリック映像自体のライブストリーミングを研究しています。研究用データセットとして東京ドームと同じ構成をUnreal Engine上で再現しています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tqnn5-6rqp5RE8bxwE4yOg.jpeg" /></figure><p>既存のリプレイ生成は、シーンの中で仮想カメラを動かして映像を作っているだけで、3Dオブジェクトそのものを視聴者のデバイスへ送っているわけではありません。3Dオブジェクトそのものをライブで配ろうとすると、立ちはだかるのがデータ量です。八谷氏が自分のデータセットで測ったところ、中程度の品質でも毎秒2.4ギガビット。とても一般家庭のWi-Fiでは流せません。</p><h4>視野適応ストリーミング</h4><p>そこで使われるのが、<strong>視野適応ストリーミング（field-of-view adaptive streaming）</strong>です。視聴者が見ている部分だけを送る、という考え方です。</p><p>送信側はまず、シーンを複数のセグメントに分割します。野球場なら、フィールドを均一な立方体やタイルに切るイメージです。視聴者側のアプリケーションは、数フレーム先の視野を予測します。八谷氏の実装では150ミリ秒ほど先です。そして、予測した視野と交差するセグメントをリクエストします。予測は毎フレーム、または少なくとも5フレームに1回行われます。トランスポートにも頻繁な更新を反映できることが求められ、きめ細かな制御と低遅延が必要になります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ul4A_FRq-fUDx1Y27bGFtA.jpeg" /></figure><h4>なぜMoQなのか</h4><p>では、MoQはその配信プロトコルの候補になるのか。八谷氏の答えは「イエス」です。</p><p>HLSやDASHのようなセグメントベースのプロトコルは、予測の結果をセグメントやブロック単位でしか反映できません。ふつう2秒から5秒単位なので、この用途には合いません。WebRTCはリアルタイム性に優れますが、点群のような任意のバイナリデータを送るにはデータチャネルを使い、リクエスト・レスポンスを扱う独自のメディアプロトコルを載せる必要があります。一方、MoQはメディアに依存しないパブリッシュ・サブスクライブ型のプロトコルです。どんなペイロードでも載せられ、コアの機能をそのまま使えます。低遅延でスケーラブルなメディア伝送のために設計されており、ボリュメトリック映像のストリーミングにもっとも近いプロトコルだと八谷氏は考えました。</p><h4>MoQで組んだ検証システム</h4><p>八谷氏は、MoQで視野適応ストリーミングのシステムを組みました。1本のMoQトラックが1つのセグメントストリームに対応します。クライアント側は自作のMoQライブラリ、リレーにはMoQtailリレーを使いました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQb8Y_Anm25nsEBNd2C8qw.jpeg" /></figure><p>本来ならパブリッシャーがその場で映像を生成しますが、リアルタイムのエンコードにはGPUが要ります。GPUを持っていない八谷氏は、7秒分のデータセットを事前にエンコードし、パブリッシャーがそれを繰り返し配信する形にしました。サブスクライバーは、予測した視野に入るトラックへ購読メッセージを送り、予測から外れたトラックには停止のシグナルを送ります。「シンプルに聞こえるかもしれないが、このシステムを作るのに夏休みを丸ごと使った」と八谷氏は振り返ります。</p><h4>フレームドロップの原因はreset streamだった</h4><p>ここからが本題です。最適化の話です。</p><p>システムを動かして最初に気づいたのは、フレームがときどき落ちていることでした。オブジェクトがちらついて見えます。しかも、ほぼ常に起きていました。</p><p>八谷氏はまず、頻繁な購読の入れ替わりのせいでリレーのCPUを使い切っているのではないかと考えました。しかし、それは間違いでした。購読の更新はワーストケースでは毎フレーム起こりえますが、MoQtailのTokioランタイムに10コア割り当てても、最大で3コアしか使われていません。サブスクライバーを50、100と増やしても同じでした。リレーのオーバーヘッドは問題ではなかったのです。</p><p>原因を追っていくと、<strong>reset stream</strong>に行き着きます。最近のMoQでは、サブスクライバーが購読を解除すると、まずSTOP_SENDINGという制御メッセージを要求ストリームで送ります。するとリレーは、その購読に属するすべてのストリームへRESET_STREAMを送り、ストリームを即座にキャンセルします。これは、リレーの送信キューに並んでいたオブジェクトも破棄されることを意味します。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zG2o5Jo5tlM7H50NBWMJtA.jpeg" /></figure><p>問題は、このアプリケーションではサブスクライバー自身が予測を行っている点にありました。停止を送ったあとでも、まだ受け取りたいフレームがリレーの送信キュー上に残っています。ところが、送信キューにあったそれらのフレームが、ネットワークへ送られる前にキャンセルされてしまう。実際、実験中に失われたフレームのほとんどは、ストリームの最後の2フレームほどに集中していました。</p><h4>forwardパラメーターで直す</h4><p>原因が分かった八谷氏は、<strong>forwardパラメーター</strong>でこの課題を解決しました。</p><p>forwardは購読に付く二値のパラメーターです。forward 0を指定したSUBSCRIBE_UPDATEを送ると、購読自体を保持したまま、オブジェクトの転送を一時停止できます。重要なのは、reset streamによる購読解除のように既存のストリームを即座にキャンセルする操作ではないことです。八谷氏の検証では、この方法に切り替えることで、送信キュー上に残っていた末尾フレームのデータがストリームのリセットによって破棄される問題を防げました。</p><p>もともとforwardは、購読を事前に温めておいて低遅延化するために定義されたものだといいます。それが、視野予測の追従にも役立ったのでした。forwardパラメーター方式に切り替えた結果、オブジェクトの受信率はほぼ100%に上がり、購読解除時のフレーム破棄に起因するちらつきは解消しました。ただし、帯域が限られる環境では別のちらつきが残りました。</p><h4>見えているところを高画質に — Subscriber Priority</h4><p>すべて解決したかというと、そうでもありません。4メガビットのWi-Fiでは映像はまだちらつきますし、野球を見ていると視野に内野全体が入ることが多く、視野適応にしても帯域の削減効果は限定的でした。</p><p>そこで八谷氏は、予測した位置に近いセグメントほど高画質を要求するようにしました。以前は帯域を考えて全セグメントを低画質で要求していましたが、対応するセグメントが予測位置を含むなら中画質を、それ以外は低画質を要求する形に変えたのです。</p><p>さらに、近いセグメントほど高い優先度を割り当てました。使ったのは<strong>Subscriber Priority</strong>です。これはサブスクライバーが購読ごとに設定する優先度で、リレーはそれを基に次に何を送るかを決めます。MoQにはPublisher PriorityやGroup Orderもありますが、オブジェクトの送信順序を決める際には、Subscriber Priorityが先に考慮されます。八谷氏は、予測位置からの距離と角度でセグメントの優先度を計算し、8段階の優先度に分けました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iCRPIsri6_J5qm37QJUy0A.jpeg" /></figure><p>結果として、同じ帯域でも、ショートストップや二塁へ走るランナーなど、近いセグメントははっきり見えるようになりました。その代わり、それ以外のオブジェクトはあまり送られません。ただし、視点に近い領域を優先して送る設計は、全員の好みに合うとは限りません。人によっては「全部を低画質で見たい」「高画質のショートストップより、一塁を走る選手を見たい」という希望もあり、この設計には改善点があると八谷氏は認めます。この点は今も検討を続けているところです。</p><h4>まとめ</h4><p>八谷氏は最後にこうまとめました。forwardは、視野予測に伴う購読更新で、必要な末尾フレームのデータが破棄される問題を防ぐのに役立ち、Subscriber Priorityは視点の近くのセグメントの品質を高めるのに役立った。そして、自分が試した範囲では、ボリュメトリック映像の視野適応ストリーミングは実環境でもよく動くように見える、と。</p><p>「Happy Moqing」と締めくくった発表は、自由視点映像の可能性を感じさせるものでした。</p><h3>ゲームのリアルタイム通信から見たQUICとMoQ</h3><p>by <a href="https://x.com/takehara3586">竹原涼</a>（<a href="https://www.sega.co.jp/">株式会社セガ</a>）</p><p>ゲームのリアルタイム通信とひとくちに言っても、その要求は驚くほど多様です。同じタイトルの中に、性質のまったく違う通信が共存している。だからこそ、QUICやMoQをどこにどう使うかを判断するのは簡単ではありません。</p><p>登壇したのは、株式会社セガの竹原涼氏です。開発支援を担う部門に所属し、自動化やサウンド、リアルタイム通信に関する開発支援を行っています。CEDECではAI開発推進の話などをしており、個人でもプロトコル開発の技術検証を行い、ゲームリアルタイム通信プロトコルコミュニティを主催しています。今回は、そのコミュニティからの縁で登壇しました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mFXb5Ir76b2KqAb393wsw.jpeg" /></figure><p>普段はゲーム業界の外の人にリアルタイム通信の話をする機会があまりないという竹原氏は、まずゲーム特有の要求から話し始めました。</p><ul><li>発表スライド： <a href="https://speakerdeck.com/segadevtech/gemu-no-riarutaimu-tsuushin-kara-mita-quic-to-moq">ゲームのリアルタイム通信から見た QUIC と MoQ</a></li><li>発表資料： <a href="https://www.slideshare.net/slideshow/cedec-2025-quic-936f/282204153">CEDEC 2025「ゲームにおけるリアルタイム通信へのQUIC導入事例の紹介」</a></li><li>関連リンク：<a href="https://github.com/TakeharaR/game-realtime-protocol">「ゲームリアルタイム通信プロトコル」コミュニティー</a></li></ul><h4>ゲームのリアルタイム通信が抱える要求</h4><p>竹原氏は、ゲームのリアルタイム通信に特徴的な要求を、4つの観点から整理しました。</p><p>1つ目は、同じゲームの中でもデータによって求められる特性が異なることです。ゲームプレイだけでも、操作の入力、キャラクターの位置やHPといった状態の同期、アイテム取得のイベントなど、さまざまなデータをやり取りします。さらに、仲間とのチャットや、映像・音声を使った通話や配信を必要とするゲームもあります。届けたいデータの意味も、重要性も違います。</p><p>たとえば、ほかのプレイヤーの移動を通信する場合、最新の位置をすばやく知ることが重視され、途中のデータの欠落や到着順序の入れ替わりはある程度許容できる、という設計がよく採られます。一方でアイテムの取得は、1つのアイテムを誰が取ったかを一意に確定させる必要があります。複数人が同時に取得してしまうようなことがあってはなりません。仲間の位置やステータスも、現在の正しい値を表示しつつ、位置情報ほど高い頻度は要らない。つまり、リライアブルかアンリライアブルかという単純な話ではなく、ゲームごとの設計に合わせてデータの扱いを決める必要があるのです。</p><p>2つ目は、ゲームのジャンルによる違いです。格闘ゲームなら、相手の攻撃に合わせて防御したい場面で、ボタンを押したタイミングが結果に影響します。即座に反映し、同じ攻撃・防御の結果になることが重要です。MMORPGのように多数のプレイヤーが同時に遊ぶゲームでは、世界を移動する場面でプレイヤーやオブジェクトの数が多く、通信量と処理負荷をどう取り扱うのかが大事になります。たとえば、自プレイヤーの周囲で起きていることを優先して通信するといった具合です。ターン制のカードゲームなら、行動を順番に受け付け、どのような結果で確定したかが重要になります。反面、リアルタイム性はそれほど重要ではなく、遅延には寛容です。</p><p>3つ目は、回線環境と端末の多様性です。ゲームは世界中で遊ばれており、各地の家庭の回線や無線環境を想定しなければなりません。その範囲でできるだけ多くの人が快適に、平等に遊べることが重要になります。映像や音声のサービスでも同じ課題はありますが、ゲームでは複数のプレイヤーが同じ出来事に双方向で働きかけるため、様々な遅延がある中でどれだけ待つか、どれだけ補正をかけるかが難しいポイントになります。</p><p>4つ目は、クロスプラットフォームです。PCやスマートフォンに加え、家庭用ゲーム機も含めて同じゲームを展開したいという要求がよくあります。プラットフォームによって開発環境や組み込めるライブラリの条件が異なり、採用したい通信ライブラリのOSSがあったとしても、そのまま使えるとは限りません。移植やゲームエンジンとの連携、実機での動作確認、その後の保守まで必要になることが多く、とくに閉じたプラットフォームでは公開情報だけでは判断できず、検証と組み込みのコストが非常に高くなることも珍しくありません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLUP2GHnTciKrMYvk71k_w.jpeg" /></figure><h4>ゲームならではの工夫</h4><p>こうした要求に対して、ゲームでは独自の工夫が積み重ねられてきました。竹原氏は、要求を直接解消するというより、ユーザー体験をどう快適にするかという観点のものを5つ紹介しました。</p><p>1つ目は、クライアント側での先行計算です。たとえば格闘ゲームでは、移動ボタンを押すたびにサーバーの返事を待ってから画面に反映していたら、キャラクターは遅延の分だけ遅れて動き、体験が悪くなります。そこで、自分の操作はローカルで先に計算して画面に反映しておき、あとからサーバーから返ってきた結果がほかのプレイヤーとのインタラクションで違っていたら補正します。Webの「いいね」ボタンで、まだサーバーに届いていないのに画面上は押したことになっている、あの感覚に近いものです。ただしゲームでは、返事を待っている間にほかのプレイヤーが何か操作して影響を与えているかもしれず、より複雑で難しいといいます。</p><p>2つ目は、補間です。対戦相手の位置情報を届くたびに反映していると、遅延などの影響で動きが飛び飛びになります。相手のデータが一定間隔で届くとは限らないためです。そこで、少し過去の位置情報を蓄えておき、最新の情報と合わせて補間し、移動を滑らかに見せます。音声通話でパケットの到着のばらつきをバッファーで吸収するのと似た考え方です。ただしバッファーを増やすほど遅延が増えるので、ボタンを押したらすぐ動くという操作性とのトレードオフになります。</p><p>3つ目は、ロールバックです。格闘ゲームのように遅延が体験に直結するゲームでは、対戦相手の入力を毎回待つと著しく体験が損なわれます。そこで、まだ届いていない相手の入力を予測してゲームを進めてしまいます。たとえば相手は立っていると予測して進め、0.3秒後に「実はしゃがんでいた」という情報が来たら、その情報をもとにゲームの状態を再計算して戻す。これがロールバックです。発想はWebの先行表示に近いものの、ゲーム全体を0.3秒前まで戻せるような設計にしておく必要があり、実装はかなり大変だと竹原氏は言います。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8NDMwVf0sjoKJJSEfu5ozg.jpeg" /></figure><p>4つ目は、入力の冗長化です。最新の入力に直近の過去入力を含めておき、パケットロスで欠落した入力を補完します。音声通話に用いられる Opus の in-band FEC と共通する冗長化の考え方です。通信量は増えますが、ゲームのデータはもともと小さいので、問題になることは少ないといいます。</p><p>5つ目は、重要度に応じた間引きです。ほとんど見えないほど遠くにいるプレイヤーの重要度は低く、そのデータを送る重要性も低いので間引きます。十分に遠いプレイヤーのデータは送らなかったり、通信量を10分の1にしたりしておき、近づいてきたら頻度を上げて、体験に影響が出ないようにします。</p><h4>Sonic RumbleでのQUIC導入</h4><p>ここからは、実際にQUICをゲームへ活用した事例です。竹原氏はCEDEC 2025で発表した内容から抜粋して紹介しました。</p><p>1つ目は、株式会社セガの「Sonic Rumble」です。ゲーム業界では、リアルタイム通信を実装する際にRUDPを独自実装するケースが非常に多いものの、その実装と仕様を保守・運用していくのが時代とともに厳しくなってきています。そこでSonic Rumbleは、QUICをプロトコルとして採用しました。</p><p>ただしSonic RumbleはUnity（C#）を採用しているため、ネイティブ実装をC#から使うためのラッパーの作成や、各機種向けのビルドが必要になり、マルチプラットフォーム対応にはそれなりのコストがかかったといいます。QUICのストリームとデータグラムは、メッセージの性質と実際の接続環境に合わせて使い分けています。QUICで接続できない場合はTCPへフォールバックする対応も入れていますが、実際に運用を始めてから発生したフォールバック率は0.014%と、想定よりかなり小さい値でした。竹原氏は、UDPやQUICが通らない環境をそれほど意識しなくてよくなってきているのかもしれない、と印象を語りました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*It0y66pa5LEKi7_uvDOP-Q.jpeg" /></figure><p>続いて、Sonic Rumbleのような多人数・高頻度の通信で、QUICがリアルタイム通信のプロトコルとして成立するかを検証した結果が紹介されました。Sonic Rumbleは、多くのプレイヤーが集まってリアルタイムにゴールを目指す、レースのようなゲームです。測定ではRTTに一定の揺らぎが見られたものの、全体としては比較的安定した値が得られました。RTTは理論値から大きく乖離せず、通信相手との距離に応じて変化する傾向も確認できました。そこから、QUICは多人・高頻度の通信を行うゲームでもリアルタイム通信プロトコルになり得る、と評価されています。</p><p>一方で、運用では課題も見つかりました。Sonic Rumbleでは、サービス開始後に切断判定に至るケースが一定割合で発生したのです。調査すると、通信量の割にパケット数が多い実装になっており、通信経路上の機器でパケットロスが多発していると推測されました。そこで、ゲーム中の通信データをまとめるとともに、暫定的に通信の一部をUDPに置き換えて、ACK分のパケットを削減しました。その結果、切断判定の件数は減少し、さらに体感を変えない範囲で送信データをまとめることで、もう一段減らせたといいます。</p><p>ゲームは、Webの一般的なリクエスト・レスポンス型の通信に比べて、小さなデータを高頻度で一方的に送る設計になりがちです。今回の事例では、ACKを含む送信パケット数が運用上の課題になりました。速応性を保ちながらパケット数を調整したいという要求があり、竹原氏は、QUICでACKの頻度を調整できるようにする「ACK Frequency」の議論に期待を寄せていました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8r_lWcPDHbB48QvMT_qMg.jpeg" /></figure><h4>SPHINGOへのQUIC追加</h4><p>続いて、セガの内製リアルタイムネットワークライブラリ「SPHINGO（スフィンゴ）」にQUICを追加した事例です。SPHINGOは、数人から数十人規模の対戦を行うためのネットワークライブラリで、セガ社内で長年使われ、複数のタイトルで採用されてきました。既存の独自プロトコルをすべて捨ててQUICへ移行した、というわけではありません。</p><p>背景にあったのは、クライアントの接続回線が切り替わったときに、自動で通信を復旧したいという要求でした。同じ仕組みを独自に作ると、仕様の策定と維持管理のコストが高くなります。そこで、標準仕様としてConnection Migrationを持つQUICを選択肢に加えたのです。</p><p>QUICではConnection Migrationによって通信経路の切り替えに配慮することができます。しかし、仕様があるからといって実装が自動的に簡単になるわけではありません。たとえばWindowsのネットワークスタックがアドレス変更を内部で吸収すると、アプリケーションには経路変更が通知されず、マイグレーションのタイミングが分からないことがあります。実際にはIPが変わっているのに通信が継続して通信エラーが起きないため、通信エラーをトリガーにして経路変更されたことを検知することができないということです。NATの状態や切り替えのタイミングも環境依存で、仮想環境で動いても、実際のWi-Fi、携帯回線、端末、OSの組み合わせで同じように動くとは限りません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VBv0fkKEWQ-pyFm_TtG03g.jpeg" /></figure><p>それでも竹原氏は、Connection Migrationの価値は、こうした問題をすべて解消することではなく、少なくともコネクション継続まわりの仕様をゼロから策定しなくてよいことにあるのではないか、と結論づけました。</p><h4>MoQとゲーム</h4><p>今日はMoQ Meetupということもあり、竹原氏はMoQの仕組みをゲームの用途に当てはめたらどうなるかを、個人的に考えてみたといいます。</p><p>分かりやすいのは、ゲーム内のライブ配信のような用途です。映像や音声を多数のユーザーへ継続的に配信する場面に、MoQは向いていそうです。</p><p>ほかにも使えないかと考えたときに浮かんだのが、MMORPGのように多数のプレイヤーが同じ世界にいて、オブジェクトの状態を同期する場面でした。オブジェクトのステータスをMoQで同期する、というのもできるのではないか。ただし、どのプレイヤーに何を発信するか、ゲームの状態をどこで管理するか、データの欠落をどう扱うかといった、ゲーム固有の設計は結局必要になります。本当にMoQを採用するのがよいのかは、これから考えていかなければならないと竹原氏は言います。</p><p>こうしたゲーム側の要求からプロトコルの設計方針を考えることは、ゲームリアルタイム通信プロトコルコミュニティでも継続して議論されているテーマです。</p><p>このコミュニティは、ゲーム業界におけるリアルタイム通信のプロトコルについて情報交換し、業界全体で品質向上を目指す非営利の活動です。始めた当初は、ゲームでのQUICの採用事例を集め、並行してゲームのリアルタイム通信に必要な要素を整理し、事例と突き合わせて、不足があればゲーム向けの専用プロトコルを提案しようと考えていました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GLnBTi9hEDZqhnRFspKwA.jpeg" /></figure><p>ところが進めていくうちに、公開されているQUICの採用事例が想定より少ないことが分かります。ゲームで実際にQUICを使ってみたという発表事例は、世界的に見てもほとんどありません。複数の採用事例を比較してゲーム向けプロトコルを検討する、という当初の進め方は難しくなりました。</p><p>そこで現在は、先に単一のプロトコルを考えるのではなく、まずユースケースから必要な要求を整理し、トレードオフや評価指標を定める方向へ議論を移しています。そのうえで、QUICなどの標準プロトコルがどこまでゲームのリアルタイム通信に適合するのかを評価し、不足する機能が明確になったら、標準プロトコルの拡張やゲーム向けプロトコルを検討する。今はその位置にいる、というのが竹原氏の説明でした。</p><h4>まとめ</h4><p>最後に竹原氏は、今回の話をこうまとめました。</p><p>用途によって通信への要求が異なること自体は、ゲーム業界だけの話ではない。しかしゲームは、1つのタイトルの中に性質の違う通信が共存し、設計によっても要求が大きく異なるため、リアルタイム通信に求めるものの振れ幅がかなり大きい分野である。だからこそ、多様な要求に対して、通信プロトコルと、先行計算や補間など、ゲーム側の工夫を組み合わせて対応してきた。<br>ゲームのリアルタイム通信にQUICやMoQを採用するかどうかも、ゲーム内のどの通信に適合するのかを、求める体験と実装・運用の両面から評価することが重要だ。</p><p>ゲームとプロトコルのあいだを行き来しながら積み上げられてきた、現場の知見が詰まった発表でした。</p><p>今回のような話題に興味を持った方は、ぜひ次回のTokyo Video Techにもご参加ください。<a href="https://luma.com/tokyo-video-tech?utm_source=medium_cta">LumaのTokyo Video Techページ</a>で「フォロー」をクリックすると、今後のイベント開催案内を受け取れます。会場でお会いできるのを楽しみにしています！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=975157fccfe1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/2026-10-02-moq-meetup-japan-1-ja-975157fccfe1">2026–10–02 MoQ Meetup Japan #1 開催レポート (ja)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2026–09–03 Tokyo Video Tech #13 “Accelerate” Seminar Report (en)]]></title>
            <link>https://medium.com/tokyo-video-tech/2026-09-03-tokyo-video-tech-13-seminar-report-en-bb20c4687acd?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb20c4687acd</guid>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 03:48:33 GMT</pubDate>
            <atom:updated>2026-09-07T03:25:36.055Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://luma.com/tokyo-video-tech-13-accelerate">Tokyo Video Tech #13</a> was held on September 3, 2026, at docomo R&amp;D OPEN LAB ODAIBA.</p><p>What challenges does implementing MoQ reveal that the specification doesn’t cover? How was GPU parallel processing achieved in codecs that seemed inherently sequential? What should you decide before collecting vast amounts of beacon data?</p><p>We welcomed Daiki Matsui from NTT DOCOMO BUSINESS, FFmpeg maintainer Lynne, and Tony Valderrama from Momento. This report explores the implementation techniques and design decisions they discussed, drawing on their own experience.</p><p>Report by: <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a><br>(<a href="https://medium.com/tokyo-video-tech/2026-09-03-tokyo-video-tech-13-seminar-report-ja-d45d76e944f0">本レポートの日本語版はこちらからご覧いただけます</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUtYe5TjQkZ4a0mecqSY4w.jpeg" /></figure><h3><strong>Executive Summary</strong></h3><h4><strong>Session 1 — Three Challenges and Design Decisions from Evaluating Media over QUIC</strong></h4><ul><li>Daiki Matsui of NTT DOCOMO BUSINESS implemented Media over QUIC (MoQ), which aims to combine low latency with large-scale delivery, and released the work as the open-source project “<a href="https://github.com/nttcom/moq-wasm">moq-wasm</a>.” He shared three challenges that only became apparent during implementation: managing stream information, sharing a port between QUIC and WebTransport, and load balancing.</li><li>The team chose a simple centralized approach to managing stream information, appropriate for the scale of the proof of concept. A library from an existing MoQ project resolved the port-sharing issue. For load balancing, they chose GCP’s L4 load balancer, accepting that the setup would not support connection migration.</li><li>With a specification still under development, library and infrastructure constraints also shape design decisions. Matsui emphasized balancing the technology’s potential against implementation effort, and building something that works as a starting point for learning.</li></ul><h4><strong>Session 2 — From camera to screen: Forging Vulkan-accelerated codecs in FFmpeg</strong></h4><ul><li>FFmpeg maintainer Lynne presented work on GPU acceleration for FFV1, ProRes, ProRes RAW, and other formats using Vulkan. Motivated by filmmaking on Linux, the effort aims to make high-quality video workflows accessible without relying on a particular vendor’s dedicated hardware.</li><li>The implementations use the codecs’ structures to run more operations in parallel while reducing data transfers between the CPU and GPU. On an RTX 6000 Ada, 4K, 10-bit FFV1 encoding and decoding reached roughly 500 fps. For JPEG 2000, a GPU costing around $200 enabled real-time decoding of cinema content, including 8K.</li><li>These performance gains make completely lossless FFV1 practical in more production workflows, helping avoid generational loss from repeated encoding. The work is reaching users through FFmpeg and applications that support it, while some codec implementations remain in development. Lynne called for support to help complete and maintain these tools.</li></ul><h4><strong>Session 3 — Designing Reactive Infrastructure for Live Events</strong></h4><ul><li>Tony Valderrama of Momento explained the shared data infrastructure behind QoE (Quality of Experience) monitoring, personalization, and anti-piracy. He described four stages — ingestion, processing, storage and analytics, and decisioning — and advocated designing backward from the desired change in user experience.</li><li>Gateway batching, less frequent beacon transmission, and fewer data fields help manage surges in telemetry from millions of devices. Teams should define how quickly they want to get insights from the data they collect, then choose databases and analytics platforms suited to that purpose. How data is partitioned and how much loss is acceptable also shape a design that delivers the required response times while keeping costs down.</li><li>Turning insights into a better viewing experience requires a design that keeps decision processing from delaying responses to users. How much authority a system has to decide and act should reflect the potential impact of incorrect decisions on users. Teams should define where human review is needed and under what conditions the system can act autonomously, then expand its responsibilities as its behavior proves reliable.</li></ul><h3><strong>Opening Remark</strong></h3><p>by <a href="https://www.linkedin.com/in/takesato/">Takesato Hayashi</a> (<a href="https://npaw.com/">NPAW</a>)</p><p>The 13th Tokyo Video Tech began with opening remarks from Takesato on behalf of the organizers. His remarks are presented below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NR7NxOP9VfZWLHQFt5GmXg.jpeg" /></figure><p>I met Tony from Momento at Tokyo Video Tech #10, which we held at Netflix Tokyo in late 2025. That meeting led to discussions about organizing this event together. First, I’d like to thank Tony for helping make today’s event happen.</p><p>Tonight’s networking session is sponsored by Momento. I’d also like to thank <a href="https://docomo-openlab.jp/">docomo R&amp;D OPEN LAB ODAIBA</a> for providing this wonderful venue, and give special thanks to Maeda-san and Suzuki-san for their support.</p><p>Let me share a little background on Tokyo Video Tech. We launched in December 2018 as a technical community for engineers passionate about online video and streaming technology. We have actively contributed to the global video technology community. The community is run by three organizers: Hiromine, Katz, and me.</p><p>We are a non-profit community and do not engage in any recruiting or PR activities. Neither the organizers nor sponsors use the attendee list for any purpose other than running the events.</p><p>Tokyo Video Tech is also part of a network connecting video technology communities around the world. <a href="https://www.demuxed.com/meetups">This network grew out of a video technology community in San Francisco</a>.</p><p>In addition to running our regular meetups, we also help organize Video Dev Days. Video Dev Days brings together developers working on open-source multimedia technologies such as VLC and FFmpeg to share technical knowledge about video and audio and discuss future development plans. <a href="https://images.videolan.org/videolan/events/vdd19/">In 2019, we co-hosted Video Dev Days at IIJ in Tokyo</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UELHIVt9f0tQ-CYei43nRA.jpeg" /></figure><p>Tokyo Video Tech members also attend and speak at events overseas. Yusuke Goto from AbemaTV and I attended Taiwan Multimedia Tech in Taipei, Taiwan. Some of our members have spoken at overseas events such as Video Dev Days. I also spoke at an event in London last year, where I introduced Tokyo Video Tech’s activities. After attending overseas events, <a href="https://medium.com/tokyo-video-tech/vdd2023-dublin-report-en-27e181ecc9d3">we write reports about them</a> and <a href="https://medium.com/tokyo-video-tech/glitch-as-a-feature-an-interview-with-ffglitch-creator-ramiro-polla-en-a1a3237a0f8c">also interview speakers</a>.</p><p>To help us keep these activities going, we’d appreciate it if you could spread the word by sharing links to our event pages on Luma and activity reports on Medium through channels such as your company’s Slack. If there are topics you’d like to hear about next, please feel free to let the organizers know.</p><p>I have one particularly important request: please invite your colleagues and early-career engineers to join you at the next event. Many people may be hesitant to attend events like this, but please try inviting them anyway. If you’d like to give a talk yourself, or know someone who would be willing to share their expertise, please contact the organizers anytime. Likewise, if you know a company or organization that might be interested in sponsoring us, or are interested in sponsorship yourself, please get in touch.</p><p>Today, we welcome three speakers: Matsui-san, Lynne, and Tony. After the sessions, we have a one-hour networking reception planned, sponsored by Momento. You can enjoy food and drinks while chatting with the speakers and fellow attendees. If you’re worried about conversing in English, don’t worry: the organizers will be there to help.</p><p>Finally, Takesato shared an update on the timing of the next event.</p><p>The date has not yet been finalized, but the event is planned for late November 2026, tentatively the week after Inter BEE. Details and a registration link will be announced later.</p><h3><strong>Three Challenges and Design Decisions from Evaluating Media over QUIC</strong></h3><p>by <a href="https://www.linkedin.com/in/d-matsui/">Daiki Matsui</a> (<a href="https://skyway.ntt.com/en/">NTT DOCOMO BUSINESS</a>)</p><p>The Media over QUIC (MoQ) specification is publicly available online, and there are countless articles explaining it. So why give another talk about implementing it?</p><p>The speaker was Daiki Matsui, who works on the WebRTC platform “<a href="https://skyway.ntt.com/en/">SkyWay</a>” at NTT DOCOMO BUSINESS. Outside of work, he says, he tends to follow his curiosity wherever it leads — including building his own tiling window manager for Linux. His answer to that opening question was simple: no matter how carefully you read a spec, the places where an implementation actually gets stuck only surface once you build it. “That’s what I want to talk about today,” he said, opening the session.</p><ul><li>The presentation slide <a href="https://speakerdeck.com/dmatsui/media-over-quic-three-problems-we-hit-building-a-relay">https://speakerdeck.com/dmatsui/media-over-quic-three-problems-we-hit-building-a-relay</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QfshrRBLOIOWXzyR6hfR8g.jpeg" /></figure><h4><strong>Where MoQ Came From</strong></h4><p>Low-latency live streaming brings <strong>WebRTC</strong> to mind first. Built by Google for real-time communication in the browser, capable of sub-second latency, it has become the de facto standard for today’s web conferencing. It would be easy to assume it’s already enough.</p><p>But Daiki was blunt: WebRTC’s home turf isn’t large-scale distribution. Unlike HTTP, it can’t use inexpensive CDNs as-is. Supporting large-scale distribution means running your own fleet of relay servers called <strong>SFUs</strong> and coordinating them yourself. Deeper optimizations, such as using B-frames, require modifying Google’s massive WebRTC library, which Daiki described as difficult.</p><p><strong>HLS/DASH</strong> took the opposite trade: give up low latency, and get the full benefit of the CDN instead. In 2009, Apple pitched the idea of delivering live video over HTTP by treating video as nothing more than a set of files. That let existing CDNs be used inexpensively and at scale, at the cost of latency ballooning to anywhere from several seconds to tens of seconds. The industry has spent years chipping away at that latency, but as long as you’re working within the constraints of HTTP, there’s only so much room to cut it down.</p><p>Low-latency WebRTC on one side, CDN-friendly HLS/DASH on the other. <strong>QUIC</strong> offered the possibility of addressing the limitations of both approaches.</p><p>Daiki recalled that Google implemented and deployed QUIC in its own browser around 2012, and that it became an RFC roughly five years ago. It’s the protocol underpinning today’s HTTP/3, already running in production on CDNs worldwide. Roughly speaking, its design is like rebuilding HTTP over UDP while removing HTTP’s weaknesses. Because its UDP-based design sidesteps the head-of-line blocking that TCP suffers from, it’s better suited to low-latency communication than HTTP. There’s one caveat, though: browsers can’t use raw QUIC directly for security reasons. They can use QUIC through <strong>WebTransport</strong>, which sits on top of HTTP/3.</p><p>If QUIC could combine low latency with the benefits of CDNs, why not use it to deliver media? Around 2021 to 2022, people around the world began arriving at that idea.</p><p>Twitch proposed <strong>Warp</strong>, and Meta, Cisco, and others each submitted their own drafts for transporting media over QUIC; those efforts merged into what became Media over QUIC, or MoQ. An IETF working group formed, drawing in former Twitch engineers alongside people from Cisco and Cloudflare, and standardization has been moving forward ever since. Draft 20 landed the day before this talk — a reminder that the spec is still very much a work in progress.</p><p>For Daiki, who already had an interest in transport protocols and network congestion control — he’d previously researched and presented on Google’s BBR congestion-control algorithm — this was not a trend he could ignore. So he and his collaborators decided to actually build MoQ by hand. They implemented it fully from scratch, QUIC transport layer included, and open-sourced the result as <a href="https://github.com/nttcom/moq-wasm"><strong>moq-wasm</strong></a>. Beyond client implementations for both browser and native targets, they also built a server, deployed it on GCP, and made it reachable from the open internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDBaxC3N_Y5vRN3DeHZumg.jpeg" /></figure><p>Building it surfaced, unsurprisingly, a series of difficulties that weren’t apparent from the spec or explainer articles alone. There were three main challenges: managing stream information in ways the spec doesn’t define, sharing a port despite library limitations, and handling load balancing in the infrastructure layer.</p><h4><strong>Sharing Stream Information Between Relays</strong></h4><p>In MoQ, both publishers and viewers connect through a <strong>relay server</strong>. When a publisher sends video or audio — called a <strong>track</strong> — the relay server learns about that track. When a viewer wants to <strong>subscribe</strong> to it, the relay server forwards that subscription request to the publisher, and data then flows from publisher to viewer through the relay.</p><p>That’s the simplified picture, with just one relay server. What happens once there are several?</p><p>Suppose the publisher and viewer are each connected to a different relay server. The viewer’s relay server doesn’t know which relay server is providing that track. When it receives a subscription request, it therefore doesn’t know where to forward it. Relay servers need some mechanism to share and manage stream information among themselves.</p><p>The MoQ spec doesn’t define how to share and manage this stream information. How to solve it, Daiki explained, is left to the implementer.</p><p>Two broad approaches come to mind.</p><p>The first is a <strong>centralized approach</strong>: record the source information somewhere central. When a stream starts, write “this track lives on relay A” into a shared data store; a relay receiving a subscription request looks it up there and forwards the request to the source relay. On paper, that should be enough.</p><p>But considering what happens as the number of relay servers grows reveals problems with this approach. The data store becoming a single point of failure (SPOF) can be addressed through redundancy. The bigger issue is that load concentrates on the source relay server. No matter how many relay servers you add, each relay receiving a subscription request connects directly to the source relay, so the source’s load cannot be adequately distributed.</p><p>The desired structure is a multi-hop relay topology in which each relay forwards subscription requests upstream and distributes the data it receives downstream. The source relay only needs to send data to the downstream relays directly connected to it. To achieve this, the team considered recording routes toward the source in a routing table. For each relay, the table records which upstream relay should receive its subscription requests next. Each relay consults the table and forwards the request in turn until it reaches the source; data flows in the reverse direction.</p><p>In theory, that should work. But two questions remain unanswered: who decides these routes, when, and how? And as relay servers are added or removed, who updates the table, and how? Until those two questions have answers, the design stays a nice idea on paper.</p><p>The other path is a <strong>distributed approach</strong>, where stream information is passed from one relay to the next. Assuming relay servers are already interconnected via some topology, each one propagates stream information to its neighbors, and each neighbor that receives it passes it along to its own neighbors in turn. Every relay records locally which neighboring relay it received the stream information from. When a subscription request arrives, it forwards the request to the neighboring relay on the shortest path to the source. Repeating this process eventually delivers the request to the source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YsVoA1D9gdgl6a6R-qpMYQ.jpeg" /></figure><p>This neighbor-to-neighbor “announcement” mechanism also isn’t defined by the MoQ spec itself. A separate specification called <a href="https://datatracker.ietf.org/doc/draft-lcurley-moq-lite/"><strong>MoQ Lite</strong></a> does define it. Adopting a distributed approach requires a protocol for sharing stream information like this, separate from the MoQ specification. Information also takes time to propagate, so the stream information each relay has depends on the timing. Daiki felt this would make it difficult to understand the system’s state when something went wrong.</p><p>In the end, Daiki and his collaborators went with the simplest option: the centralized approach, just recording the source in a data store. They accepted the downside of load concentrating on the source, judging that it wouldn’t cause practical problems at the scale of a PoC (proof of concept). Looking across existing MoQ implementations, the one that’s probably most widely used, <a href="https://github.com/moq-dev/moq"><strong>moq.dev</strong></a>, takes the distributed approach, while Cloudflare has gone with the centralized one. The team’s aim was to learn MoQ by actually running it, and the project wasn’t yet at the stage of serious optimization. He added that turning it into a commercial product with a multi-region configuration would likely lead to a different decision.</p><h4><strong>Sharing One Port Between QUIC and WebTransport</strong></h4><p>Both the raw QUIC and WebTransport paths used the same underlying Rust QUIC implementation. Sharing a port should be straightforward. That was Daiki and his collaborators’ initial expectation.</p><p>Browsers can’t handle raw QUIC directly, for security reasons, and go through WebTransport instead. At the protocol-stack level, both the raw-QUIC path and the WebTransport path sit on top of QUIC, and QUIC in turn sits on top of UDP. During QUIC’s TLS handshake, there’s a mechanism called <strong>ALPN</strong> that lets a client announce “this is the protocol I want to use,” and the MoQ server side reads it to tell whether an incoming connection wants raw QUIC or WebTransport. Thanks to that mechanism, supporting multiple protocols doesn’t require splitting them across separate ports — one port can be shared.</p><p>Daiki’s team built the MoQ implementation to first work over raw QUIC, then added WebTransport support afterward to get it running in browsers. For raw QUIC, they used <a href="https://github.com/quinn-rs/quinn"><strong>quinn</strong></a>, probably the most widely used Rust QUIC implementation. For WebTransport, they used <a href="https://github.com/BiagioFesta/wtransport"><strong>wtransport</strong></a>, a library that implements WebTransport on top of quinn.</p><p>But sharing a port turned out not to be so simple. There was no API for handing a QUIC connection established by quinn over to wtransport.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ye6XM-wV-3Gr2Ci0mWXcgQ.jpeg" /></figure><p>What they wanted the server to do was this:</p><ul><li>Accept a QUIC connection and establish it</li><li>Check the connection’s ALPN value; if it’s MoQT, handle it directly as raw QUIC</li><li>If the ALPN value is h3, treat it as WebTransport: upgrade to HTTP/3, then upgrade again to WebTransport, and establish the MoQT session on top</li></ul><p>For the second step, converting a raw QUIC connection into a WebTransport session, the library offered no API at the time. As Daiki explained, the problem arose from the library’s API design rather than the MoQ protocol itself.</p><p>Reasoning that existing MoQ implementations must face the same issue, they investigated and found that the moq.dev project had developed and published its own WebTransport library designed to work with quinn. Using that library let them accept both protocols on a single port. Implementing a new protocol can involve uses that existing libraries weren’t designed to support. Daiki described this as a new lesson for him.</p><h4><strong>Load-Balancing a Stateful QUIC Connection</strong></h4><p>The third challenge was how to design a load-balancing configuration that met several requirements.</p><p>They envisioned a configuration with multiple relay servers in each region and clients in different locations accessing a shared domain. They wanted each client to connect to the geographically closest region, with load distributed across multiple relay servers within that region. They also wanted to take advantage of a QUIC-specific feature: <strong>connection migration</strong>, which maintains a connection between client and server even if the client’s IP address changes.</p><p>Their plan was to put a load balancer (LB) in front to make this work.</p><ul><li><strong>L7 LB</strong>: terminates QUIC and assumes HTTP, so it can’t handle clients using raw QUIC — ruled out</li><li><strong>L4 LB</strong>: forwards packets as-is, so client and relay server can still establish a direct QUIC connection through the LB. However, routing decisions are based on a set of five values (the 5-tuple), including source and destination IP addresses and ports. If that tuple changes, for example when switching from Wi-Fi to LTE, packets are sent to a different relay server, preventing connection migration from working.</li><li><strong>QUIC-LB</strong>: routes based on a connection identifier embedded in the QUIC packet itself, independent of the 5-tuple</li></ul><p>QUIC-LB looked like the answer. Based on their research at the time, the only LB that supported it was AWS’s Network Load Balancer. GCP, which the team primarily uses, didn’t support it. Azure was also unsupported at the time.</p><p>Implementing QUIC-LB themselves was one option, but the implementation cost would be substantial. A hybrid AWS/GCP setup was another, but Daiki recalled that operating another cloud environment just for load balancing was a difficult choice. They also considered having clients first connect to a separate server that would select a relay server and redirect them to it. That would add one RTT of delay before connection, and they would still need to implement their own routing logic. DNS-based routing doesn’t allow for fine-grained load balancing and requires updating records every time the number of relay servers changes. Each option had drawbacks, so they decided against all of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9ymYt5bk6N-YQce_WPKWQ.jpeg" /></figure><p>Daiki’s team ultimately gave up connection migration and adopted GCP’s L4 load balancer (Network Load Balancer) as-is. Their priority was to build a working implementation in a short time, rather than perfect the load-balancing setup. Because the LB configuration is independent of the application, they also expected to be able to replace it with a different configuration later.</p><p>Daiki said that when adopting a new technology from scratch, engineers naturally want to make the most of its strengths. Even so, he reflected that, given practical constraints, it was important to first build something that worked and put themselves in a position to learn from it.</p><p>Daiki closed the session by saying that if anyone in the audience walks away able to tell their boss, even briefly, “here’s where MoQ stands right now,” he’d count the talk a complete success.</p><h3><strong>From camera to screen: Forging Vulkan-accelerated codecs in FFmpeg</strong></h3><p>by <a href="https://lynne.ee/">Lynne</a> (FFmpeg)</p><p>Apple’s ProRes is widely used in professional filmmaking, from the camera through editing to archiving. This codec is based on compression theory from the 1980s, and the workflows for handling it at high speed have depended heavily on Apple’s hardware. FFmpeg maintainer Lynne has been working on reverse engineering and acceleration to make it possible to work with this footage on their own Linux machine.</p><ul><li>The presentation slide <a href="https://files.lynne.ee/tokyo_video_tech_13_slides/tokyo_video_tech_13.html">https://files.lynne.ee/tokyo_video_tech_13_slides/tokyo_video_tech_13.html</a></li></ul><h4><strong>A Physicist, a Filmmaker, and an FFmpeg Maintainer</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MesrlUUW40WRdCwAphR9ig.jpeg" /></figure><p>Lynne began by explaining that they originally studied physics. They now maintain Vulkan hardware acceleration, audio encoders and decoders, several filters, and the DCT code in FFmpeg. These areas are often considered difficult, but Lynne says they “really aren’t.” Lynne is also a member of the <a href="https://www.khronos.org/"><strong>Khronos Group</strong></a>, which oversees the Vulkan API, <a href="https://www.videolan.org/"><strong>VideoLAN</strong></a>, and <a href="https://aomedia.org/"><strong>AOMedia</strong> (the Alliance for Open Media)</a>, which standardized AV1. Lynne worked on AV1 and is currently developing a next-generation open audio codec. Their experience as a filmmaker was the starting point for the work presented in this talk.</p><h4><strong>Filmmaking and Its Dependence on Macs</strong></h4><p>Making a film requires a script and a production team. Before any of that, though, it requires a camera. Cameras produce multimedia files, and working with multimedia brings plenty of difficulties. Lynne recalled a line still quoted in the field: “Multimedia is basically never-ending pain.”</p><p>One source of that pain is generational loss. Each time a video signal is re-encoded using lossy compression, a little more information is lost. After roughly 20 rounds of encoding and decoding a test image, the degradation becomes obvious. The remedy is to choose a lossless or near-lossless codec early in production and continue using it through editing and finishing. For transferring video between devices with low latency and little processing overhead, meanwhile, codecs with widespread hardware decoder support are an option. Hardware decoders for royalty-free codecs such as AV1 are widely available in recent devices.</p><p>In filmmaking, however, the format needs to work across the entire production process. In the workflow Lynne described, Apple’s <strong>ProRes</strong> is the common format from the camera through color grading to archiving. Files used at each stage are managed in a database and re-encoded as they move to the next stage. A fast codec with little quality loss is therefore essential to keeping production running smoothly. Apple has built exactly that: a fast ProRes and ProRes RAW production workflow backed by hardware decoders exclusive to Apple machines. The problem is that acceleration through Apple’s dedicated hardware is available only on Macs. While decoders are available for Windows, creating a similarly fast production environment on Lynne’s Linux system was a challenge. Choosing Apple’s environment requires a Mac, with Apple’s dedicated accelerator card available for those who need more processing performance. Lynne estimated the total at roughly $10,000, including the Mac configuration needed to use the card. Their objection was simple: they already had a perfectly usable Linux machine and did not want to buy a Mac just to work with video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRoxmfbvVEzAwnFAc8eTQg.jpeg" /></figure><h4><strong>The JPEG-Derived Compression Behind ProRes</strong></h4><p>A codec used throughout the industry might sound like a marvel of engineering. To be fair, there are things to appreciate. ProRes first uses a DCT (discrete cosine transform) to break an image into frequency components, making it easier to compress. It then predicts the DC component, which represents properties such as a block’s average brightness, and records the difference from that prediction to reduce the amount of data. Quantization discards detail that is barely perceptible to the eye, and entropy coding assigns codes according to how frequently values occur to compress the remaining data. Anyone familiar with image compression will recognize the process: it is almost exactly JPEG. ProRes is 20-year-old technology built on JPEG’s design from the 1990s, which in turn rests on theory from the 1980s.</p><p>FFmpeg’s policy is to decode every format, whether or not its specification is public. ProRes was therefore reverse engineered. That analysis showed that ProRes has a simpler data structure than JPEG and is designed to be easier to process. Lynne described JPEG’s structure as a kind of mess left behind by photographers without much grounding in compression or programming techniques. A ProRes frame is divided into regions called slices. Within each slice, the image is handled in 8x8 pixel blocks. Each slice’s compressed data is independent, and an index gives its location. Decoding can therefore begin at any slice without needing data from neighboring slices. A 6K frame contains tens of thousands of these 8x8 blocks. The 16 or 32 CPU cores in a typical machine cannot execute that many operations in parallel at once.</p><h4><strong>Why Vulkan</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIimG6JydPKrF9wsdqFgnA.jpeg" /></figure><p>Those same everyday machines also contain something built for this kind of massively parallel, independent work: a GPU. Laptops, desktops, and smartphones all have GPUs, with large numbers of parallel compute units. The idea is to put the compute capacity left unused during CPU video decoding to work on decoding as well.</p><p>CUDA and OpenCL are among the ways to program a GPU, but Lynne chose <strong>Vulkan</strong>. It is a lower-level API than CUDA or OpenCL and offers no hand-holding. In Lynne’s words, programming it is “an exercise for masochists.” In return, it gives fast, fine-grained control over the GPU. Unlike CUDA, Vulkan is not tied to a particular GPU manufacturer and can be used across environments including Mac, Windows, Linux, and Android.</p><h4><strong>FFV1: From an Archival Complaint to 500 Frames a Second</strong></h4><p>FFmpeg’s Vulkan support began somewhat by chance in 2024. The archival community complained that <strong>FFV1</strong> was too slow to encode. FFV1 is an IETF-standardized lossless codec, and Lynne, also a Khronos member, decided to see whether Vulkan could help. Looking into it revealed more than expected: FFV1 had quietly become close to the default choice for archival tools and general lossless storage. It was much more widely used than Lynne had thought before getting involved.</p><p>The obstacle was FFV1’s <strong>range coder</strong>. This form of entropy coding depends on the result of the previous step to proceed to the next, making it difficult to parallelize. The breakthrough came from the bitstream itself. An FFV1 frame is already divided into 1024 independent slices. Since those slices can be processed simultaneously, each can be assigned to the GPU. However, 1024 operations are not enough to keep tens of thousands of GPU compute units busy. FFV1 turned out to have unusually rich context information for each slice: the dynamically updated entropy-coding state that supports the codec’s efficiency. This context information made it possible to extract parallelism within each slice as well. From the 1024 slices, the work yielded roughly 32 times as many tasks that could run in parallel, around 32,768 in total. That still does not use every compute unit, but in Lynne’s words, it was “enough.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngNp5HtokBdH9fVaCxgtUg.jpeg" /></figure><p>One approach to GPU acceleration for codecs is to do part of the processing on the CPU and leave only easily parallelized operations, such as the DCT, to the GPU. However, the intermediate coefficient data is larger than the compressed input. Transferring it between the CPU and GPU over PCI Express is costly, so this approach was not adopted. For FFV1, the work also eliminated the need to copy compressed input packets, typically tens of megabytes, into GPU memory in advance. This is where Vulkan’s host memory mapping comes in: it lets the GPU directly access input data held on the CPU side. The GPU reads the data it needs over PCI Express and handles its own caching. Lynne described this host memory mapping as the real breakthrough behind the entire effort.</p><p>The acceleration was clear in the benchmarks. On an RTX 6000 Ada, 4K, 10-bit FFV1 encoding and decoding reached roughly 500 frames per second. The speed makes lossless screen recording practical using only a few percent of the GPU. It also opens the way to replacing many production stages that previously used ProRes with completely lossless FFV1. Repeated encoding and decoding with FFV1 introduces no generational loss.</p><h4><strong>Applying the Same Approach to ProRes</strong></h4><p>The idea of processing independent slices in parallel, used for FFV1, also applies to ProRes. Although ProRes uses smaller slices, Lynne investigated whether more parallelism could be extracted within them. Redundancy in the coefficients within each slice made predictive decoding possible, exposing further parallelism. This increased the number of operations that could run in parallel from a few thousand per frame to around 25,000 for a 5.7K frame. Even a codec not designed for parallel processing on this scale could now make full use of the GPU’s compute capacity. On ordinary consumer hardware, the result now outperforms Apple’s dedicated accelerator card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHZ59b5_4kxuC_PrqbVJJg.jpeg" /></figure><h4><strong>Reverse Engineering ProRes RAW</strong></h4><p>Returning to the camera, <strong>ProRes RAW</strong> is a format for recording RAW data from a camera’s sensor. It differs from ordinary ProRes, so its decoding process required separate analysis. The camera Lynne showed can also record ProRes RAW, but Apple has not published the format’s specification. Lynne had only an existing decoder binary and the analysis tool <strong>Ghidra</strong>. After weeks of reading disassembled code and tracing each piece of data from input to output, they produced a decoder that could just about be called functional. It reconstructed much of the footage, but bugs still caused some images to break up. Lynne and the other developers judged it usable enough to release and continued fixing bugs for roughly another year.</p><p>The next lead was another vendor’s ProRes RAW decoder, accelerated on the GPU using CUDA. The aim of analyzing it was to establish what processing was needed to reconstruct ProRes RAW correctly. Another implementation might reveal clues about the parts that were still not understood. Inspecting its CUDA kernel revealed that entropy decoding ran on the CPU, so transferring intermediate data consumed bandwidth and slowed processing. The GPU handled only an 8x8 DCT, followed by debayering, color processing, and output. There was no hidden trick in ProRes RAW’s raw data processing chain. The necessary conversion information was contained in a small table in the file produced by the camera. Applying that table in the decoder yielded output that conformed to the specification.</p><p>After working out how to reconstruct the images correctly, the work also advanced GPU acceleration. FFmpeg’s CPU decoder manages only about 3 frames per second even with 12 threads. Vulkan GPU decoding, by contrast, can process slices in parallel, allowing even the integrated GPU in an ordinary laptop released in 2024 to deliver fast footage previews on set. The implementation has already been merged into FFmpeg and runs across environments, including macOS.</p><h4><strong>Can FFmpeg’s Decoder Implementations Be Trusted?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7OaeOictts3UhY-WTervw.jpeg" /></figure><p>Speed alone does not establish whether FFmpeg’s decoders reconstruct the images correctly; that needs separate verification. According to Lynne, the same compressed data is decoded with both the Vulkan decoder and the existing software decoder running on the CPU, and the resulting images are continuously checked for agreement.</p><p>The caveat is that the FFmpeg ProRes and ProRes RAW software decoders used for comparison were themselves created through reverse engineering. They are neither official Apple products nor implementations approved or supported by Apple. Nevertheless, Lynne said they trust these implementations. Their reasoning was that both formats are based on known compression techniques from the 1980s and 1990s, rather than containing some hidden, secret technology.</p><h4><strong>DPX: The Standard Nobody Follows</strong></h4><p>Even when a specification is public, vendors’ implementations do not necessarily follow it. <strong>DPX</strong>, an image file format produced by film scanners, is one example. It holds uncompressed pixel data at depths such as 8, 10, and 16 bits, packed into 32-bit units according to fixed rules. Because those rules allow the position of the data to be calculated, parallel GPU reading is straightforward to implement. DPX is also a formal <strong>SMPTE</strong> standard, with a specification that should leave no room for interpretation. Yet <strong>Scanity</strong> and <strong>Laser Graphics</strong> scanners do not output files that follow it. FFmpeg consequently carries numerous special cases to accommodate each vendor’s deviations, just to read files that should require no such workarounds.</p><h4><strong>APV: An Alternative Without Patent Restrictions</strong></h4><p>One way to reduce dependence on ProRes is to replace it with another codec. <strong>APV</strong> was introduced as an option. Developed with backing from Samsung, Google, and others, it uses almost the same coding structure as ProRes without the patent restrictions. Lynne reported achieving roughly 1000 frames per second for APV processing in FFmpeg. The aim of this acceleration was to use APV for real-time video transmission between devices connected over Ethernet.</p><h4><strong>GPU Decoding of JPEG 2000 Cinema Content</strong></h4><p><strong>JPEG 2000</strong> was originally conceived as an image format for the internet. For ordinary images, however, it was less efficient than plain JPEG and saw little adoption online. Digital cinema adopted it instead. DCPs, the data packages used for cinema screenings, still all use JPEG 2000. One source of slow JPEG 2000 decoding is an arithmetic coding mechanism called the <strong>MQ coder</strong>. Its decoding depends on the order of processing, which makes it difficult to accelerate on a CPU, Lynne explained. Yet decoding JPEG 2000 requires going through this MQ coding stage. Lynne parallelized it on the GPU, enabling real-time decoding of 4K, 2K, and 8K DCPs on a card costing about $200. It is an achievement Lynne said they are proud of.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jR80emPP504I5PjE5eWevQ.jpeg" /></figure><h4><strong>Accelerating JPEG Image Decoding on the GPU</strong></h4><p>The ideas used for JPEG 2000 can also be applied to ordinary <strong>JPEG</strong>. JPEG’s compressed data is normally decoded sequentially from the beginning. Huffman codes, however, have a property that allows decoding to start elsewhere in the data and eventually find the correct code boundaries as it proceeds. This is called resynchronization. It allows multiple GPU operations to start decoding simultaneously from different positions in the compressed data. The relative positions of their results are then reconciled. The result is decoding 26-megapixel JPEG files at 21 images per second on an AMD Radeon RX 6900 XT. That is fast enough for photographers reviewing large collections to switch quickly between full-resolution image previews.</p><h4><strong>Seeking Funding to Finish Development</strong></h4><p>Not all the work is finished. A parallel JPEG encoder and <strong>DNxHD</strong>/<strong>DNxHR</strong> decoders are still in development, with funding being sought to complete them. These tools for filmmaking cost money to build and maintain. Lynne asked anyone using DNxHD, JPEG, or JPEG 2000 in production to get in touch.</p><h4><strong>Vulkan Support Spreads to Applications</strong></h4><p>Lynne described the aim of this work as enabling everyone to work with high-quality video, regardless of the hardware they own or how much they are willing to pay in licensing fees. The acceleration features already integrated into FFmpeg are available through its standard hardware acceleration framework. Applications using the FFmpeg API can enable Vulkan decoding by changing a single line of code.</p><p>Users of <a href="https://mpv.io/"><strong>mpv</strong></a><strong> </strong>do not even have to think about it: opening an MP4, ProRes, ProRes RAW, or DPX file uses Vulkan hardware acceleration. <a href="https://www.shotcut.org/"><strong>Shotcut</strong></a> already enables this acceleration by default. <a href="https://www.blender.org/download/"><strong>Blender</strong></a><strong> </strong>does not yet; a pull request has been submitted and is awaiting review.</p><h3><strong>Designing Reactive Infrastructure for Live Events</strong></h3><p>by <a href="https://www.linkedin.com/in/tvald/">Tony Valderrama</a> (<a href="https://www.gomomento.com/">Momento</a>)</p><p>During a Super Bowl a few years ago, 15.5 million devices were streaming the same game simultaneously. It is the kind of number a systems team would proudly put on a slide. The challenge is how quickly engineers can detect and respond when a CDN’s performance starts to degrade during the broadcast. How long before an engineer notices? And how long before a viewer notices?</p><p>Momento engineer Tony Valderrama used these questions as the starting point for a discussion of QoE monitoring, personalization, and anti-piracy. His talk explored how to build a pipeline that uses beacon data from devices to make decisions and reflect them in the user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PW-lCXLJd74xSSDdxPLfLw.jpeg" /></figure><p>Understanding Momento’s role starts with how it differs from a CDN. Momento is not a CDN. While CDNs deploy POP servers around the world, Momento’s servers reside within a single region on AWS, Google Cloud, or Azure. Momento provides an edge layer between an application’s data stores and the rest of the internet. It handles data routing, compute, and storage, passing application data to a CDN or delivering it directly to devices. Why did Tony, whose company provides this infrastructure, choose to discuss three different use cases?</p><h4><strong>A Shared Structure Across Three Use Cases</strong></h4><p>In QoE (Quality of Experience) monitoring, metrics such as rebuffer ratio, playback startup time, and dropped-frame counts help determine whether traffic should be steered to another CDN. In feed personalization, records of clicks and dwell time reshape what a viewer sees next. In anti-piracy, location and device fingerprints provide signals for deciding in real time whether a video stream should be allowed to continue.</p><p>These features are often developed by separate teams and appear to involve different systems. Tony explained, however, that all three can be understood through a shared structure with four stages. This common structure is the central idea of the talk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91u2D8ENjqytT8qhQS1e0Q.jpeg" /></figure><p>The first stage is ingestion, which receives telemetry data, or beacons, from millions of devices. Processing then collects those beacons by key and organizes them into ordered data streams. Storage and analytics provides the information needed to make decisions for each use case, such as identifying CDN degradation or unauthorized streaming. Finally, decisioning uses those results to change API behavior. The applications and interfaces may differ, but the underlying structure is shared.</p><p>Data flows through ingestion, processing, storage and analytics, and decisioning, in that order. Design works backward, starting with the decisions the application needs to make. Those decisions determine what storage and processing are needed and what constraints to place on ingestion. Start with ingestion and build forward instead, and the result is a system that collects everything at considerable cost yet cannot act on most of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdJkTDjOsknJ4fDciQUo9Q.jpeg" /></figure><p>There are three questions to consider when working backward. First, which signals actually inform the decision? A beacon cannot carry everything. Teams need to consider in advance, for example, whether anti-piracy requires location data or whether assessing playback quality requires dropped-frame counts.</p><p>Second, how much delay is acceptable between something happening on a device and a decision being made? Faster server processing does not shorten the time a beacon spends crossing the internet. If a beacon takes several seconds to arrive, is it worth spending more to reduce server processing from one second to 100 milliseconds? The required response time and the total elapsed time, including network transit, should determine how far to pursue faster processing.</p><p>Then there is a question engineers often hesitate to answer: how many beacons can the system afford to lose? Beacons sent by devices can already be lost on the internet before they reach ingestion. Accepting a little more loss at the edge can make the pipeline dramatically simpler and cheaper.</p><h4><strong>Ingestion: Preparing for Spikes That Autoscaling Cannot Handle</strong></h4><p>The concurrent-viewer chart from the Super Bowl broadcast shown in the talk had a large peak at halftime during the eight-hour broadcast. As Tony put it, people love the halftime show more than the game itself. Zooming in on the time axis reveals smaller fluctuations throughout the rest of the broadcast as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N36By1zCB2Rc7FYC7HXkKg.jpeg" /></figure><p>Live sports traffic does not rise smoothly. People hear about a moment in the game from a friend, receive a push notification, or see a group chat light up, and arrive together to watch. Traffic therefore spikes in multiple places at once. An autoscaling policy tuned for gradual growth cannot keep up with this behavior.</p><p>The gateway’s role is to absorb traffic spikes and reduce the load on downstream systems. Without a gateway, or with one that lacks sufficient processing capacity, large numbers of requests reach the data layer directly. Simply to withstand that traffic, the data layer can require three to ten times the resources it would need with a gateway in place.</p><p>A beacon from an individual client needs to carry very little data: one or two identifying fields, such as a player ID or client ID, plus the signals needed for the decision. Examples include rebuffer ratio and playback startup time for QoE monitoring, clicks and dwell time for personalization, and fingerprints and location for anti-piracy.</p><p>The temptation is to send every field that might be useful and let the downstream data pipeline sort it out. But every added field must travel across the internet to reach the system. A small difference per device becomes a vastly larger volume of transferred data when millions of devices send it every few seconds.</p><p>So far, the discussion has focused on using a gateway to handle fluctuations in beacon traffic. There are also two ways to influence incoming traffic and reduce downstream processing load.</p><p>The first is the beacon period: how often a client sends a beacon. Triple the number of clients while keeping the beacon period fixed, and requests per second also triple. Keep the client count constant and shorten the period from ten seconds to one, and traffic increases tenfold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oT1j84KdoTOfXTTVYARePg.jpeg" /></figure><p>The beacon period and the fields to send are configured on the client, making changes difficult to distribute across many device types. Shipping a player with updated settings through app stores or TV platforms can take months. Tony’s advice was to start conservatively: use a longer beacon period and a minimal payload. Shorten the period or add more data only after confirming that downstream infrastructure has spare processing capacity.</p><p>The second is batching, a purpose for which Momento designed its own gateway. Pass beacons straight through as a simple router would, and every downstream system incurs the fixed overhead of each individual request. Instead, collect ten milliseconds of data or 100 messages before forwarding them, and downstream load drops to between one-tenth and one-hundredth of the original level. Because each beacon is only a few kilobytes, fixed per-request overhead accounts for a relatively large share of the work.</p><p>A ten-millisecond delay may sound like a problem. In practice, it is negligible alongside seconds of internet transit and tens to hundreds of milliseconds of downstream processing. In events Momento has supported, including the Super Bowl, the World Cup, and March Madness, this buffering interval has typically been between ten and 100 milliseconds.</p><p>Batching does, however, carry a risk of data loss. While the data is being buffered, the gateway is its only holder. If the gateway fails, the buffered data is lost. The longer the buffering interval, the more data can be lost in a failure. Choosing that interval therefore includes deciding how many milliseconds’ worth of data loss is acceptable. The earlier question of how many beacons can be lost becomes a concrete design choice here.</p><p>Given these responsibilities, the gateway should not be treated simply as a cost item to cut. How well it is designed determines whether the downstream systems can be kept at an appropriate size.</p><p>One common trap is per-request pricing, which is poorly suited to beacon ingestion. Payloads are only a few kilobytes, but requests accumulate across millions of devices. Adding services such as a web application firewall in front of the gateway increases the bill further.</p><p>Services such as <strong>AWS API Gateway</strong> provide many features for complex request processing. Beacon ingestion needs TLS termination, basic protection for downstream systems, and the ability to group beacons before forwarding them. API Gateway is a poor fit for this use case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6sfJoKtaM4hJGCuHeBsNA.jpeg" /></figure><p>The pricing model to look for charges by gigabytes processed rather than by request count. That is an important consideration when selecting a dedicated gateway service. When building a gateway with something like <strong>Envoy</strong>, costs likewise center on data transfer and the server capacity needed to handle that volume.</p><h4><strong>Processing: Organizing Incoming Beacons by Key</strong></h4><p>The processing stage receives data that the gateway has assembled from multiple beacons. Data for the same user or session may still arrive separately from different gateways. Processing collects that data into shards according to its key, organizing it into an ordered data stream within each shard.</p><p>Momento uses <strong>Valkey</strong> for this work. It is an open-source fork of Redis created following Redis’s license change, runs on AWS, Google Cloud, and Azure, and receives contributions from Momento itself. Data passed to Valkey is copied into memory on multiple nodes. If one node fails, another retains the data, reducing the risk of loss compared with the stage where only the gateway holds it.</p><p>In Valkey, the key determines which shard receives the data. Records with the same key therefore reach the same shard even when they arrive from different gateways. In this architecture, Valkey collects data from multiple gateways and organizes it for sequential processing. Other architectures use <strong>Kafka</strong> for a similar role.</p><p>The choice of shard key matters because the way data is divided affects how long analysis takes. For example, partitioning by client ID spreads data from the same region across multiple shards. An analysis of playback quality by region then has to collect data from those shards, adding time to the query. Choosing a key that matches the intended analysis keeps related data together and reduces this work.</p><p>For QoE monitoring, partitioning by region brings together data about incidents occurring in the same location. For personalization, the key is the user ID. Even if the client connects through a different gateway, the same user’s clicks and viewing data reach the same shard and can be treated as a single activity history. For anti-piracy, the key is the session key. Keeping its usage data in one shard makes it easier to look for signs of abuse, such as simultaneous use from distant locations.</p><p>Once Valkey has organized the data, each beacon is validated. Requests with obviously invalid formats have already been filtered out at the gateway. This stage goes further, checking that each beacon conforms to the schema and that its contents contain no contradictions or implausible values.</p><p>Because these checks run on every beacon, they need to remain lightweight. Heavier work, such as joining multiple data sources or aggregating data, belongs in downstream storage and analytics. Momento runs validation and similar operations as <strong>WebAssembly</strong> functions integrated into Valkey, because they are faster and impose less load than Valkey’s built-in Lua scripting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXftpuwhvciPiwQj_nyowQ.jpeg" /></figure><p>Data may also be converted into a format appropriate for its destination. For example, data intended for an archive can be converted to <strong>Parquet</strong> before being sent to storage.</p><p>The archive should retain all received data, including beacons that fail validation. Players support many kinds of devices and are developed by multiple teams. Even with careful development, beacons with unexpected formats or contents can arrive in production. Retaining those records makes it possible to inspect what was actually sent and investigate the cause of a problem. Object storage provides an inexpensive way to preserve this data for investigation.</p><h4><strong>Storage and Analytics: Choosing for the Use Case</strong></h4><p>Ingestion and processing look much the same across all three use cases. This is where the choice of solution starts to differ. Choosing storage is not simply a matter of picking a favorite database: the right choice depends on the questions the use case needs to answer. No database answers every question well. Trying to make one store serve every purpose forces it into uses it was not designed for, requiring extra resources and driving up costs.</p><p>QoE monitoring includes post-event analysis, investigation during a broadcast, and immediate detection of anomalies, each with a different tolerance for how long results take. For post-event analysis, queries can take hours. It is sufficient to retain all the data in <strong>S3</strong> and let analysts use a query engine to investigate whatever questions arise.</p><p>During a broadcast, there is less time to wait for results. An operator watching latency creep up in a region needs an answer in seconds rather than hours. <strong>ClickHouse</strong> is one suitable option for this work.</p><p>Detection in under a second requires still shorter processing times. In its work with Fox on the Super Bowl, Momento used rolling counters in Valkey to test whether alerts could be raised in under a second for specific degradation scenarios. These counters track how many events matching the conditions being monitored arrive within windows such as one or ten seconds. Updating the counters as events arrive avoids having to aggregate the data again when evaluating an alert. Rate limiting similarly counts events within a defined period.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5ayS_EycCcYXiVg5gknAA.jpeg" /></figure><p>Personalization determines which content to show each user next. Its analytical goal differs from QoE monitoring, which looks across data from many users to find problems with playback quality.</p><p>A common approach is a two-tower system. The content tower represents the features of each article or video as a vector. The user tower builds a vector representing a person’s interests from their click and viewing history. When ranking the feed, the system compares the user’s vector with each content vector to select content that matches that person’s interests.</p><p>The two types of vectors are also updated at different times. On the content side, computation follows the frequency at which new articles or videos are added. A sports site publishing a few items a day can compute these vectors in advance as a batch. A social platform with a continuous stream of posts may instead compute them as each new post arrives. On the user side, the interest vector is updated whenever that person’s click or viewing data arrives.</p><h4><strong>Decisioning: Translating Decisions into API Behavior</strong></h4><p>Ingestion, ordering, and analysis are all preparation. Decisioning takes the resulting decisions and applies them to API behavior, changing the user experience through playback quality, displayed content, and other outcomes.</p><p>The key consideration is how to connect analytical processing to API responses. A common approach is to query the analytics store whenever a user request arrives and change the response based on the result. This puts the analytics store on the critical path of the request. Delays or problems in that store also affect API responses waiting for it. The approach is therefore not recommended unless the analytics store was designed for frequent queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cadRL_GK_47u51pSmQxR2A.jpeg" /></figure><p>An alternative is to run decision logic in the background and apply the results to requests that arrive later. Anti-piracy provides an example. In live streaming, clients request video segments every few seconds, allowing the interval before the next request to be used to evaluate potential abuse. This means some video is delivered before the evaluation finishes. Tony presented a design that accepts delivering one to a few segments during that interval.</p><p>Video is returned in response to the first segment request without waiting for a decision. In parallel, the policy engine examines usage by session key, checking whether the same key is being used simultaneously from distant regions or across many video streams. If it identifies abuse, delivery is stopped for subsequent segment requests. Serving each segment no longer requires waiting for the evaluation to finish.</p><p>Personalization likewise does not require recalculating the feed ranking for every request to display it. That may be technically possible, but it causes articles and videos to change position every time the user looks at the feed.</p><p>The process of updating a user’s interests and the process of ranking the feed can therefore run at different times. The interest vector is updated whenever click or viewing data arrives. Comparing that vector with the content vectors and recalculating the ranking can happen at intervals such as one, ten, or 30 minutes.</p><p>The ranking update interval depends on how often new content is published and how quickly it should reach users. Tony explained that, for a sports site publishing an article every hour, refreshing the feed more frequently than publication offers little benefit. A social feed intended to keep showing new posts might update every 60 seconds. The aim is to choose an update frequency that suits the service’s user experience, rather than pursuing processing speed alone.</p><h4><strong>How Much Should the System Decide on Its Own?</strong></h4><p>A system’s ability to make a decision is separate from whether it should be allowed to act on that decision without human review. Tony described five levels of automation, using CDN steering as an example:</p><p>1. <strong>Dashboard</strong>: A person watches a dashboard and investigates the situation.<br>2. <strong>Alarm</strong>: An alert is raised when an anomaly is detected.<br>3. <strong>Diagnosis</strong>: The system suggests possible causes.<br>4. <strong>Proposed remediation</strong>: The system proposes a response and executes it after human approval.<br>5. <strong>Full autonomy</strong>: The system carries out the response without human approval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjtrPHFhqlt5Rny6HqB7cg.jpeg" /></figure><p>Tony believes that, in many cases, automation should stop at proposed remediation, where a person approves the proposed response before execution. When the conditions for acting and the action to take have been rigorously defined in advance, however, it may be possible to delegate execution without human approval. For example, a system could detect degrading performance on the primary CDN and automatically switch to a designated secondary CDN once predefined conditions are met.</p><p>Tony also pointed out that, although automation often brings AI to mind, deterministic rules can accomplish a great deal. Returning the same decision under the same conditions makes their behavior predictable, contributing to reliability. The possible failures and the response to each must, however, be worked out in advance.</p><p>He used anti-piracy to illustrate a concern with AI-driven automation. If AI is asked to find signs of abuse, teams need to consider carefully whether its judgment alone should automatically suspend a user’s access. Hallucinations could create unfounded suspicions of abuse and cause legitimate users to be suspended.</p><p>The potential impact of such errors should inform how much responsibility to give the system. Rather than automating everything from the outset, development and operations teams should examine its decisions and behavior, then expand automation gradually as they gain confidence. That progression supports a product that can adjust delivery and displayed content as circumstances change.</p><p>The talk opened with a Super Bowl broadcast streamed simultaneously on 15.5 million devices. If CDN performance degrades during a broadcast, how long before the operations team notices? And how long before viewers notice?</p><p>Responding quickly starts with defining the decisions the system must make, such as the conditions for switching CDNs. Once the required data and the acceptable time to reach a decision are clear, teams can choose storage, processing methods, and an ingestion design. Start with how the user experience should change, then work backward to design the infrastructure it requires. That was Tony’s message throughout the talk.</p><p>Interested in these topics? Join us at a future Tokyo Video Tech event! Visit <a href="https://luma.com/tokyo-video-tech?utm_source=medium_cta">Tokyo Video Tech on Luma</a> and click “Follow” to receive announcements about upcoming events. We look forward to seeing you there!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb20c4687acd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/2026-09-03-tokyo-video-tech-13-seminar-report-en-bb20c4687acd">2026–09–03 Tokyo Video Tech #13 “Accelerate” Seminar Report (en)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2026–09–03 Tokyo Video Tech #13 “Accelerate” 開催レポート (ja)]]></title>
            <link>https://medium.com/tokyo-video-tech/2026-09-03-tokyo-video-tech-13-seminar-report-ja-d45d76e944f0?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/d45d76e944f0</guid>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 02:35:13 GMT</pubDate>
            <atom:updated>2026-10-25T23:02:47.508Z</atom:updated>
            <content:encoded><![CDATA[<p>2026年9月3日、docomo R&amp;D OPEN LAB ODAIBAにて、「<a href="https://luma.com/tokyo-video-tech-13-accelerate">Tokyo Video Tech #13</a>」を開催しました。</p><p>MoQ仕様書に書かれていない、実装してはじめて見える課題とは。逐次処理しかできなさそうなコーデックで、どのようにGPUでの並列処理を成し遂げたのか。大量のビーコンデータを集める前に、何を決めておくべきか。</p><p>今回は、NTTドコモビジネスの松井大樹、FFmpegのメンテナーLynne、MomentoのTony Valderramaを迎えました。3名がそれぞれの経験をもとに語った、実装の工夫と設計判断をレポートします。<br>（文中敬称略）</p><p>Report by: <a href="https://www.linkedin.com/in/ksakai/">Katz Sakai</a><br>(<a href="https://medium.com/tokyo-video-tech/2026-09-03-tokyo-video-tech-13-seminar-report-en-bb20c4687acd">The English version of this report is available here</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUtYe5TjQkZ4a0mecqSY4w.jpeg" /></figure><h3>エグゼクティブサマリー</h3><h3>セッション1 — Media over QUIC の検証で直面した 3 つの課題と設計判断</h3><ul><li>NTTドコモビジネスの松井大樹は、低遅延と大規模配信の両立を目指すMedia over QUIC（MoQ）を実装し、「<a href="https://github.com/nttcom/moq-wasm">moq-wasm</a>」としてOSSで公開。仕様書だけでは見えない、配信情報の管理、QUICとWebTransportのポート共有、負荷分散という3つの課題を共有した。</li><li>配信情報の管理には、概念実証の規模を踏まえて単純な中央集権方式を採用。ポート共有は既存のMoQ実装が公開するライブラリで解決し、負荷分散ではコネクションマイグレーションを見送り、GCPのL4ロードバランサーを選択した。</li><li>仕様策定途上の技術では、ライブラリやインフラの制約も設計を左右する。技術の可能性を最大限に引き出すことと実装コストの折り合いをつけ、まず動くものを作って学ぶことの重要性を示した。</li></ul><h3>セッション2 — From camera to screen: Forging Vulkan-accelerated codecs in FFmpeg</h3><ul><li>FFmpegのメンテナーLynneは、Vulkanを使い、FFV1やProRes、ProRes RAWなどの映像処理をGPUで高速化。Linuxでの映像制作を出発点に、特定メーカーの専用ハードウェアに依存せず、高品質な映像を扱える環境づくりを紹介した。</li><li>コーデックの構造を活かして並列処理を増やし、CPUとGPU間のデータ転送を抑えることで性能を向上。RTX 6000 Adaでは4K・10ビットのFFV1エンコード・デコードが約500fpsに達し、JPEG 2000では約200ドルのGPUで8Kを含む上映用映像のリアルタイムデコードを実現した。</li><li>高速化は、完全ロスレスのFFV1を制作工程で活用する道を広げ、再エンコードによる世代劣化の回避にもつながる。成果はFFmpegや対応アプリケーションへ広がる一方、開発途中のコーデック対応もあり、完成と維持に向けた支援を呼びかけた。</li></ul><h3>セッション3 — Designing Reactive Infrastructure for Live Events</h3><ul><li>MomentoのTony Valderramaは、QoE（視聴体験の品質）モニタリング、パーソナライゼーション、海賊版対策に共通するデータ処理基盤を解説。「取り込み・処理・ストレージと分析・意思決定」の4段階で捉え、ユーザー体験をどう変えたいかから逆算して設計する考え方を示した。</li><li>数百万台のデバイスから届くビーコンデータの急増には、ゲートウェイでのバッチ化と送信頻度・項目の絞り込みで対応。データを収集してから分析結果を得るまでにどれくらいの時間を許容できるかを明確にし、目的に合ったデータベースや分析基盤を選ぶ。データの分け方や、どの程度のデータ消失を許容するかも含めて設計し、必要な応答速度を確保しながらコストを抑える。</li><li>分析結果を視聴体験の改善につなげるには、ユーザーへの応答を判定処理で遅らせない設計が必要になる。システムにどこまで判断と実行を任せるかは、誤判定がユーザーに及ぼす影響を踏まえて決める。人間が確認する範囲や自律的に動作する条件を定め、動作の確かさを見極めながら、任せる範囲を段階的に広げていく。</li></ul><h3>Opening Remark</h3><p>by <a href="https://www.linkedin.com/in/takesato/">Takesato Hayashi</a>（<a href="https://npaw.com/jp/">NPAW</a>）</p><p>第13回となる今回のTokyo Video Techは、主催者を代表する林の開会挨拶で始まりました。以下、その内容を紹介します。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NR7NxOP9VfZWLHQFt5GmXg.jpeg" /></figure><p>2025年末にNetflix Tokyoで開催したTokyo Video Tech＃10でMomentoのTonyさんと出会い、そこから一緒に今回のイベントを開催しようという話が始まりました。今日この場を一緒に作ってくれたTonyさんに、まず感謝します。</p><p>今夜のネットワーキングセッションは<a href="https://www.gomomento.com/jp/">Momento</a>に協賛いただいています。また、今夜素晴らしい会場を提供してくれたのは、<a href="https://docomo-openlab.jp/">docomo R&amp;D OPEN LAB ODAIBA</a>です。そして今回、とくに力を貸してくれた前田さんと鈴木さんにも感謝します。</p><p>ここで少し、Tokyo Video Techについてお話しします。オンライン動画やストリーミング技術に情熱を持つエンジニアのための技術コミュニティとして、2018年12月に発足しました。これまで、世界の動画技術コミュニティに積極的に貢献してきました。運営は金沢、酒井、そして私の3名で担っています。</p><p>私たちは非営利のコミュニティで、採用活動やPR活動も一切行っていません。参加者リストを、運営やスポンサーがイベント運営以外の目的で利用することはありません。</p><p>また、Tokyo Video Techは、世界各地の動画技術コミュニティがつながるネットワークにも参加しています。<a href="https://www.demuxed.com/meetups">このネットワークは、サンフランシスコの動画技術コミュニティから広がったものです</a>。</p><p>通常の勉強会運営に加えて、Video Dev Daysの開催にも取り組んでいます。Video Dev Daysは、VLCやFFmpegなどのオープンソースのマルチメディア技術に携わる開発者が集まり、動画や音声に関する技術的な知見を共有したり、今後の開発方針を話し合ったりする場です。<a href="https://images.videolan.org/videolan/events/vdd19/">2019年には、東京のIIJを会場にVideo Dev Daysを共催しました</a>。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UELHIVt9f0tQ-CYei43nRA.jpeg" /></figure><p>Tokyo Video Techのメンバーは、海外のイベントへの参加や登壇も行っています。AbemaTVの五藤さんと私は、台湾・台北で開催されたTaiwan Multimedia Techに参加しました。メンバーには、Video Dev Daysなどの海外イベントに登壇した人もいます。私自身も昨年、ロンドンのイベントに登壇し、Tokyo Video Techの活動を紹介しました。海外イベントへの参加後には、<a href="https://medium.com/tokyo-video-tech/vdd2023-dublin-report-jp-09a5d55e8996">その内容をレポートにまとめるほか</a>、<a href="https://medium.com/tokyo-video-tech/glitch-as-a-feature-an-interview-with-ffglitch-creator-ramiro-polla-ja-fa82e80b29f0">登壇者へのインタビューも行っています</a>。</p><p>こうした活動をこれからも続けていくために、LumaのイベントページやMedium上の活動レポートのリンクを社内のSlackなどで共有して、私たちの活動を広めてもらえると嬉しいです。次に聞きたいトピックがあれば、遠慮なく運営に伝えてください。</p><p>そしてとくに大切なお願いですが、次回はぜひ同僚や若手エンジニアを誘って、一緒に参加してほしいと思っています。こうした場に来ることをためらう人も多いと思いますが、それでも誘ってみてください。ご自身が登壇を希望される場合や、専門的な知見を共有してくださる方をご存じの場合は、いつでも運営にご連絡ください。同様に、協賛いただけそうな企業・団体をご存じの場合や協賛にご興味がある場合も、いつでも運営にご連絡ください。</p><p>今回は松井さん、Lynneさん、Tonyさんという3名の登壇者をお迎えしました。セッション終了後には、Momentoの協賛による交流会を1時間予定しています。食事や飲み物を楽しみながら、登壇者や参加者の皆さんと交流できます。英語での会話が不安な場合も、運営がサポートしますので安心してください。</p><p>最後に、次回イベントの開催時期についても案内がありました。</p><p>日程はまだ確定していませんが、Inter BEEの翌週を目安に2026年11月下旬の開催を予定しており、詳細と登録リンクは追って案内するとのことです。</p><h3>Media over QUIC の検証で直面した3つの課題と設計判断</h3><p>by <a href="https://www.linkedin.com/in/d-matsui/">松井大樹</a>（<a href="https://skyway.ntt.com/">NTTドコモビジネス</a>）</p><p>MoQの仕様書はインターネットに公開されていますし、解説記事も数え切れないほど出ています。それなら、なぜあらためて実装の話をするのでしょうか。</p><p>登壇したのは、NTTドコモビジネスでWebRTCプラットフォーム「<a href="https://skyway.ntt.com/">SkyWay</a>」の開発に携わる松井大樹です。プライベートでも好奇心の赴くままに手を動かすことが多く、Linux向けのタイル型ウィンドウマネージャーを自作してしまうような人物だといいます。</p><p>松井の答えは単純でした。仕様書を読むだけでは分からない詰まりどころが、実装してみると必ず出てくる。</p><p>「今日はその話をしたい」と切り出しました。</p><ul><li>発表スライド <a href="https://speakerdeck.com/dmatsui/media-over-quic-jissou-de-chokumen-shita-3-tsu-no-mondai">https://speakerdeck.com/dmatsui/media-over-quic-jissou-de-chokumen-shita-3-tsu-no-mondai</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QfshrRBLOIOWXzyR6hfR8g.jpeg" /></figure><h4>MoQが生まれた背景</h4><p>低遅延のライブ配信といえば、まず<strong>WebRTC</strong>が思い浮かぶでしょう。Googleがブラウザでのリアルタイム通信を目的に開発し、1秒未満の遅延を実現できることから、いまやウェブ会議のデファクトスタンダードになっている技術です。これさえあれば十分ではないか、と思うかもしれません。</p><p>ところが松井は、WebRTCの主戦場は大規模配信ではないと言い切ります。HTTPのように安価なCDNをそのまま使えるわけではなく、大規模な配信を実現しようとすれば<strong>SFU</strong>と呼ばれる中継サーバーを自前で並べ、協調動作させる必要があります。Bフレームの利用のような踏み込んだ最適化をしたくなっても、Googleが開発した巨大なWebRTCライブラリ自体に手を入れねばならず、難易度は高いといいます。</p><p>低遅延を諦める代わりにCDNの恩恵を最大限受ける道を選んだのが、<strong>HLS/DASH</strong>です。2009年、Appleは「HTTPでライブ映像を配ろう」というアイデアのもと、映像をただのファイルとして扱う方式を打ち出しました。このおかげで既存のCDNを安価かつ大規模に活用できるようになった代わりに、遅延は数秒から数十秒に膨らみます。世界中で低遅延化の試みが積み重ねられてきましたが、HTTPという枠組みの中である以上、遅延を短縮できる余地は限られています。</p><p>低遅延のWebRTCと、CDNの恩恵を受けられるHLS/DASH。この二つの方式の課題を解消する可能性を示したのが、<strong>QUIC</strong>でした。</p><p>Googleが2012年ごろに自社ブラウザへ実装・デプロイし、RFC化されたのは5年ほど前だと松井は記憶しています。いまのHTTP/3を支え、世界中のCDNで実際に使われているプロトコルです。ひとことで言えば、HTTPの欠点をなくしつつUDPの上に作り直したような設計になっています。TCPが抱えるヘッドオブラインブロッキングをUDPベースの設計で避けられるため、HTTPよりも低遅延な通信に向いています。ただし1つだけ注意がいります。ブラウザはセキュリティ上の理由から生のQUICを直接扱えず、HTTP/3の上に<strong>WebTransport</strong>を載せることで、ようやくQUICを利用できるのです。</p><p>QUICで低遅延とCDNの活用を両立できるなら、メディアもその上で配信すればよいのではないか。2021年から2022年ごろ、世界中でそう考える人が現れ始めました。</p><p>Twitchが提案した<strong>Warp</strong>をはじめ、Meta、Ciscoなど各社がQUIC上でメディアを転送する独自の草案をそれぞれ提出し、それらが統合される形でMedia over QUIC、略してMoQが生まれました。IETFにワーキンググループが立ち上がり、元Twitchのメンバーや、Cisco、Cloudflareのメンバーなどが参画して標準化が進められています。発表の前日にはドラフト20が出たそうです。仕様がまだ策定途上にある技術だということになります。</p><p>もともと通信プロトコルやネットワークの輻輳制御に関心があり、Googleが考案した輻輳制御アルゴリズムBBRを調べて発表した経験もある松井にとって、この流れは見過ごせないものでした。松井らはMoQを実際に手を動かして作ってみることにしました。QUICトランスポート部分も含めてフルスクラッチで実装し、成果は「<a href="https://github.com/nttcom/moq-wasm"><strong>moq-wasm</strong></a>」という名前でOSSとして公開しています。ブラウザ版とネイティブ版のクライアントに加え、サーバーも実装し、GCP上にデプロイしてインターネットから使える状態にしました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDBaxC3N_Y5vRN3DeHZumg.jpeg" /></figure><p>作ってみると、案の定というべきか、仕様書や解説記事だけでは見えなかった詰まりどころがいくつも出てきました。課題は大きく3つありました。仕様に定めのない配信情報の管理、ライブラリの制約によるポート共有の難しさ、そしてインフラでの負荷分散です。</p><h4>配信情報をリレー間でどう共有するか</h4><p>MoQでは、配信者と視聴者はいずれも<strong>リレーサーバー</strong>を介してつながります。配信者が映像や音声（これを<strong>トラック</strong>と呼びます）を配信すると、リレーサーバーはそのトラック情報を把握します。視聴者がそのトラックを<strong>購読</strong>したいと伝えると、リレーサーバーはその購読リクエストを配信者に転送し、結果としてデータが配信者から視聴者へ、リレーサーバー経由で流れます。</p><p>これはリレーサーバーが1台だけの、単純化した話です。では、リレーサーバーが複数台になったらどうなるのでしょうか。</p><p>配信者と視聴者がそれぞれ別のリレーサーバーにつながっていたとします。視聴者側のリレーサーバーは、そのトラックがどのリレーサーバーから配信されているかを把握していません。そのため、購読リクエストを受け取っても、転送先が分からないのです。リレーサーバー同士で配信情報を共有・管理する仕組みが要る、ということになります。</p><p>この配信情報の共有・管理方法は、MoQの仕様では定められていません。どう解くかは実装者の判断に委ねられている、と松井は説明しました。</p><p>思いつく方法は、大きく2つあります。</p><p>まず浮かぶのは、配信元の情報をどこかにまとめて記録しておく<strong>中央集権的アプローチ</strong>です。配信が始まったら「このトラックはリレーAにある」とデータストアに記録しておき、購読リクエストを受けたリレーサーバーはそのデータストアを見て、リクエストを配信元のリレーに転送する。これで足りるはずでした。</p><p>ところが、リレーサーバーの台数が増えた場合を考えると、この方式には課題があります。</p><p>データストア自体がSPOF（単一障害点）になるという問題は、まだ冗長化で手当てできます。より厄介なのは、配信元のリレーサーバーに負荷が集中することです。どれだけリレーサーバーを並べても、購読リクエストを受けた各リレーサーバーが配信元のリレーサーバーに直接接続するため、配信元の負荷を十分に分散できないのです。</p><p>目指したいのは、各リレーサーバーが購読リクエストを上流へ転送し、受け取ったデータを下流へ配る多段構成です。配信元のリレーサーバーは、直接つながる下流のリレーサーバーにだけデータを送れば済みます。これを実現する方法として、配信元へ向かう経路を台帳に記録する方式が検討されました。台帳には、各リレーサーバーが購読リクエストを次にどの上流リレーサーバーへ転送するかを記録します。購読リクエストは、各リレーサーバーが台帳を参照して順に転送することで配信元まで届き、データはその逆向きに流れます。</p><p>理屈のうえでは、これでうまくいくはずです。ただし、この経路を誰がいつどうやって決めるのか。リレーサーバーの増減に応じて、この台帳を誰がどう更新するのか。この2つの問いに答えが出ない限り、絵に描いた餅で終わってしまいます。</p><p>もう1つの道が、配信情報を隣接するリレーサーバーへ順に伝えていく<strong>分散的アプローチ</strong>です。リレーサーバー同士が何らかの経路であらかじめ接続されていることを前提に、各リレーサーバーは配信情報を隣に伝播させ、受け取った側もまた自分の隣に伝えていきます。</p><p>各リレーサーバーは、配信情報をどの隣接リレーサーバーから受け取ったかをローカルに記録しておき、購読リクエストが来たら配信元への最短経路上にある隣接リレーサーバーへ転送する。これを繰り返すことで、最終的に配信元へ届きます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YsVoA1D9gdgl6a6R-qpMYQ.jpeg" /></figure><p>この配信情報を隣へ伝える「アナウンス」の仕組みも、MoQの仕様自体は定めていません。この仕組みを定めた<a href="https://datatracker.ietf.org/doc/draft-lcurley-moq-lite/"><strong>MoQ Lite</strong></a>という別仕様も存在します。分散的アプローチを採用するには、こうした配信情報を共有するためのプロトコルを、MoQの仕様とは別に用意する必要があります。加えて、情報が伝わるまでに時間差があるため、各リレーサーバーが把握している配信情報は、タイミングによって異なります。問題が起きたときの状況把握が大変だろう、と松井は感じたそうです。</p><p>結局、松井らが選んだのは、配信元をデータストアに記録するだけの、いちばん単純な中央集権的アプローチでした。配信元への負荷集中という欠点は承知のうえで、PoC（Proof of Concept：概念実証）の規模であれば実害はないと判断したことになります。既存のMoQ実装を見渡すと、おそらくもっとも広く使われている<a href="https://github.com/moq-dev/moq"><strong>moq.dev</strong></a>の実装は分散的アプローチを採用しており、Cloudflareは中央集権的アプローチを採用しているといいます。松井らの取り組みは「動かしてMoQを学ぶ」ことが目的であり、本格的な最適化を進める段階ではありません。これを商用プロダクトとしてマルチリージョン構成にする段階になれば、別の判断になるだろうと付け加えました。</p><h4>QUICとWebTransportで1つのポートを共有する</h4><p>生のQUICを使う場合も、WebTransportを使う場合も、基盤となるのは同じRust製のQUIC実装だ。ポートくらい、素直に共有できるはずだ。松井らは当初、そう見積もっていました。</p><p>ブラウザはセキュリティ上の理由から生のQUICを直接扱えず、WebTransportを経由します。プロトコルスタック上は、生のQUICを使う経路とWebTransportを使う経路のどちらも、下層はQUICであり、さらにその下はUDPです。QUICのTLSハンドシェイク時には<strong>ALPN</strong>という「自分はこのプロトコルを使いたい」と伝える仕組みがあり、MoQのサーバー側はこれを見て、接続してきたクライアントが生のQUICを使いたいのか、WebTransportを使いたいのかを区別できます。複数プロトコルに対応する場合でも、この仕組みのおかげで1つのポートを共有でき、プロトコルごとにポートを分ける必要がありません。</p><p>松井らは、まず生のQUICで動作するMoQを実装し、その後、ブラウザでも動作するようWebTransportに対応させました。生のQUICの実装には、おそらくもっともメジャーなRust製QUIC実装である<a href="https://github.com/quinn-rs/quinn"><strong>quinn</strong></a>を採用しました。WebTransportには、quinnをベースとするライブラリの<a href="https://github.com/BiagioFesta/wtransport"><strong>wtransport</strong></a>を採用しました。</p><p>ところが、ポートは素直には共有できませんでした。quinnで確立したQUICコネクションを、wtransportのライブラリ側に渡すためのAPIが存在しなかったのです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ye6XM-wV-3Gr2Ci0mWXcgQ.jpeg" /></figure><p>サーバー側でやりたい処理は、次のようなものでした。</p><ul><li>QUICの接続を受け付け、コネクションを確立する</li><li>コネクションのALPNの値を見て、MoQTであれば生のQUICとしてそのまま処理する</li><li>ALPNの値がh3であればWebTransportとして扱うと判断し、まずHTTP/3に昇格し、さらにWebTransportに昇格した上でMoQTのセッションを確立する</li></ul><p>このうち2番目、生のQUICコネクションをWebTransportのセッションに変換するAPIが、当時のライブラリには用意されていませんでした。MoQというプロトコル自体の問題ではなく、ライブラリのAPI設計に起因する問題だった、と松井は整理しました。</p><p>既存のMoQ実装も同じ課題に直面しているはずだ。そう考えて調べたところ、先述したmoq.devでは、quinnと組み合わせて使えるWebTransportライブラリが独自に開発・公開されていました。松井らもこのライブラリを利用させてもらうことで、1つのポートで両方のプロトコルを受けられるようにしました。新しいプロトコルを実装するときは、既存ライブラリの想定から外れる場面に出会うことがある。松井にとって、これは新たな学びだったといいます。</p><h4>ステートフルなQUICコネクションをどう負荷分散するか</h4><p>3つ目の課題は、複数の要件を満たす負荷分散の構成をどう実現するかでした。</p><p>想定したのは、各リージョンに複数のリレーサーバーを配置し、各地のクライアントが共通のドメインにアクセスする構成です。クライアントを地理的にもっとも近いリージョンへ接続させ、そのリージョン内では複数台のリレーサーバーに負荷を分散させたいと考えていました。さらにQUIC特有の要件として、<strong>コネクションマイグレーション</strong>も活かしたいと考えていました。これは、クライアントのIPアドレスが変わってもクライアントとサーバー間のコネクションを維持できる、QUICの機能です。</p><p>前段にロードバランサー（LB）を置く方針で、これを実現しようとしました。</p><ul><li><strong>L7LBを使う場合</strong>：QUICを終端してしまう上にHTTPを前提とするため、生のQUICを使うクライアントを扱えず不採用</li><li><strong>L4LBを使う場合</strong>：パケットをそのまま転送するため、クライアントとリレーサーバーはLBを経由しても直接QUICのコネクションを張れる。ただし、振り分け先は送信元・宛先のIPアドレスとポートなど5つの情報の組（5タプル）で決まる。Wi-FiからLTEへの切り替えなどでこの組が変わると、別のリレーサーバーに振り分けられてしまい、コネクションマイグレーションが活かせない。</li><li><strong>QUIC-LBを使う場合</strong>：QUICパケット内に埋め込まれたコネクションの識別子を見て振り分ける技術で、5タプルに依存しない</li></ul><p>QUIC-LBなら解決できそうだ。当時調べた範囲では、対応していたLBはAWSのネットワークロードバランサーだけでした。松井らが主に使っているGCPは未対応でした。Azureも当時は未対応でした。</p><p>QUIC-LBを自前実装する案も考えられますが、実装コストが重くのしかかります。AWSとGCPのハイブリッド構成にする案もありますが、LBのためだけにもう1つのクラウドを運用するのは「悩ましい」と松井は振り返ります。別のサーバーを用意してクライアントを先にそこへつなげ、どのリレーサーバーへつなぐかを決めてからリダイレクトさせる方式も考えられますが、接続までに1RTT分の遅延が加わるうえ、結局は振り分けロジックを自前で持つことになります。DNSで振り分ける方法も、細かい負荷分散ができないうえ、リレーサーバーの台数を増減するたびにレコードを書き換える必要があります。いずれの案にも難点があり、採用を見送りました。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9ymYt5bk6N-YQce_WPKWQ.jpeg" /></figure><p>最終的に松井らは、コネクションマイグレーションを諦め、GCPのL4ロードバランサー（ネットワークロードバランサー）をそのまま採用しました。LBの完成度を追い求めるよりも、動くものを速く作ることを優先したかったためです。このLB構成はアプリケーションから独立しているため、後から別の構成に差し替えられるという見通しもありました。</p><p>松井は、新しい技術をゼロから導入するときには、エンジニアとしてその技術のよさを最大限に引き出したくなるといいます。それでも現実の制約を踏まえ、まずは動くものを作り、そこから学べる状態にすることが大切だと振り返りました。</p><p>最後に松井は、この発表を聞いた人が自分の上司に「MoQは今こういう状況です」と少しでも説明できるようになれば、この発表は大成功だと述べ、セッションを締めくくりました。</p><h3>From camera to screen: Forging Vulkan-accelerated codecs in FFmpeg</h3><p>by <a href="https://lynne.ee/">Lynne</a>（FFmpeg）</p><p>プロフェッショナルの映画制作では、カメラから編集、アーカイブに至るまで、AppleのProResが広く使われています。1980年代の圧縮理論を土台にしたこのコーデックを高速に扱う環境は、Appleのハードウェアに大きく依存してきました。FFmpegのメンテナーであるLynneは、自分のLinuxマシンでもその映像を扱えるよう、リバースエンジニアリングと高速化に取り組んできました。</p><ul><li>発表スライド <a href="https://files.lynne.ee/tokyo_video_tech_13_slides/tokyo_video_tech_13.html">https://files.lynne.ee/tokyo_video_tech_13_slides/tokyo_video_tech_13.html</a></li></ul><h4>物理学者であり映像作家でもある、FFmpegのメンテナー</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MesrlUUW40WRdCwAphR9ig.jpeg" /></figure><p>Lynneは自己紹介で、もともとは物理学を専攻していたと語りました。現在はFFmpegで、Vulkanによるハードウェアアクセラレーション、音声のエンコーダー・デコーダー、いくつかのフィルター、DCTのコードを担当しています。いずれも難しいと思われがちな領域ですが、本人は「実はそうでもない」と語ります。</p><p>VulkanのAPIを管理する<a href="https://www.khronos.org/"><strong>Khronos Group</strong></a>、<a href="https://www.videolan.org/"><strong>VideoLAN</strong></a>、そしてAV1を標準化した<a href="https://aomedia.org/"><strong>AOMedia</strong>（Alliance for Open Media）</a>のメンバーでもあります。AV1の開発に携わり、現在は次世代のオープン音声コーデックを開発しています。映像作家としての経験が、今回の講演で紹介する取り組みの出発点になっています。</p><h4>映像制作とMac依存の実情</h4><p>映画を作るには脚本と制作体制が要ります。ですが、それ以前にまずカメラが要ります。</p><p>カメラはマルチメディアファイルを生み出します。しかし、マルチメディアを扱う仕事には苦労がつきものです。Lynneは、この分野で今なお引用される「マルチメディアは基本的に終わりのない苦痛だ」という言葉を紹介しました。</p><p>その苦痛の一因が世代劣化です。映像信号を非可逆圧縮で再エンコードするたびに、情報はわずかずつ失われていきます。テスト画像でエンコードとデコードをおよそ20回繰り返してみると、劣化は誰の目にも明らかになります。対策は、制作の初期段階からロスレスかそれに近いコーデックを選び、編集や仕上げの工程でも使い続けることです。</p><p>一方、機材間で映像を低遅延・低負荷で送る用途なら、ハードウェアデコーダーが普及したコーデックを選べます。AV1のようなロイヤリティフリーのコーデックに対応するハードウェアデコーダーも、近年のデバイスに広く搭載されています。</p><p>ところが、映画制作では、工程全体で使われるフォーマットに合わせる必要があります。Lynneが紹介した制作フローでは、カメラからカラーグレーディング、アーカイブに至るまで、Appleの<strong>ProRes</strong>が共通のフォーマットとして使われています。各工程で扱うファイルはデータベースで管理され、次の工程へ進むたびに再エンコードされます。だからこそ、高速で劣化の少ないコーデックは、この制作工程を円滑に進めるために不可欠です。</p><p>Appleはまさにそれを作り上げました。Appleマシン専用のハードウェアデコーダーに支えられた、高速なProRes・ProRes RAW制作ワークフローです。問題は、Appleの専用ハードウェアによる高速化を利用できるのがMacに限られることです。Windows向けにはデコーダーがある一方、Lynneが使うLinuxでは、同様に高速な制作環境を整えることが課題でした。</p><p>Appleの環境を選ぶならMacが必要で、さらに高い処理性能を求める場合には、Apple純正のアクセラレーターカードも選択肢になります。Lynneの見積もりでは、それを使うために必要なMacの構成一式を含めると、おおよそ1万ドルに達するといいます。Lynneの言い分は単純でした。自分には十分に使えるLinuxマシンがあるのに、映像を扱うためだけにMacを買う気にはなれない、というのです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRoxmfbvVEzAwnFAc8eTQg.jpeg" /></figure><h4>ProResを支える、JPEGゆずりの圧縮技術</h4><p>業界のあらゆる工程に組み込まれていると聞くと、ProResは何かエンジニアリングの傑作であるかのように思えるかもしれません。公平を期すなら、評価すべき点は確かにあります。</p><p>ProResはまず、DCT（離散コサイン変換）で画像を周波数成分に分解し、圧縮しやすい形にします。次に、ブロックの平均的な明るさなどに対応するDC成分を予測し、予測との差分を記録することでデータ量を減らします。さらに、量子化で目にほとんど知覚されない細部を切り捨て、エントロピー符号化で出現頻度に応じた符号を割り当て、残りのデータを絞り込みます。</p><p>画像圧縮を少しでも見たことがある人なら、この手順に見覚えがあるはずです。なぜなら、これはほぼそのままJPEGだからです。ProResは90年代のJPEGの設計の上に築かれた20年前の技術で、そのJPEG自体も80年代の理論の上に築かれています。</p><p>FFmpegの開発方針は、すべてのフォーマットをデコードする（その仕様が公開されているかどうかにかかわらず）というものです。そのためProResもリバースエンジニアリングの対象になりました。解析すると、ProResはJPEGよりもデータ構造が単純で、処理しやすく設計されていることがわかりました。Lynneによれば、JPEGの構造は、圧縮やプログラミング技術にとくに通じていなかった写真家たちが残していった、ある種の混乱だったといいます。</p><p>ProResのフレームは、スライスと呼ばれる領域に分割されています。各スライス内の画像は、8x8ピクセルのブロック単位で扱われます。各スライスの圧縮データは独立しており、インデックスからその位置を参照できます。そのため、隣のスライスのデータは必要なく、どのスライスからでもデコードを始められます。6Kのフレームにはこの8x8ブロックが数万個含まれています。一般的なマシンに搭載された16基や32基のCPUコアでは、これほど多くの処理を一度に並列実行することはできません。</p><h4>なぜVulkanなのか</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIimG6JydPKrF9wsdqFgnA.jpeg" /></figure><p>とはいえ、そうした一般的なマシンにはどれも、まさにこの種の大規模並列かつ独立した作業のために作られたものが搭載されています。GPUです。ノートパソコンにもデスクトップにもスマートフォンにもGPUは搭載されています。GPUには多数の並列演算ユニットがあります。CPUで映像をデコードしている間に使われていないこの演算能力を、デコードにも活用しようという発想です。</p><p>GPUをプログラムする方法にはCUDAやOpenCLなどがありますが、Lynneが選んだのは<strong>Vulkan</strong>でした。VulkanはCUDAやOpenCLよりも低レベルなAPIで、面倒見の良さは一切ありません。Lynneの言葉を借りれば、それをプログラムするのは「マゾヒストのための修行」です。その代わりに、GPUを高速かつきめ細かく制御できます。また、VulkanはCUDAのように特定のGPUメーカーに依存せず、Mac、Windows、Linux、Androidなど複数の環境で利用できます。</p><h4>FFV1、アーカイブ現場の不満から秒間500フレームへ</h4><p>FFmpegのVulkan対応は、ある意味偶然のきっかけから2024年に始まりました。アーカイブ業界のコミュニティから、<strong>FFV1</strong>のエンコードが遅すぎるという不満が寄せられたのです。FFV1はIETFで標準化されたロスレスコーデックです。KhronosのメンバーでもあるLynneは、Vulkanで何とかならないか調べることにしました。</p><p>掘り下げてみると、予想以上のものが見つかりました。FFV1は、いつの間にかアーカイブツールや一般的なロスレスストレージのほぼデフォルトの選択肢になっていました。Lynneが調べ始める前に思っていたよりも、はるかに広く使われていたのです。</p><p>立ちはだかったのは、FFV1の<strong>レンジコーダー</strong>でした。これはエントロピー符号化の一種で、直前の処理結果に依存して次の処理を進めるため、並列化が難しい仕組みです。</p><p>突破口になったのはビットストリームそのものでした。FFV1のフレームはすでに1024個の独立したスライスに分割されています。互いに独立したスライスは同時に処理できるため、それぞれの処理をGPUに割り当てられます。ただし、1024個の処理だけでは、数万個あるGPUの演算ユニットを十分に稼働させられません。</p><p>調べてみると、FFV1はスライスごとのコンテキスト情報を異例なほど豊富に持っていました。これはコーデックの効率を支える、動的に更新されるエントロピー符号化の状態です。</p><p>このコンテキスト情報を利用することで、スライスの内部からも並列性を引き出せることがわかりました。その結果、1024個のスライスから、当初のおよそ32倍、合計でおよそ32,768個の並列実行単位を引き出せました。これですべての演算ユニットを使い切れるわけではありませんが、Lynneの言葉を借りれば「十分」でした。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngNp5HtokBdH9fVaCxgtUg.jpeg" /></figure><p>コーデックのGPU対応では、CPUで処理の一部を済ませ、DCTなど並列化しやすい処理だけをGPUに任せる方法も考えられます。しかし、処理途中で得られる係数データは、圧縮された入力データより容量が大きくなります。そのデータをPCI Express経由でCPUとGPUの間で転送すると負担が大きいため、この方法は採用しませんでした。</p><p>FFV1では、通常数十メガバイトある圧縮された入力パケットを、GPUメモリへ事前にコピーする手間も省きました。ここで使うのが、Vulkanによるホストメモリのマッピングです。CPU側で保持している入力データを、GPUから直接参照できるようにします。GPUはPCI Express経由で必要なデータを直接読み取り、その過程で自らキャッシュも行います。</p><p>このホストメモリのマッピングこそ、この取り組み全体を支えた本当のブレークスルーだった、とLynneは語ります。</p><p>高速化の効果は、ベンチマークの結果にはっきり表れました。RTX 6000 Ada上で、4K・10ビットのFFV1エンコード・デコードは秒間およそ500フレームに達しました。GPUの数パーセントしか使わずに、ロスレスの画面録画を実用にできるほどの速度です。この高速化により、従来ProResを使っていた制作工程の多くを、完全ロスレスのFFV1に置き換える道も開けました。FFV1なら、エンコードとデコードを繰り返しても世代劣化が生じません。</p><h4>ProResにも同じ手法を</h4><p>FFV1で使った、独立したスライスを並列に処理する考え方は、ProResにも応用できます。ProResのスライスはより小さいものの、内部からさらに並列性を引き出せないかを調べました。各スライスの内部にも係数の冗長性が残っており、それを利用した予測的なデコードによって、さらに並列性を引き出せました。</p><p>これにより、並列に実行できる処理数は、1フレームあたり数千から、5.7Kフレームでは約25,000まで増えました。こうした大規模な並列処理を想定していなかったコーデックでも、GPUの演算能力を十分に活用できるようになったのです。一般的なコンシューマー向けハードウェアで、その結果はいまやApple純正の専用アクセラレーターカードの性能を上回っています。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHZ59b5_4kxuC_PrqbVJJg.jpeg" /></figure><h4>ProRes RAWを解読する</h4><p>話をカメラに戻しましょう。カメラのセンサーから得られるRAWデータを記録する形式が、<strong>ProRes RAW</strong>です。通常のProResとは異なる形式のため、デコードの仕組みを別途解析する必要がありました。Lynneが紹介したカメラもProRes RAWで記録できます。しかし、Appleはこのフォーマットの仕様を公開していません。</p><p>Lynneの手元にあったのは、既存デコーダーのバイナリと、解析ツールの<strong>Ghidra</strong>だけでした。何週間も逆アセンブルしたコードを読み解き、入力から出力まで一つひとつのデータがどこへ流れていくかを追いかけた末に、どうにか動くと言えるデコーダーができあがりました。多くの映像は復元できたものの、一部では画像が崩れる不具合が残っていました。それでもLynneらは、ひとまず実用に足ると判断して公開し、その後もおよそ1年にわたってバグの修正を続けました。</p><p>次の手がかりは、別のベンダーが作った、CUDAを使ってGPUで高速化されたProRes RAWデコーダーでした。このデコーダーを解析する狙いは、ProRes RAWを正しく復元するために必要な処理を確かめることでした。別の実装を調べれば、まだ解明できていない処理の手がかりが得られるかもしれません。</p><p>そのCUDAカーネルの中身を調べると、次のようなことがわかりました。エントロピーデコードをCPU側で行うため、中間データの転送が帯域を圧迫し、処理速度を落としていました。GPUが担当するのは8x8のDCTだけで、その後はデベイヤー、色処理、出力へと処理が進みます。</p><p>ProRes RAWの生データ処理チェーンに、隠された仕掛けは何もありませんでした。必要な変換情報は、カメラが出力するファイル内の小さなテーブルに含まれていました。デコーダー側でこのテーブルを適用することで、仕様に準拠した出力を得られるとわかりました。</p><p>正しく復元する仕組みを解明したうえで、GPUによる高速化も進めました。FFmpegのCPUデコーダーでは、12スレッドを使っても秒間およそ3フレームにとどまります。一方、VulkanによるGPUデコードなら、スライスを並列に処理できるため、2024年発売の一般的なノートパソコンの内蔵GPUでも、撮影現場で映像を素早くプレビューできる速度が得られます。この実装はすでにFFmpegにマージされており、macOSを含むあらゆる環境で動きます。</p><h4>FFmpegのデコーダー実装を信頼できるか</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7OaeOictts3UhY-WTervw.jpeg" /></figure><p>高速に動くとしても、FFmpegのデコーダーが正しく映像を復元できているかは、別に確認する必要があります。Lynneによれば、同じ圧縮データをVulkanデコーダーと既存のソフトウェアデコーダー（CPUで動作）でそれぞれ復元し、得られた画像が一致することを継続的に確認しているといいます。</p><p>ただし、比較対象となるFFmpegのProResとProRes RAWのソフトウェアデコーダーも、リバースエンジニアリングによって作られたものです。これらはAppleの公式製品ではなく、Appleが承認・サポートする実装でもありません。そのうえでLynneは、自分はこれらの実装を信頼していると語りました。その理由として、両フォーマットの基礎にあるのは1980年代から90年代の既知の圧縮技術であり、秘密の技術が隠されているわけではない、と説明しました。</p><h4>DPX — 誰も守らない標準規格</h4><p>一方、仕様が公開されていても、各社の実装がその規格に従っているとは限りません。</p><p>フィルムスキャナーが出力する画像ファイル形式、<strong>DPX</strong>がその例です。</p><p>8ビット、10ビット、16ビットなどの非圧縮の画素データを扱う形式で、データは決まった規則で32ビット単位に詰めて格納されます。</p><p>データの位置を規則に従って計算できるため、GPUで並列に読み出す処理を実装しやすい形式です。</p><p>しかもこれは正式な<strong>SMPTE</strong>規格であり、白黒はっきりしていて解釈の余地はないはずです。</p><p>それでも<strong>Scanity</strong>や<strong>Laser Graphics</strong>のスキャナーは、この規格どおりには出力しません。</p><p>結果として、本来なら何の工夫も要らないはずのファイルを読むためだけに、FFmpegはベンダーごとの仕様逸脱に対応するための多数の例外処理を抱え込むはめになっています。</p><h4>APV — 特許にしばられない代替</h4><p>ProResへの依存を減らすには、別のコーデックで置き換える方法もあります。その選択肢として紹介されたのが<strong>APV</strong>です。SamsungやGoogleなどの支援のもとで開発され、ProResとほぼ同じ符号化構造を特許の縛りなしで実現しています。</p><p>Lynneは、FFmpegでのAPVの処理で秒間およそ1000フレームを達成したと報告しました。この高速化には、イーサネットで接続した機器同士のリアルタイム映像伝送にAPVを使う狙いがありました。</p><h4>JPEG 2000による上映用映像をGPUでデコードする</h4><p><strong>JPEG 2000</strong>は、そもそもインターネット向けの画像フォーマットとして生まれました。ところが、ふつうの画像に対しては素のJPEGより効率が悪く、インターネットの世界にはほとんど普及しませんでした。代わりにこれを採用したのがデジタルシネマです。映画館向けの上映用データパッケージであるDCPは、いまもすべてJPEG 2000を使っています。</p><p>JPEG 2000のデコード処理が遅くなる原因の1つが、<strong>MQコーダー</strong>と呼ばれる算術符号化の仕組みです。そのデコードは処理の順序に依存するため、CPUでは高速化しにくいとLynneは説明しました。それでも、JPEG 2000をデコードする以上、このMQコーダーの処理を避けて通ることはできません。</p><p>LynneはこれをGPU上で並列化し、4K、2K、8KのDCPデコードを200ドルほどのカード1枚でリアルタイムで行えるようにしました。Lynne自身、誇らしく思う成果だといいます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jR80emPP504I5PjE5eWevQ.jpeg" /></figure><h4>JPEG画像のデコードをGPUで高速化する</h4><p>ここまでJPEG 2000で使ってきた発想は、ふつうの<strong>JPEG</strong>にも同じように使えます。JPEGの圧縮データは、通常、先頭から順番に読み解いていきます。しかし、ハフマン符号には、先頭以外の位置から読み始めても、読み進めるうちに正しい符号の区切りを見つけられる性質があります。これを再同期と呼びます。この性質を利用すると、複数のGPU処理が圧縮データの異なる位置から同時にデコードを進められます。その後、各処理結果の位置関係を整えます。</p><p>結果として、AMD Radeon RX 6900 XT上で、2600万画素のJPEGファイルを秒間21枚デコードできるようになりました。写真家が大量の写真を確認する際にも、フル解像度の画像を次々に切り替えてプレビューできる速度です。</p><h4>完成に向けた開発資金を募る</h4><p>すべてがゴールにたどり着いたわけではありません。</p><p>並列JPEGエンコーダーと<strong>DNxHD</strong>/<strong>DNxHR</strong>のデコーダーはどちらもまだ開発途中で、完成に向けた開発資金を募っている段階だといいます。こうした映像制作向けのツール群は、作るのにも維持するのにもお金がかかるからです。Lynneは、実際の制作でDNxHD、JPEG、JPEG 2000を使っている人がいれば連絡してほしいと呼びかけました。</p><h4>アプリケーションに広がるVulkan対応</h4><p>これら一連の取り組みの狙いを、Lynneはこう語りました。</p><p>どんなハードウェアを持っているか、ライセンス料をいくら払う気があるかにかかわらず、誰もが高品質な映像を扱えるようにすることです。</p><p>FFmpegに統合済みの高速化機能は、標準のハードウェアアクセラレーションの仕組みを通じて利用できます。FFmpegのAPIを使うアプリケーションでは、1行の変更でVulkanによるデコードを有効にできます。</p><p><a href="https://mpv.io/"><strong>mpv</strong></a>の利用者にとっては、意識する必要すらありません。MP4でもProResファイルでもProRes RAWファイルでもDPXファイルでも、指定するだけでVulkanによるハードウェアアクセラレーションが使われます。<br><a href="https://www.shotcut.org/"><strong>Shotcut</strong></a>はすでにこの高速化機能を標準で有効にしています。<br><a href="https://www.blender.org/download/"><strong>Blender</strong></a>はまだで、プルリクエストは出されているものの、レビュー待ちの状態です。</p><h3>Designing Reactive Infrastructure for Live Events</h3><p>by <a href="https://www.linkedin.com/in/tvald/">Tony Valderrama</a>（<a href="https://www.gomomento.com/jp/">Momento</a>）</p><p>数年前のスーパーボウル当日、1,550万台のデバイスで、同じ試合が同時に再生されていました。システムチームなら、誇らしげにスライドへ載せたくなる数字でしょう。ここで課題になるのは、配信中にCDNの性能が低下したとき、それをいかに早く検知して対応するかです。エンジニアがそれに気づくまで、どれだけかかるか。そして、視聴者がそれに気づくまで、どれだけかかるか。</p><p>MomentoのエンジニアTony Valderramaは、この問いを出発点に、QoEモニタリング、パーソナライゼーション、海賊版対策を取り上げました。デバイスから届くビーコンデータをもとに判断し、ユーザー体験へ反映するパイプラインを、どう作るかという話です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PW-lCXLJd74xSSDdxPLfLw.jpeg" /></figure><p>Momentoの役割を理解するには、CDNとの違いを押さえる必要があります。MomentoはCDNではありません。CDNは世界各地にPOPサーバーを展開しますが、MomentoのサーバーはAWSやGoogle Cloud、Azureの単一リージョン内に置かれています。そのうえでMomentoが受け持つのは、アプリケーションのデータストアと、その外側のインターネットとのあいだにあるエッジ層です。ここでデータのルーティング、計算処理、保存を行い、アプリケーション側のデータをCDNへ渡したり、デバイスへ直接届けたりします。こうした基盤を提供するMomentoのTonyが、異なる3つのユースケースを取り上げたのはなぜでしょうか。</p><h4>3つのユースケースに共通する構造</h4><p>QoE（Quality of Experience）モニタリングでは、リバッファー率や再生開始までにかかった時間、フレームドロップ数といった指標が、トラフィックを別のCDNへ誘導すべきかどうかの判断材料になります。フィードのパーソナライゼーションでは、クリックや滞在時間の記録に応じて、視聴者が次に目にするものが組み替わります。海賊版対策では、位置情報とデバイスフィンガープリントが、その映像ストリームの配信を継続してよいかどうかをリアルタイムに判断するための材料になります。</p><p>これらは別々のチームが開発することも多く、一見すると異なるシステムに見えます。しかしTonyは、いずれも共通する4段階の構造で捉えられると説明しました。この共通構造が、講演全体の中心となる考え方です。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91u2D8ENjqytT8qhQS1e0Q.jpeg" /></figure><p>まず、数百万台のデバイスから届く計測データ（ビーコン）を受け取る「取り込み（ingestion）」です。次の「処理（processing）」では、ビーコンをキーごとに集め、順序のあるデータストリームに整理します。「ストレージと分析（storage and analytics）」では、CDNの性能低下や不正配信の有無など、用途に応じた判断に必要な情報を得ます。最後の「意思決定（decisioning）」で、その結果をAPIの動作に反映します。用途や画面は異なっても、基盤となる構造は共通しています。</p><p>データは、取り込み、処理、ストレージと分析、意思決定の順に流れます。設計するときは、その逆に、アプリケーションに必要な意思決定から考えます。そこから逆算して、どんなストレージが要るのか、どんな処理が要るのか、取り込みにどんな制約をかけるのかを決めていきます。この向きを取り違えて、取り込みから順に組み立てるとどうなるか。安くないコストを払って何もかも集めておきながら、その大半に対しては何のアクションも取れない。そういうシステムができあがります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdJkTDjOsknJ4fDciQUo9Q.jpeg" /></figure><p>この逆算にあたって考えるべき問いは、3つあります。まず、どのシグナルが実際に意思決定の材料になるのか。1回のビーコンに何もかも載せるわけにはいきません。たとえば、海賊版対策には位置情報が必要か、再生品質の判断にはフレームドロップ数が必要かを、あらかじめ検討します。</p><p>次に、デバイスで何かが起きてから意思決定が下るまで、どれだけの遅れなら許容できるか。サーバー側の処理を高速化しても、ビーコンがインターネットを渡って届くまでの待ち時間は短くなりません。ビーコンの到着に数秒かかる状況で、サーバー側の処理を1秒から100ミリ秒へ縮めるためにコストをかける価値があるのか。必要な応答速度と、通信を含めた全体の所要時間を踏まえて、どこまで高速化するかを決める必要があります。</p><p>そして、エンジニアがつい尻込みしがちな問いもあります。ビーコンをどれだけ取りこぼしても構わないか、です。そもそも、デバイスから送られるビーコンは、取り込みステージに届く前のインターネット上でも失われていることがあります。だとすれば、エッジでもう少し取りこぼしても構わないと割り切るだけで、パイプラインは劇的にシンプルで安上がりになります。</p><h4>取り込みステージ：オートスケーリングで対応できない急増に備える</h4><p>講演で示されたスーパーボウル中継の同時視聴者数のグラフでは、8時間の放送のうちハーフタイムに大きなピークが見られます。Tonyの言葉を借りれば、人々は試合そのものよりもハーフタイムショーを愛しているからです。時間軸を拡大すると、そのほかの時間帯でも細かな増減が続いていることが分かります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N36By1zCB2Rc7FYC7HXkKg.jpeg" /></figure><p>ライブスポーツのトラフィックはなだらかには増えません。試合が動いたことを友人から聞いたり、プッシュ通知が飛んできたり、グループチャットがざわついたりするたびに、それを知った人たちが一斉に見に来ます。だからトラフィックは、あちこちで同時に跳ね上がるのです。トラフィックがなだらかに増えることを前提にチューニングしたオートスケーリングポリシーでは、この動き方にまったく追いつけません。</p><p>ゲートウェイの役割は、トラフィックの急増を吸収し、下流のシステムにかかる負荷を抑えることです。ゲートウェイを設けなかったり、その処理能力が不十分だったりすると、大量のリクエストがそのままデータ層に届きます。それに耐えるためだけに、データ層に割り当てるリソースをゲートウェイがある場合の3倍から10倍まで増やすはめになります。</p><p>クライアント1台が送るビーコンに、実際に載せるべきデータはわずかです。プレイヤーIDやクライアントIDのような識別用のフィールドが1つか2つ、あとは判断の材料になるデータだけで足ります。QoEモニタリングならリバッファー率と再生開始までの時間、パーソナライゼーションならクリックと滞在時間、海賊版対策ならフィンガープリントと位置情報、といった具合です。</p><p>ここで出てくるのが、とりあえず必要そうなデータを全部送っておいて仕分けはデータパイプラインの下流に任せればいい、という誘惑です。しかし、そうやって足したフィールドはすべて、インターネットを通ってこちらのシステムまで運ばれます。1台あたりではわずかな差でも、数百万台が数秒おきに送ってくれば、転送量は桁違いに膨らみます。</p><p>ここまでは、ビーコンのトラフィックの変動に、ゲートウェイで対応するという話をしてきました。けれど、流入するトラフィックや下流の処理負荷を抑えるために、こちらから手を入れられるところが2つあります。</p><p>1つ目はビーコン周期、つまりクライアントがどれくらいの頻度でビーコンを送信するかです。ビーコン周期を固定したままクライアント数を3倍にすれば、秒間リクエスト数も3倍になります。クライアント数を一定に保ったまま、ビーコン周期を10秒から1秒に縮めれば、トラフィックは10倍になります。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oT1j84KdoTOfXTTVYARePg.jpeg" /></figure><p>ビーコンの送信周期や送信する項目はクライアント側に設定されるため、多様なデバイスに変更を行き渡らせるのは容易ではありません。設定を変更したプレイヤーを、アプリストアやTV向けプラットフォームを通じて配布する場合には、数か月かかることもあります。Tonyの助言は、まず控えめに始めるというものでした。ビーコン周期は長めに取り、載せるデータも最小限にしておきます。下流のインフラに処理能力の余裕があると確認できてから、はじめて周期を縮めるなり、データを増やすなりするということです。</p><p>2つ目はバッチ化です。Momento自身のゲートウェイも、まさにこのために設計されています。単純なルーターがそうするように、届いたビーコンをそのまま素通りさせれば、下流のあらゆるシステムがリクエスト1件ごとの固定オーバーヘッドを払うことになります。そうではなく、10ミリ秒分または100メッセージ分のデータをまとめてから流すようにすれば、下流の負荷は10分の1から100分の1になります。ビーコンは1件あたり数キロバイトと小さいため、リクエストごとの固定オーバーヘッドが相対的に大きくなります。</p><p>10ミリ秒の遅れと聞くと、それだけで問題になりそうに思えるかもしれません。実際には問題になりません。すでにインターネット転送だけで数秒、下流の処理でも数十から数百ミリ秒が費やされるので、その程度は誤差の範囲です。Momentoが支援したスーパーボウルやワールドカップ、マーチマッドネスなどの現場でも、この溜める時間はだいたい10ミリ秒から100ミリ秒のあいだに収まっています。</p><p>ただし、バッチ化にはデータを失うリスクも伴います。溜めているあいだ、そのデータを持っているのはゲートウェイだけです。ここでゲートウェイが落ちれば、溜めていたぶんはそのまま消えます。データを溜める時間が長いほど、障害時に失われる可能性のあるデータも増えます。その時間は、何ミリ秒分までのデータ消失を許容できるかも踏まえて決めます。先ほどの「ビーコンをどれだけ取りこぼしても構わないか」という問いが、ここで具体的な設計判断につながります。</p><p>こうした役割を踏まえると、ゲートウェイを単に削るべきコスト項目として見てはいけません。下流のシステムを適正な規模に収められるかどうかは、ゲートウェイの出来で決まります。</p><p>ここで1つ、陥りがちな罠があります。リクエスト1件ごとに課金されるサービスは、ビーコンの取り込みには向きません。ペイロードは数キロバイトしかないのに、リクエスト件数は数百万台ぶん積み上がるからです。Webアプリケーションファイアウォールのようなものを前段に重ねれば、請求はさらに膨らみます。</p><p><strong>AWS API Gateway</strong>のようなサービスは、複雑なリクエスト処理に対応する多くの機能を備えています。ビーコンの取り込みに要るのは、TLS終端と下流システムを保護するための基本的な機能、そしてビーコンをまとめて下流へ送る処理です。この用途にAPI Gatewayを使うのは、まったく見合いません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6sfJoKtaM4hJGCuHeBsNA.jpeg" /></figure><p>選ぶべきは、リクエストの件数ではなく処理したギガバイト数で課金されるサービスです。専用のゲートウェイサービスを選ぶ際には、こうした課金体系に注目します。<strong>Envoy</strong>などを使って自前で構築する場合も、転送量や、それに応じて必要になるサーバーの規模を中心にコストを考えます。</p><h4>処理ステージ：ばらばらに届いたビーコンをキーごとに整理する</h4><p>処理ステージには、ゲートウェイで複数のビーコンをまとめたデータが届きます。ただし、同じユーザーやセッションに関するデータが、複数のゲートウェイからばらばらに届くことがあります。処理ステージでは、キーに応じてデータをシャードに集め、シャードごとに順序のあるデータストリームへ整理します。</p><p>この処理にMomentoが使っているのが<strong>Valkey</strong>です。Redisのライセンス変更を受けて生まれたオープンソースのフォークで、AWSやGoogle Cloud、Azureでも運用されており、Momento自身もその開発に貢献しています。Valkeyに渡ったデータは、複数のノードのメモリ上にコピーが作られます。そのため、1台が故障しても別のノードにデータが残り、ゲートウェイだけで保持している段階より消失のリスクを抑えられます。</p><p>Valkeyでは、データの振り分け先となるシャードがキーによって決まります。そのため、別々のゲートウェイから届いたデータでも、同じキーを持つものは同じシャードに集まります。この構成では、複数のゲートウェイから届くデータを集め、順に処理できるよう整理する役割をValkeyが担っています。同様の役割に<strong>Kafka</strong>を使う構成もあります。</p><p>シャードキーの選び方は、とても重要です。何を基準にデータを分けるかによって、分析にかかる時間が変わるからです。たとえば、クライアントIDを基準に分けると、同じ地域のデータでも複数のシャードに分散します。その状態で地域ごとの配信品質を調べようとすると、複数のシャードからデータを集める必要があり、そのぶん分析に時間がかかります。あらかじめ分析の目的に合うキーを選び、一緒に分析するデータを同じシャードに集めておけば、この手間を減らせます。</p><p>QoEモニタリングなら、地域ごとにシャードを分けることで、同じ場所で発生するインシデントに関するデータをまとめられます。パーソナライゼーションでは、ユーザーIDを基準にデータを分けます。接続先のゲートウェイが変わっても、同じユーザーのクリックや視聴のデータは同じシャードに集まるため、その人の活動履歴としてまとめて扱えます。海賊版対策では、セッションキーを基準にデータを分けます。同じキーの利用状況が同じシャードに集まるため、離れた地域から同時に使われていないかなど、不正利用の兆候を調べやすくなります。</p><p>Valkeyでデータを整理したら、各ビーコンのバリデーションを行います。明らかに形式が不正なリクエストは、すでにゲートウェイで除外されています。ここではさらに、ビーコンがスキーマに沿っているか、内容に矛盾や不自然な値がないかを確認します。</p><p>この確認はすべてのビーコンに対して行うため、処理を軽く保つことが大切です。複数のデータソースを結合したり、データを集計したりする重い処理は、下流のストレージと分析に任せます。Momentoは、この段階のバリデーションなどを、Valkeyに組み込んだ<strong>WebAssembly</strong>関数で実行しています。Valkeyが標準で備えるLuaスクリプトよりも、処理が速く、負荷も小さいためです。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXftpuwhvciPiwQj_nyowQ.jpeg" /></figure><p>このほか、保存先に合わせてデータ形式を変換することもあります。たとえば、アーカイブ用のデータを<strong>Parquet</strong>形式に変換してから保存先へ送ります。</p><p>アーカイブには、バリデーションに失敗したビーコンも含めて、受信したデータをすべて残しておくことが大切です。プレイヤーは多様なデバイスに対応し、開発には複数のチームが関わります。そのため、十分に注意して開発していても、本番環境で想定外の形式や内容のビーコンが送られてくることがあります。そのデータを捨てずに残しておけば、実際に何が送られてきたのかを確認し、不具合の原因を調べられます。オブジェクトストレージを使えば、こうした調査用のデータも低コストで保存できます。</p><h4>ストレージと分析ステージ：ユースケースに合わせて選ぶ</h4><p>取り込みステージと処理ステージは、3つのユースケースのどれを作ってもほぼ同じ作りになります。ユースケースごとに別のソリューションを使うことになるのは、ここからです。ストレージは、好きなデータベースを選べばよいというものではありません。そのユースケースが答えたい問いによって、選ぶべきものが変わります。そして、すべての問いにうまく答えられるデータベースは存在しません。1つのストアですべてを賄おうとすると、そのストアが想定していない使い方まで押し込むことになります。そのぶん余計にリソースを積むことになり、コストだけが膨らみます。</p><p>QoEモニタリングには、配信後の振り返り分析、配信中の調査、異常の即時検知といった用途があり、それぞれ結果が得られるまでの許容時間が異なります。配信が終わったあとの振り返り分析では、クエリの実行に数時間かかっても許容できます。データをすべて<strong>S3</strong>に保存し、アナリストが必要に応じてクエリエンジンでさまざまな問いを調べられるようにしておけば十分です。</p><p>配信中の調査では、結果を待てる時間が短くなります。あるリージョンでレイテンシがじわじわ上がっているのを見ているオペレーターには、数時間ではなく数秒での答えが必要です。この用途に適した選択肢の1つとして、<strong>ClickHouse</strong>が挙げられます。</p><p>1秒未満での検知には、さらに短い処理時間が求められます。Foxとのスーパーボウルの取り組みでは、特定の劣化シナリオに対して1秒未満でアラートを出せるかを検証するため、Valkeyのローリングカウンターを用いました。このカウンターは、1秒間や10秒間などの時間枠で、監視したい条件に合うイベントが何件届いたかを数えます。イベントが届くたびに値を更新しておくため、アラートの判定時にデータを集計し直す手間を省けます。レートリミッティングでも、同じように一定時間内の件数を数えます。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5ayS_EycCcYXiVg5gknAA.jpeg" /></figure><p>パーソナライゼーションでは、ユーザーごとに「次にどのコンテンツを見せるか」を判断します。多くのユーザーのデータから配信品質の問題を探すQoEモニタリングとは、分析の目的が変わります。</p><p>この判断によく使われるのが、2タワー方式のシステムです。コンテンツ側のタワーは、記事や動画それぞれの特徴をベクトルで表します。ユーザー側のタワーは、クリックや視聴の履歴から、その人の関心を表すベクトルを作ります。フィードの並び順を決める際には、ユーザーのベクトルと各コンテンツのベクトルを比較し、その人の関心に合うコンテンツを選びます。</p><p>この2種類のベクトルは、更新するタイミングも異なります。コンテンツ側は、新しい記事や動画が追加される頻度に合わせて計算します。1日に数本を公開するスポーツサイトなら、事前にまとめて計算しておけます。一方、投稿が絶え間なく届くソーシャルプラットフォームでは、新しい投稿に応じてその都度計算する場合もあります。ユーザー側は、その人のクリックや視聴のデータが届くたびに、関心を表すベクトルを更新していきます。</p><h4>意思決定ステージ：判断をAPIの動作へ反映する</h4><p>データの取り込みも、順序づけも、分析も、ここまではすべて下ごしらえです。分析から得られた判断をAPIの動作に反映し、配信品質や表示内容などのユーザー体験を変える。それが意思決定ステージの役割です。</p><p>ここで注意したいのが、分析処理とAPIの応答をどう結びつけるかです。ありがちなのは、ユーザーからのリクエストが来るたびに分析ストアへ問い合わせ、返ってきた結果で応答を変える設計です。これだと分析ストアが、ユーザーリクエストのクリティカルパスに乗ってしまいます。分析ストアで遅延や不調が起きると、それを待つAPIの応答にも影響がおよびます。そのため、高頻度のクエリに対応するよう設計された分析ストアを使う場合を除き、この構成はオススメできません。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cadRL_GK_47u51pSmQxR2A.jpeg" /></figure><p>そこで、判定処理をバックグラウンドで実行し、その結果を後から届くリクエストへの応答に使う設計を考えます。海賊版対策がその一例です。ライブ配信では、クライアントが数秒おきに映像セグメントを要求するため、次の要求までの時間を不正利用の判定に使えます。ただし、この方法では判定が終わるまでに映像の一部を配信することになります。Tonyは、その間の1〜数セグメントの配信を許容するという設計例を示しました。</p><p>最初のセグメント要求には、判定を待たずに映像を返します。それと並行して、ポリシーエンジンがセッションキーごとの利用状況を調べ、同じキーが離れた地域から同時に使われていないか、多数の映像ストリームで使われていないかなどを確認します。不正利用と判定したら、その後のセグメント要求に対して配信を停止します。こうすることで、映像を返すたびに判定処理の完了を待つ必要がなくなります。</p><p>パーソナライゼーションでも、フィードの表示要求を受けるたびに並び順を計算し直す必要はありません。技術的には可能でも、見るたびに記事や動画の位置が変わってしまうからです。</p><p>そこで、ユーザーの関心を更新する処理と、フィードの並び順を決める処理を、それぞれ別のタイミングで実行します。関心を表すベクトルは、クリックや視聴のデータが届くたびに更新します。一方、そのベクトルを各コンテンツのベクトルと比較し、並び順を計算し直す処理は、1分、10分、30分などの間隔で行います。</p><p>並び順を更新する間隔は、新しいコンテンツが公開される頻度や、ユーザーにどのくらい早く届けたいかに合わせて決めます。Tonyは、1時間ごとに記事を公開するスポーツサイトなら、記事の公開よりも頻繁にフィードを更新しても効果は乏しいと説明しました。一方、新しい投稿をつねに見せたいソーシャルフィードなら、60秒ごとに更新することも考えられます。処理速度だけを追求するのではなく、そのサービスのユーザー体験に合う更新頻度を選ぶということです。</p><h4>システムはどこまで自分で決めるべきか</h4><p>システムが判断を下せることと、その判断に基づく対応を人の確認なしに実行してよいことは、別の問題です。この自律の度合いを、Tonyは自動化の5段階に整理しました。CDNのステアリングを例にすると、次のようになります。</p><p>1. <strong>監視</strong>：人間がダッシュボードを見て状況を調べる。<br>2. <strong>通知</strong>：異常を検知するとアラートを出す。<br>3. <strong>診断支援</strong>：システムが原因の候補を示す。<br>4. <strong>対処支援</strong>：システムが対応案を示し、人間の承認を受けて実行する。<br>5. <strong>完全自律</strong>：人間の承認を挟まず、システムが対応まで実行する。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjtrPHFhqlt5Rny6HqB7cg.jpeg" /></figure><p>Tonyは、多くの場合、システムが提案した対応を人間が承認してから実行する「対処支援」の段階に留めるのがよいと考えています。ただし、対応を実行する条件と、そのとき何をするかを事前に厳密に定めておけば、人間の承認なしで実行を任せられる場合もあります。たとえば、配信に使っているプライマリCDNの性能低下を検知し、あらかじめ決めた条件を満たしたら、指定のセカンダリCDNへ自動的に切り替える設計です。</p><p>また、自動化というとAIを思い浮かべがちですが、決定論的なルールでもかなりのところまで対応できるとTonyは指摘しました。同じ条件に対して同じ判断を返すため、挙動を予測しやすいことが、その信頼性につながります。ただし、どんな障害が起こりうるか、それぞれにどう対応するかを、事前に洗い出しておく必要があります。</p><p>AIによる自動化の注意点として、Tonyは海賊版対策を挙げました。AIに不正利用の兆候を探させる場合、その判定だけでユーザーの利用を自動的に停止してよいかは、慎重に考える必要があります。ハルシネーションによって、根拠のない不正利用の疑いを生み出し、正当なユーザーまで利用停止にしてしまうおそれがあるからです。</p><p>こうした誤判定の影響も踏まえ、どこまでシステムに任せるかを決めます。最初からすべてを自動化するのではなく、開発・運用チームがシステムの判断や動作を確認し、信頼できるようになってから、自動化の範囲を段階的に広げていくということです。その積み重ねによって、状況の変化に応じて配信や表示内容を調整できるプロダクトを目指します。</p><p>講演の冒頭で紹介されたのは、1,550万台のデバイスで同時に再生されていたスーパーボウルの事例でした。配信中にCDNの性能が低下したら、運用側が気づくまでにどれだけかかるか。そして、視聴者が気づくまでにどれだけかかるか。</p><p>こうした問題に素早く対応するには、たとえば「どの条件でCDNを切り替えるか」のように、システムが下すべき判断を先に定める必要があります。その判断に必要なデータと、判断までに許容できる時間を明確にしたうえで、ストレージや処理方法、データの取り込み方を選んでいきます。ユーザー体験をどう変えたいかを出発点に、必要な基盤を逆算して設計する。それが、講演を通じたTonyのメッセージでした。</p><p>今回の話題に興味を持った方は、ぜひ次回のTokyo Video Techにもご参加ください。<a href="https://luma.com/tokyo-video-tech?utm_source=medium_cta">LumaのTokyo Video Techページ</a>で「フォロー」をクリックすると、今後のイベント開催案内を受け取れます。会場でお会いできるのを楽しみにしています！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d45d76e944f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tokyo-video-tech/2026-09-03-tokyo-video-tech-13-seminar-report-ja-d45d76e944f0">2026–09–03 Tokyo Video Tech #13 “Accelerate” 開催レポート (ja)</a> was originally published in <a href="https://medium.com/tokyo-video-tech">Tokyo Video Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Rails and K8s Newcomer Cut GKE Costs by 60% by Looking Across the Stack]]></title>
            <link>https://medium.com/@ksakai/how-a-rails-and-k8s-newcomer-cut-gke-costs-by-60-by-looking-across-the-stack-99e53a925ee7?source=rss-4ba93b09062------2</link>
            <guid isPermaLink="false">https://medium.com/p/99e53a925ee7</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Katz Sakai]]></dc:creator>
            <pubDate>Sun, 24 May 2026 11:53:55 GMT</pubDate>
            <atom:updated>2026-05-24T11:53:55.696Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ep_1AIGa5f-V7VaW" /><figcaption>Photo by <a href="https://unsplash.com/@jplenio?utm_source=medium&amp;utm_medium=referral">Johannes Plenio</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>tl;dr:</strong> This is a journal of how an engineer with no prior Rails or Kubernetes experience cut Google Kubernetes Engine (GKE) costs by 60%. The following steps were taken to achieve this cost reduction:</p><ul><li>Puma, which hosts the Rails app, was running with 1 worker and 33 threads. Because Ruby has the GVL, only one core was effectively being used. Changing to 4 workers and 8 threads let the Rails app take advantage of multi-core CPUs and process multiple requests more effectively per Pod.</li><li>Every API request was running bcrypt for token authentication. This was clearly too much overhead for API token auth, so replacing it with a lighter scheme reduced per-request CPU load.</li><li>The GKE Nodes running the Pods were on an older machine generation. Upgrading from n1 to n2d gave 56% better CPU performance, 23% more memory, and a 3% cost reduction, which improved Pod density per Node.</li><li>There was no autoscaling for either Pods or Nodes, so capacity was always provisioned for peak traffic. By introducing KEDA for Pod autoscaling and GKE Cluster Autoscaler for Node autoscaling, capacity now scales with actual traffic, so we only pay for what we use.</li></ul><p>As you can see, this cost reduction was achieved not only by changing the Kubernetes infrastructure settings, but also by tuning the Rails application running on top of it. It required a comprehensive understanding of the entire stack, from application to infrastructure, and a thorough review of the entire stack. For example, simply implementing Kubernetes autoscaling would only increase or decrease inefficient Pods and Nodes, resulting in limited cost savings.<br>Furthermore, looking at each individual steps, they might seem like insignificant improvements. However, diligently accumulating these small improvements ultimately led to a 60% cost reduction.</p><p>I work on a B2B SaaS platform that runs on Google Kubernetes Engine. The API server is a Rails application, and it was the biggest cost driver on our GKE cluster.</p><p>When I joined this project, I had virtually no experience with Ruby on Rails or Kubernetes. However, this lack of knowledge actually became a hidden strength. In other words, it allowed me to look at every implementation and configuration with a fresh perspective and keep asking “why is it implemented/configured this way?” until I was satisfied.</p><h3>The vicious cycle: why the cluster needed so many Pods</h3><p>The high cost was not caused by a single problem. It was a cycle:</p><ol><li><strong>Inefficiency:</strong> Running Puma as a single process meant CPUs were not being fully used. On top of that, running bcrypt on every API request added unnecessary CPU load. The Rails API was simply slow.</li><li><strong>Band-aid scaling:</strong> Instead of tuning Rails, the response to traffic was to add more GKE Nodes and Pods.</li><li><strong>Low cost-performance Nodes:</strong> GKE Nodes were running on older generation instances, so the cost per unit of CPU and memory was poor.</li><li><strong>Overprovisioning:</strong> Without autoscaling, the Pod and Node count was fixed to match peak traffic and stayed that way around the clock, which wasted a lot of resources.</li></ol><p>Several issues were driving costs up, and we had to tackle them one by one.</p><h3>How the cost actually came down</h3><p>Here’s what happened to costs. The chart below shows monthly GKE spending by SKU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*D9T3SUrenBeP08o7.png" /></figure><p>This was not mainly due to lower traffic. API traffic stayed fairly stable during this period, and the savings came mainly from efficiency improvements.</p><p>The cost came down in two steps.</p><p>In the first step (early 2025 through June 2025), we simply reduced Pod and node counts that were clearly excessive. This brought costs down from the peak, but it was just trimming fat. The underlying inefficiencies remained.</p><p>The second step (from July 2025 onward) is where most of the real savings came from. It breaks down into two parts:</p><ul><li><strong>Part 1: Making each Pod and node more efficient</strong></li><li><strong>Part 2: Scaling with demand</strong></li></ul><h3>Part 1: Making each Pod and node more efficient</h3><h3>1.1 GKE Node generation upgrade: n1-highmem-2 → n2d-highmem-2</h3><p>Our GKE nodes had been running on n1-highmem-2 since the early days of the service. The n1 family is Google Cloud’s first generation of general-purpose instances, based on older Intel Skylake/Broadwell processors.</p><p>We migrated to n2d-highmem-2, which uses AMD EPYC processors. That alone made the upgrade worth doing. According to <a href="https://docs.cloud.google.com/compute/docs/coremark-scores-of-vm-instances?hl=ja">Google’s official CoreMark benchmarks</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*N4lrqtmX6EVx5poZ.png" /></figure><p>Just upgrading the Node type gives 56% better CPU performance, 23% more RAM, and a 3% lower cost. The migration had no surprises: update the Node Pool configuration, cordon and drain the old Nodes, switch to the new Node Pool. This was done in July 2025 and shows up as a SKU change in the cost graph above.</p><p>For binary compatibility with existing Docker images, x86-based machines were used rather than Arm. Switching to Arm for further cost reduction is something being considered for the future.</p><h3>1.2 Rails process model: from 33 threads to 4 workers</h3><p>This was where most of the savings came from.</p><p>Our Rails application was running Puma with the following configuration:</p><ul><li>WEB_CONCURRENCY was not set (defaults to 1, meaning a single worker process)</li><li>RAILS_MAX_THREADS=33</li></ul><p>That is one process with 33 threads. At first, it looked like this should handle up to 33 concurrent requests, but that was not how it worked in practice. The reason is how Ruby works.</p><p><strong>Ruby’s Global VM Lock (GVL)</strong></p><p><a href="https://rubykaigi.org/2023/presentations/KnuX.html">Ruby has a Global VM Lock (GVL)</a>. Within a single process, only one thread can execute Ruby code at a time. (Threads waiting on I/O such as DB queries, HTTP requests, or file reads do release the GVL, allowing other threads to run.)</p><p>The API server was CPU-bound, so even with 33 threads in one process, effective parallelism was essentially 1. Having 33 threads did not mean 33 requests being processed simultaneously.</p><p>The Nodes running the Pods had multi-core CPUs, but the GVL meant each Pod was effectively using only one core.</p><p><strong>The bcrypt problem</strong></p><p>On top of the GVL issue, every API request was running bcrypt for token authentication. bcrypt is a password hashing algorithm deliberately designed to be CPU-intensive in order to resist brute-force attacks. Running that expensive hash operation on every API request was using up CPU across all Pods. We replaced API token authentication with a lighter method for per-request token validation.</p><p><strong>The fix</strong></p><p>We changed the Puma configuration to:</p><ul><li>WEB_CONCURRENCY=4 (4 worker processes)</li><li>RAILS_MAX_THREADS=8</li></ul><p>With this setup, Puma spawns 4 worker processes, each with its own GVL, so multi-core CPUs can be used properly. Thread count was reduced from 33 to 8. For reference, since <a href="https://github.com/rails/rails/pull/50669">Rails 7.2, Puma’s default thread count per worker was reduced from 5 to 3</a>, so further reductions may make sense. For more on tuning workers and threads, see <a href="https://github.com/puma/puma/blob/main/docs/deployment.md">Deployment engineering for Puma</a>.</p><p>A fair question is whether going from 1 to 4 workers would also mean using 4x more memory. In practice it did not. Copy-on-Write (CoW) lets worker processes share program memory.<br>(Note that preload_app! needs to be set in the Puma configuration for CoW to work.)</p><p>Setting MALLOC_ARENA_MAX=2 in the Rails container environment also reduced per-Pod memory usage by about 20%. The details are in a separate article:</p><p><a href="https://medium.com/@ksakai/why-rails-app-memory-bloat-happens-causes-and-solutions-2025-edition-d288e71bf769">Why Rails App Memory Bloat Happens: Causes and Solutions (and How I Cut It by 20%)</a></p><p>By combining CoW, MALLOC_ARENA_MAX, and reducing the number of threads, the amount of memory used by the Pod decreased from 4.2 GiB to 3.5 GiB, even though the number of worker processes was increased from 1 to 4.</p><p>That said, the memory improvement was a side benefit. What mattered for cost was needing fewer Pods. With only one Puma worker per Pod and a CPU-bound API, each Pod could handle a limited number of concurrent requests. Moving to 4 workers per Pod meant the same traffic could be served with fewer Pods. Fewer Pods meant fewer Nodes, and that drove the cost down.</p><h3>Part 2: Scaling with demand</h3><p>Now that each Pod was running efficiently, the next step was to reduce costs by stopping unnecessary Pods and Nodes during off-peak hours. However, before enabling autoscaling, it was necessary to configure the system so that Pods could be safely started and stopped at any time.</p><h3>2.0 Prerequisites: making Pods safe to autoscale</h3><p>Autoscaling Pods means that Kubernetes creates and destroys Pods at any time. If your Pods are not set up for this, you trade cost savings for reliability problems.</p><p>We configured the following before enabling any autoscaling:</p><ul><li><strong>Startup probe:</strong> Our Rails applications can take time to start up (loading the framework, initializing gems, establishing DB connections, warming caches). Without a startup probe, Kubernetes may decide the Pod is not alive during initialization and kill it.</li><li><strong>Readiness probe:</strong> This tells Kubernetes whether a Pod is ready to accept traffic. When a Pod temporarily cannot handle requests (during heavy processing or after a brief DB connection loss), the readiness probe fails and Kubernetes removes that Pod from the Service endpoints. Once the probe recovers, the Pod is added back and starts receiving traffic again.</li><li><strong>Liveness probe:</strong> This detects Pods that are running but stuck (a hung Rails process, for example). Kubernetes automatically restarts them. This is important for long-running Pods.</li><li><strong>terminationGracePeriodSeconds + </strong><strong>preStop hook:</strong> The terminationGracePeriodSeconds is used to configure a graceful shutdown time for requests in progress after a termination signal SIGTERM is sent to a Pod during Pod scale-in (Pod deletion). Using this setting allows you to specify the time Kubernetes waits before forcibly terminating a Pod, making it easier to prevent request errors during scaling. However, this setting alone is not sufficient. Kubernetes processes sending the termination signal (SIGTERM) and detaching the Pod from the Service endpoint in parallel, so SIGTERM may arrive before the detachment is complete (after SIGTERM arrives, the Pod enters graceful shutdown and cannot accept new requests). Therefore, it is common to use a preStop hook to sleep for about 10 seconds, delaying the SIGTERM transmission, to ensure that detachment from the Service endpoint occurs before SIGTERM. For more on this timing issue, see <a href="https://engineering.rakuten.today/post/graceful-k8s-delpoyments/">Zero-Downtime Rolling Deployments in Kubernetes</a>.</li></ul><p>These are the things we needed to put in place before autoscaling safely. Without them, autoscaling may look fine in theory, but it can cause problems in production. For details on configuring each probe type, see the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/">Kubernetes documentation on liveness, readiness, and startup probes</a>.</p><h3>2.1 KEDA with Cron trigger</h3><p>As this is a B2B service, traffic is concentrated during weekday business hours (approximately 8:30 AM to 7:30 PM), and quiet at night and on weekends. This traffic pattern remained largely unchanged.</p><p>However, the number of Pod replicas (the number of running Pods) was fixed to match the maximum load during peak hours and ran 24/7, 365 days a year. This is a significant waste of resources.</p><p>Given this predictability, we chose <a href="https://keda.sh/">KEDA</a>’s Cron trigger. KEDA is an event-driven autoscaler for Kubernetes, and the Cron trigger is one of its simplest scaling options: it adjusts the replica count on a time-based schedule, rather than reacting to metrics like CPU or memory usage. If your traffic pattern is predictable, this is simpler and more reliable than reactive scaling. There is no lag waiting for metrics to cross a threshold, no risk of flapping, and the configuration is easy to understand.</p><p>Our configuration:</p><ul><li>Weekdays 08:00–20:00 JST: about 3–4x more replicas than the baseline off-hours level</li><li>All other times: baseline replica count</li></ul><p>No metrics, no thresholds, no reactive logic. For our traffic pattern, that simplicity was a strength.</p><p>Note that Cron-based scaling assumes a stable traffic pattern. If total request volume grows with business growth or the pattern itself changes, the current replica counts may not be enough. To catch that early, API response time and similar metrics are monitored externally on an ongoing basis. Degradation there is the signal to revisit the Cron scaling configuration.</p><p>Cron scaling is not something you set once and never touch again. It just tends to need fewer updates over time.</p><h3>2.2 GKE Node Autoscaling</h3><p>With KEDA changing Pod replica counts, GKE’s Cluster Autoscaler was enabled next.</p><p>The logic is simple: when KEDA scales Pods in, some nodes end up underutilized. The Cluster Autoscaler cordons those nodes and removes them. When KEDA scales Pods out, the autoscaler provisions new nodes to accommodate them. We configured a minimum node count for availability zone redundancy and a maximum to cap costs.</p><p>With KEDA controlling Pod count and Cluster Autoscaler controlling Node count, the cluster now uses only the capacity it actually needs.</p><h3>Results</h3><p>Comparing the H2 2024 average (before optimization) to the Q1 2026 average (after all changes were in place):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/0*WTw_XTqnQ2LP9wIF.png" /></figure><p>Costs have stabilized since the latter half of 2025, once the initial optimization is complete (see graph at the top of the page).</p><h3>Lessons learned</h3><p>None of this was clever. Puma config, auth scheme, node type, a cron schedule. Each change looked minor in isolation. Together they cut costs by 60%.</p><p><strong>Ruby’s GVL means adding threads to CPU-bound work does nothing.</strong> More processes, not more threads. Thread count only matters once you know how I/O-heavy the workload actually is.</p><p><strong>bcrypt is for password hashing, not API tokens.</strong> Running bcrypt on every API request was just a mistake. It’s slow by design, that’s the point for password hashing. Using it for per-request token verification was the wrong tool. We replaced it, and the CPU load dropped immediately.</p><p><strong>Simple autoscaling is often enough.</strong> KEDA has a lot of trigger types, metrics, queues, custom event sources. We used none of that. A Cron schedule matched our traffic pattern well enough, and it’s been lower maintenance than anything reactive would have been.</p><p><strong>Node generation matters more than it looks.</strong> Just upgrading from n1 to n2d gave 56% better CPU, 23% more memory, and 3% lower cost. If you are still on n1 instances, moving to n2d or similar is worth doing soon.</p><p><strong>Optimize the whole system, not just one layer.</strong> The key to this improvement was not just looking at the infrastructure or the application in isolation, but reviewing both together. Revising the Puma worker configuration and authentication method was an application-side improvement, while updating node generations and autoscaling were infrastructure-side improvements. Rather than tuning just one part, aiming for overall optimization while understanding the connections of the entire stack led to significant results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99e53a925ee7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>