question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use ffmpeg.run on rtsp input stream

See original GitHub issue

Describe the bug Unable to use ffmpeg.run to use rtsp stream as the input, and output the transcoded stream over an http stream using mpeg1video encoding. In ffmpeg, I can do the following

ffmpeg  -i rtsp://192.168.0.101/av0_1 -f mpegts -codec:v mpeg1video -b 800k -r 30 http://localhost:8081/password

However, when I try doing the same thing using ffmpeg.wasm, I get the following:

[info] load ffmpeg-core
[info] ffmpeg-core loaded
starting
[info] ffmpeg command: ./ffmpeg -nostdin -hide_banner -i rtsp://192.168.0.101/av0_1 -f mpegts -codec:v mpeg1video -b 800k -r 30 http://localhost:8081/password
[ffmpeg-stdout] Assertion failed: undefined
[ffmpeg-stderr] Assertion failed: undefined
[ffmpeg-stdout] RuntimeError: abort(Assertion failed: undefined). Build with -s ASSERTIONS=1 for more info.
[ffmpeg-stderr] RuntimeError: abort(Assertion failed: undefined). Build with -s ASSERTIONS=1 for more info.
// then prints out ffmpeg-core.js file

The code I used is below: example_stream.js:

const { createFFmpeg } = require('@ffmpeg/ffmpeg');
const ffmpeg = createFFmpeg({ log: true });
(async () => {
    await ffmpeg.load();
    console.log("starting");
    await ffmpeg.run("-i rtsp://192.168.0.101/av0_1 -f mpegts -codec:v mpeg1video -b 800k -r 30 http://localhost:8081/password");
  })();

To Reproduce Steps to reproduce the behavior:

  1. Create a new node project 2. npm install "@ffmpeg/ffmpeg"
  2. Run code above
  3. See error

Expected behavior Output similar to ffmpeg terminal command:

eng6@eng6-ThinkPad-P50s:~$ ffmpeg  -i rtsp://192.168.0.101/av0_1 -f mpegts -codec:v mpeg1video -b 800k -r 30 http://localhost:8081/password
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
...
Input #0, rtsp, from 'rtsp://192.168.0.101/av0_1':
  Metadata:
    title           : av0_1
  Duration: N/A, start: 0.034000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709), 1280x720, 29.97 tbr, 90k tbn, 180k tbc
Output #0, mpegts, to 'http://localhost:8081/password':
  Metadata:
    title           : av0_1
    encoder         : Lavf56.40.101
    Stream #0:0: Video: mpeg1video, yuv420p, 1280x720, q=2-31, 800 kb/s, 30 fps, 90k tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.60.100 mpeg1video
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg1video (native))
Press [q] to stop, [?] for help

Desktop (please complete the following information):

  • OS: Ubuntu 16.04
  • Browser Firefox
  • Version 75
  • Node version: 12.7.0
  • NPM version: 6.14.5
  • @ffmpeg/ffmpeg” version: “^0.8.3”,

Additional context Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

9reactions
jeromewucommented, Nov 4, 2020

Right now rtsp/rtmp is not supported due to the external libraries is unable to integrate with ffmpeg.wasm, I am still looking for possibilities.

0reactions
qinwei-gongcommented, Sep 9, 2022

Right now rtsp/rtmp is not supported due to the external libraries is unable to integrate with ffmpeg.wasm, I am still looking for possibilities.

@jeromewu is rtmp supported now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ffmpeg input rtsp error - Stack Overflow
Using ffplay, you can verify if ffmpeg can receive RTSP stream properly. You can use Wireshark to capture the RTSP communication as well....
Read more >
Unable to do 'rtsp stream' when 'rtsp_flags listen' - FFmpeg Wiki
Description. Summary of the bug: FFmpeg will not streaming a RSTP stream. I want to FFmpeg work as server and stream desktop.
Read more >
How can I force a new session in FFmpeg when connecting to ...
... to an RTSP input stream? I don't see a way to pass header information. Here is the command and output to the...
Read more >
Unable to open input rtsp - ZoneMinder Forums
ffmpeg will be at /usr/bin/ffmpeg. If it isn't there, do apt-get install --reinstall ffmpeg. Further, forget 1.34, go to zmrepo.zoneminder.com ...
Read more >
How to stream your IP Camera (RTSP) into browser (HLS ...
Normally, IP Camera streams video as RTSP protocol. But browser is unable to render this format, so we need to convert it as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found