The render gate that signs our MP4s
The release factory has fifteen steps. Step twelve is the render-verification gate. It sits right after the MP4 muxer and just before the YouTube terms-of-service pre-publish check. That location is not an accident. We want every quality and integrity check to happen while we still have access to the original audio stem and beat map. Once we move on, we only have a file path and a token.
The gate takes in three things. The first is the muxed MP4 from the previous step. The second is the original audio stem, a WAV file that came straight from Suno and was never re-encoded. The third is the beat map. That map is a list of timestamps marking every kick, snare, and phrase boundary that the scene cuts were supposed to follow. The gate also gets a small JSON file with the render settings, though it only uses that for logging. It does not take in the artwork, the description, or the title. Another step owns those.
The first checks are basic but necessary. The gate demuxes the MP4 into its video and audio tracks. It verifies that the container is ISO BMFF and that the file has exactly one video track and one audio track. It checks the codec strings: the video must be AVC or AV1, the audio must be AAC-LC. If the renderer accidentally produced a different codec, we want to know immediately. That happens more often than you would think, especially after a library upgrade.
Next comes duration. The video timeline must match the audio timeline within 400 milliseconds. That catches cases where the last cinematic clip ended early and the renderer repeated the previous frame. After that, the real sync check starts. The gate decodes the audio track from the MP4 to a raw PCM buffer. It does the same for the original WAV stem. Then it computes the onset envelope for both buffers and runs cross-correlation. A perfect sync shows a sharp peak at zero offset. The gate allows an average offset of one frame, 33 milliseconds. It also looks for drift. If the offset between the first minute and the last minute changes by more than 100 milliseconds, the gate flags it. Drift usually comes from a bad timestamp conversion. It is hard to catch by ear and impossible to catch by eye.
The visual check is less glamorous but catches a surprising number of failures. The gate decodes a frame every three seconds. For each pair of frames separated by one second, it computes the mean absolute luminance difference. If that difference is below a tiny threshold across more than a third of the pairs, the video is effectively static. A static background can be fine for a few seconds, but not for a whole release. We set the threshold to catch frozen frames, black loops, and cases where the video and audio were generated from the same prompt but never actually synced because Sora's output was ignored. The gate also checks audio clipping. It calculates the true peak level. If the peak exceeds -1 dBFS, or if the integrated loudness according to EBU R128 is more than 0.5 LU away from the stem's loudness, the file fails. This stops loudness normalization issues from being baked into a finished video.
If every check passes, the gate computes a SHA-256 hash of the entire MP4 file. It writes that hash, the gate's own version number, the render settings hash, and the current timestamp into a small JSON structure. Then it signs that JSON with a private key. The result is the verification token. That token is the proof. The next stage, the YouTube terms-of-service pre-publish check, only accepts a video file that comes with a valid signed token. It does not trust the file itself. The token says, in effect, that this exact file passed all of the above checks. If anything tried to swap in a different file, the hash would not match and the token would be invalid.
The handoff is one directory path and one token, passed to a small worker process. The worker re-checks the token signature and the hash, then proceeds to review the metadata against YouTube's policies. That separation means the policy checker never has to parse video files. It saves time and avoids giving the policy checker the power to decrypt or decode media. It only reads text. The render gate is not the last step, but it is the last step that touches the actual image and sound.