Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtsp to mp4 stream, could not write header #927

Open
mStirner opened this issue Aug 3, 2019 · 0 comments
Open

rtsp to mp4 stream, could not write header #927

mStirner opened this issue Aug 3, 2019 · 0 comments

Comments

@mStirner
Copy link

mStirner commented Aug 3, 2019

Version information

  • fluent-ffmpeg version: 2.1.2
  • ffmpeg version: 2.8.15
  • OS: Ubuntu 16.04 LTS

Code to reproduce

    app.get("/dmax", (req, res) => {

        res.type('mp4');

        let command = ffmpeg();


        command.input("rtsp://192.168.2.1:554/?freq=466&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,115,2291,2292,2294,2296");

        command.outputOptions('-c:v libx264');
        command.outputOptions("-c:a mp3");
        command.outputOptions("-movflags faststart");

        command.outputOptions('-f mp4');

        command.pipe(res, {
            end: true
        });

        command.on('start', function (cli) {
            console.log('Spawned Ffmpeg with command: %s', cli);
        });

        command.on('error', function (err) {
            console.log('An error occurred: ' + err.message);
        });

        command.on('end', function () {
            console.log('Processing finished !');
        });

        //command.run();

    });

Expected results

Converting the RTSP stream from the fritz.box router to h265/mp4 http stream

Observed results

An error occurred: ffmpeg exited with code 1: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument


I'm trying to convert the RTSP stream that my firtz.box router publish in my local network to a http mp4/h264 stream.

Working CLI: ffmpeg -i 'rtsp://192.168.2.1:554/?freq=466&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,115,2291,2292,2294,2296' -c:v libx264 -c:a mp3 -movflags faststart -f mp4 video.mp4
With code changes to:

command.input("'rtsp://192.168.2.1:554/?freq=466&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,115,2291,2292,2294,2296'");

it get the error: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant