{"record":{"id":"8ab6e3f252e11b6e","repo":"affaan-m/ECC","slug":"decoder-produced-no-frames","errorCode":null,"errorMessage":"Decoder produced no frames","messagePattern":"Decoder produced no frames","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/media/glitch.py","lineNumber":96,"sourceCode":"            y = 0\n            while y < height:\n                bh = int(rng.integers(8, 28))\n                if rng.random() < 0.12 * p:\n                    shift = int(rng.integers(4, 40) * p) * (\n                        1 if rng.random() < 0.5 else -1\n                    )\n                    out[y : y + bh] = np.roll(out[y : y + bh], shift, axis=1)\n                y += bh\n            if p > 0.2:\n                r = int(2 + 8 * p)\n                b = int(1 + 6 * p)\n                out[:, :, 0] = np.roll(out[:, :, 0], r, axis=1)\n                out[:, :, 2] = np.roll(out[:, :, 2], -b, axis=1)\n        enc.stdin.write(out.tobytes())\n        n += 1\n\n    if not n:\n        raise RuntimeError(\"Decoder produced no frames\")\n    return n\n\n\ndef render(\n    source,\n    start,\n    duration,\n    output,\n    seed,\n    mode=\"drift\",\n    width=1920,\n    height=1080,\n    fps=30,\n    overwrite=False,\n):\n    geometry(width, height, fps, duration)\n    if not math.isfinite(start) or start < 0:\n        raise ValueError(\"Start must be finite and nonnegative\")","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/media/glitch.py#L78-L114","documentation":"transform_stream counts decoded frames n; if the decoder produced no frames at all it raises RuntimeError('Decoder produced no frames') instead of returning 0. This makes empty decoder output an explicit failure rather than silently producing an empty output file.","triggerScenarios":"The ffmpeg decode command yields zero frames (empty input file, invalid seek start beyond EOF, unsupported codec producing no packets); dec.stdout closes immediately with no frame data.","commonSituations":"Passing a start timestamp past the end of the media; pointing render at a zero-byte or metadata-only file; a codec not compiled into the installed ffmpeg build.","solutions":["Verify the media actually contains decodable video frames: ffprobe -count_frames source","Check that start is within the media duration","Run the decoder command manually and check stderr for codec/decode errors","Install/reinstall a full ffmpeg build that supports the source codec"],"exampleFix":"// before\nrender(src, start=600, ...)  # video is only 30s -> no frames\n// after\nrender(src, start=0, ...)  # valid in-range start","handlingStrategy":"validation","validationCode":"dur = float(ffprobe_duration(src))\nassert dur > 0, 'media has no video frames'\nassert 0 <= start < dur, 'start outside media duration'","typeGuard":null,"tryCatchPattern":"try:\n    render(src, start, out)\nexcept RuntimeError as e:\n    if 'no frames' in str(e):\n        print('decoder yielded zero frames — check start range and codec support')","preventionTips":["Query duration via ffprobe and clamp start to [0, duration)","Confirm the source contains a video stream (not audio-only)","Use a full-featured ffmpeg build (e.g. from ffmpeg.org) with the needed codecs","Reject zero-byte or metadata-only inputs early"],"tags":["media","ffmpeg","empty-output"],"backgroundTag":"empty-result-set","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}