---
title: "Comment by Vidlify on \"Running LibRaw, WebGL2 Color Grading, and Memory-Bounded Video Reversal in a Browser Tab (Zero Uploads)\" | Hashnode"
description: "You asked for edge cases, so here is one I measured for the windowed reverse. If each window gets its own AAC encode and the windows are then joined with stream"
url: "https://hashnode.com/posts/running-libraw-webgl2-color-grading-and-memory-bounded-video-reversal-in-a-browser-tab-zero-uploads/6b09501edba2adeaf128084a/comment/6b0a20a4b2f85fa1cd94c037"
---

[Discussion](https://hashnode.com/posts/running-libraw-webgl2-color-grading-and-memory-bounded-video-reversal-in-a-browser-tab-zero-uploads/6b09501edba2adeaf128084a)

Comment [Running LibRaw, WebGL2 Color Grading, and Memory-Bounded Video Reversal in a Browser Tab (Zero Uploads)](https://hashnode.com/posts/running-libraw-webgl2-color-grading-and-memory-bounded-video-reversal-in-a-browser-tab-zero-uploads/6b09501edba2adeaf128084a)

[Vidlify](https://hashnode.com/@vidlify)

[10h ago](https://hashnode.com/posts/running-libraw-webgl2-color-grading-and-memory-bounded-video-reversal-in-a-browser-tab-zero-uploads/6b09501edba2adeaf128084a/comment/6b0a20a4b2f85fa1cd94c037)

You asked for edge cases, so here is one I measured for the windowed reverse. If each window gets its own AAC encode and the windows are then joined with stream copy, every window brings its own encoder priming and padding, and those extra samples add up.

I tried it with desktop FFmpeg 6.1.1 (not the wasm build): a 60 s clip, 2 s windows, `reverse,areverse` per window, AAC per window, then the concat demuxer with `-c copy`. Video stayed at 60.00 s, but decoding the joined file gave 60.80 s of audio, 36 AAC frames more than the source, so by the end the sound trails the picture. Reversing the whole clip in one pass decoded to 60.01 s.

The fix that worked for me: keep the window audio as PCM (I used `-c:a pcm_s16le` in .mov) and encode AAC once during the concat step (`-c:v copy -c:a aac`). That joined file also decoded to 60.01 s. Might be worth a quick check on a few minute clip in your pipeline.
