{"record":{"id":"e693c299e75ea654","repo":"mudler/LocalAI","slug":"ffmpeg-exited-with-status-d","errorCode":null,"errorMessage":"ffmpeg exited with status %d\n","messagePattern":"ffmpeg exited with status (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/go/stablediffusion-ggml/cpp/gosd.cpp","lineNumber":1347,"sourceCode":"                return 1;\n            }\n            p += n;\n            remaining -= (size_t)n;\n        }\n    }\n    close(pipefd[1]);\n\n    int status = 0;\n    while (waitpid(pid, &status, 0) < 0) {\n        if (errno != EINTR) {\n            perror(\"waitpid\");\n            if (have_audio) unlink(wav_path);\n            return 1;\n        }\n    }\n    if (have_audio) unlink(wav_path);\n    if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {\n        fprintf(stderr, \"ffmpeg exited with status %d\\n\", status);\n        return 1;\n    }\n    return 0;\n}\n\nint gen_video(sd_vid_gen_params_t *p, int steps, char *dst, float cfg_scale, int fps, char *init_image, char *end_image) {\n    if (!p) return 1;\n    if (!dst || strlen(dst) == 0) {\n        fprintf(stderr, \"gen_video: dst is empty\\n\");\n        std::free(p);\n        return 1;\n    }\n\n    std::vector<int> skip_layers = {7, 8, 9};\n\n    fprintf(stderr, \"Generating video: %dx%d, frames=%d, fps=%d, steps=%d, cfg=%.2f\\n\",\n            p->width, p->height, p->video_frames, fps, steps, cfg_scale);\n","sourceCodeStart":1329,"sourceCodeEnd":1365,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/stablediffusion-ggml/cpp/gosd.cpp#L1329-L1365","documentation":"The ffmpeg subprocess exited non-zero during video muxing. Guard: capture ffmpeg stderr, include it in the error, and clean up partial output files on failure.","triggerScenarios":"Thrown at backend/go/stablediffusion-ggml/cpp/gosd.cpp:1347 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the same ffmpeg command manually to see the full error output.","Verify ffmpeg is installed and supports the requested codecs/formats.","Check input files, disk space, and permissions used by the mux step."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}