iizukanao / node-rtsp-rtmp-server Goto Github PK
View Code? Open in Web Editor NEWRTSP/RTMP/HTTP hybrid server
License: MIT License
RTSP/RTMP/HTTP hybrid server
License: MIT License
Node server.js output:
2016-06-13 10:03:13.879 attachRecordedDir: dir=file app=file
2016-06-13 10:03:13.893 [rtmp] server started on port 1935
2016-06-13 10:03:13.894 [rtsp/http/rtmpt] server started on port 80
2016-06-13 10:03:17.651 [rtmp:client=1oZ9Ns6Y] connected
[rtmp: 1 sessions]
1oZ9Ns6Y: addr=127.0.0.1 port=5741
2016-06-13 10:03:17.658 [rtmp:handshake] warning: unknown message format, assuming format 1
2016-06-13 10:03:17.665 [rtmp:receive] unknown (not implemented) AMF command: _checkbw
2016-06-13 10:03:17.668 [rtmp] publish: stream=live/helloworld publishingType=live
2016-06-13 10:03:18.104 [rtmp:client=1oZ9Ns6Y] received EOS for stream: live/helloworld
2016-06-13 10:03:18.106 [rtmp] FCUnpublish: helloworld
2016-06-13 10:03:18.108 [rtmp:client=1oZ9Ns6Y] socket error: Error: read ECONNRESET
2016-06-13 10:03:18.108 [rtmp:client=1oZ9Ns6Y] disconnected
[rtmp: 0 sessions]
FFmpeg output:
$ ffmpeg.d1c8368.exe -i big_buck_bunny.mp4 -c:v copy -c:a copy -f flv rtmp://localhost/live/helloworld
ffmpeg version N-75794-gd1c8368 Copyright (c) 2000-2015 the FFmpeg develope
rs
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enab
le-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --en
able-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable
-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enabl
e-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena
ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e
nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zli
b
libavutil 55. 2.100 / 55. 2.100
libavcodec 57. 4.100 / 57. 4.100
libavformat 57. 3.100 / 57. 3.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 10.100 / 6. 10.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big_buck_bunny.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42avc1
creation_time : 2010-02-09 01:55:39
Duration: 00:01:00.10, start: 0.000000, bitrate: 733 kb/s
Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo
, fltp, 65 kb/s (default)
Metadata:
creation_time : 2010-02-09 01:55:39
handler_name : Apple Sound Media Handler
Stream #0:1(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661
), yuv420p(tv, smpte170m/smpte170m/bt709), 640x360, 612 kb/s, 23.96 fps, 24
tbr, 600 tbn, 1200 tbc (default)
Metadata:
creation_time : 2010-02-09 01:55:39
handler_name : Apple Video Media Handler
Stream #0:2(eng): Data: none (rtp / 0x20707472), 45 kb/s
Metadata:
creation_time : 2010-02-09 01:55:39
handler_name : hint media handler
Stream #0:3(eng): Data: none (rtp / 0x20707472), 5 kb/s
Metadata:
creation_time : 2010-02-09 01:55:39
handler_name : hint media handler
HandShake: client signature does not match!
[flv @ 00dff3a0] Codec for stream 0 does not use global headers but contain
er format requires global headers
[flv @ 00dff3a0] Codec for stream 1 does not use global headers but contain
er format requires global headers
Output #0, flv, to 'rtmp://localhost/live/helloworld':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42avc1
encoder : Lavf57.3.100
Stream #0:0(eng): Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 640x360
, q=2-31, 612 kb/s, 23.96 fps, 24 tbr, 1k tbn, 600 tbc (default)
Metadata:
creation_time : 2010-02-09 01:55:39
handler_name : Apple Video Media Handler
Stream #0:1(eng): Audio: aac ([10][0][0][0] / 0x000A), 22050 Hz, stereo
, 65 kb/s (default)
Metadata:
creation_time : 2010-02-09 01:55:39
handler_name : Apple Sound Media Handler
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[flv @ 00dff3a0] Failed to update header with correct duration.
[flv @ 00dff3a0] Failed to update header with correct filesize.
frame= 1440 fps=0.0 q=-1.0 Lsize= 5019kB time=00:01:00.14 bitrate= 683.6
kbits/s
video:4491kB audio:478kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.008274%
Hi! It all works when trying to stream mp4 video, but when I try to encode other videos to mp4 — I got this:
2015-03-18 01:50:00.759 [rtmp] waiting for the key frame for client 9x3LDXUc
and it only works only when I connect exact at the beginning of stream.
The only solution is to use -g 1 option. But it seems to be very strange, because parameter for g need to be at least fps*2, not every frame!
ffmpeg -re -i video.avi -vcodec libx264 -g 1 -acodec libvo_aacenc -ar 44100 -ac 2 -f flv rtmp://localhost/live/myStream
Is it my mistake?
Is it possible to create an HTTP API to query who are publishing, with what resolution, how much listeners there are.
Im open to do it myself if you could point me to the right direction :)
Hey there,
when connecting from Open Broadcaster Studio (mac 0.14.1) to rtmp://localhost/live and a streaky the OBS just answers:
[rtmp:handshake] warning: unknown message format, assuming format 1
How to connect to the server through OBS?
Thanks!
2016-01-01 16:06:43.443 Please report this bug on GitHub. Thanks.
2016-01-01 16:06:43.443 https://github.com/iizukanao/node-rtsp-rtmp-server/issues
2016-01-01 16:06:43.443 ---------------
2016-01-01 16:06:45.127 [rtmp] warning: message lengths don't match: got=28928 expected=946
2016-01-01 16:06:45.127 ----- BUG -----
2016-01-01 16:06:45.127 [rtmp:receive] received unknown (not implemented) message type ID: 210
2016-01-01 16:06:45.127 { formatType: 0,
chunkStreamID: 16,
timestamp: 12760489,
timestampDelta: 0,
messageLength: 946,
messageTypeID: 210,
messageStreamID: 49361467,
body: <Buffer 91 81 01 77 21 24 71 14 80 19 0a c4 c9 bb 09 a0 84 00 00 2e 16 bf fb d9 b2 1c 18 21 82 1a 71 60 03 12 0c 9b f8 9a 8b db 9a b1 a4 20 25 03 19 89 b6 03 40 ...> }
2016-01-01 16:06:45.127 Please report this bug on GitHub. Thanks.
2016-01-01 16:06:45.127 https://github.com/iizukanao/node-rtsp-rtmp-server/issues
2016-01-01 16:06:45.128 ---------------
After starting up the server I uploaded a MP4 video to the server, however, when I try to use the VLC player to play the video, on the server side it showed that there is a client coming but then it shows that the client shut down the stream all of a sudden.
I really have no idea on this problem.
I got following messages:
2015-08-07 19:02:48.986 [rtmp:915oJr3K] connected
2015-08-07 19:02:49.025 [rtmp:receive] unknown (not implemented) AMF command: _checkbw
2015-08-07 19:02:49.036 [rtmp] publish: stream=TEST publishingType=live
2015-08-07 19:02:49.059 [stream:TEST] video data error: failed to read SPS
2015-08-07 19:02:50.572 Error: read_bit error: no more data
FYI: this could be work https://github.com/illuspas/Node-Media-Server
i use https://github.com/fyhertz/libstreaming and try to publish live streaming to RTSP Server (node)
but it doesn't work.
What am I missing?
The documentation doesn't have an example for taking an incoming RTSP stream and publishing it via HTTP. Looking at the code it seems like http tunneling is supported for posting an RTSP stream... but I didn't see how I would tunnel RTSP over HTTP as per the QuickTime spec: http://www.opensource.apple.com/source/QuickTimeStreamingServer/QuickTimeStreamingServer-412.42/Documentation/RTSP_Over_HTTP.pdf
Any guidance? Is this already in this module or am I looking for a feature that isn't there?
Hello there,
I am trying to make all that work. The server seems to work fine but when I feed a RTSP stream coming from my IP cam I seem to get a LOST of "RTM: missed x packets".
Here is a screenshot:
Any idea what would cause this? I assume it is a ffmpeg issue and not a node.js issue ...
Thanks a lot !
Hi,
I want to implement a little tool which can receive rtsp stream from ffmpeg and relay it to VLC.
I want to use Python or Java. But I couldn't find docs about the principle of rtsp relay. So, could you give me some advice about how you implement your application.
Thanks !
Dear sir,
I publish video over RTSP by ffmpeg. But I can't connect to the stream from VLC player.
This is the issue call back in Terminal
2016-03-26 08:20:03.202 [rtsp/http/rtmpt:client=c5] disconnected [rtsp/http: 1 clients] c1: session=96364581 addr=118.69.30.249 port=44804 type=publish-udp 2016-03-26 08:20:03.243 [rtsp/http/rtmpt:client=c6] connected 2016-03-26 08:20:03.407 [rtsp/http/rtmpt:client=c6] start streaming over TCP [rtsp/http: 2 clients] c1: session=96364581 addr=118.69.30.249 port=44804 type=publish-udp c6: session=53339965 addr=118.69.30.249 port=44819 type=tcp isPlaying=true 2016-03-26 08:20:14.042 [rtsp/http/rtmpt:client=c6] disconnected [rtsp/http: 1 clients] c1: session=96364581 addr=118.69.30.249 port=44804 type=publish-udp 2016-03-26 08:21:59.959 [rtsp/http/rtmpt:client=c1] finished uploading stream live/test 2016-03-26 08:21:59.963 [rtsp/http/rtmpt:client=c1] disconnected [rtsp/http: 0 clients]
Please help me resolved this.
Instead of outputting as jsjpg maybe outputting through MPEG dash would be better?
Hi. I would like to be able to save the user webcam to disk. I am looking forward to you adding support for multiple publishers (another issue) but for my purpose i need a way to save the rtmp to disk. Dumping a flv file would be just fine.
What do you think about this ? is it easy ? Do you plan to do it yourself ? if not where could i start from ?
I know I could just connect a gstreamer client pipeline or use rtmpdump to save the stream to disk but i would like to do it in the same process (not having one process per publisher) and I don't want to loose the very first frame so it has to be tightly integrated I think.
Thank you very much for your work i totally love the idea of a Coffee/js/node.js based streaming server.
Thank you for the great applications.
I was just wondering the easiest way to authenticate node-rtsp-rtmp-server.
Sincerely
Hi
When i'm streaming the server detects the end of a stream, but he doesn't send this to the clients who are watching. This is a problem for most programs, for example while capturing with OpenCV or FFmpeg the program will be waiting forever for the next frame.
Is this a feature or a bug?
Greetings
Jarno
I have downloaded the repository but i cant run the server. I'm on MacOs.
sudo coffee server.coffee
2016-05-24 10:34:51.098 attachRecordedDir: dir=file app=file
/Users/Sergio/Sites/node-rtsp-rtmp-server/server.coffee:46
throw err;
^
Error: listen EADDRINUSE 0.0.0.0:1935
at Object.exports._errnoException (util.js:837:11)
at exports._exceptionWithHostPort (util.js:860:20)
at Server._listen2 (net.js:1231:14)
at listen (net.js:1267:10)
at net.js:1376:9
at doNTCallback3 (node.js:440:9)
at process._tickCallback (node.js:346:17)
at Function.Module.runMain (module.js:473:11)
at startup (node.js:117:18)
at node.js:951:3
Error: [rtmp:publish] malformed audio data: AudioSpecificConfig is missing
at RTMPSession.parseAudioMessage (e:\git\rtmpserver\rtmp.coffee:741:21)
at e:\git\rtmpserver\rtmp.coffee:1889:28
at RTMPSession.handleData (e:\git\rtmpserver\rtmp.coffee:1959:7)
at Socket. (e:\git\rtmpserver\rtmp.coffee:1994:23)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:529:20)
The source is ts over http.
use FMS no problem
Hello , when I try to insert the stream name , the rtmp server node goes into infinite loop ,
i use OBS
how do I fix ?
error:
unkown message format, assuming format 1
request invalid app name live/test1
other question, you can assign a streamkey in this project ?
thanks for the great job
2016-03-15 23:57:33.649 [rtmp] server started on port 1935
2016-03-15 23:57:33.650 [rtsp/http/rtmpt] server started on port 3000
2016-03-15 23:57:45.300 [rtmp:client=sjXr0K4l] connected
[rtmp: 1 sessions]
sjXr0K4l: addr=192.168.1.103 port=50516
2016-03-15 23:57:45.321 [rtmp:handshake] warning: unknown message format, assuming format 1
2016-03-15 23:57:45.368 [rtmp:receive] unknown (not implemented) AMF data: FCPublish
2016-03-15 23:57:45.368 [rtmp:receive] unknown (not implemented) AMF data: releaseStream
2016-03-15 23:57:45.378 [rtmp] publish: stream=live/myStream publishingType=live
/Users/nvcken/think/node-rtsp-rtmp-server/server.js:47
throw err;
^
Error: Unknown AMF0 data type: 108
at parseAMF0Data (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:356:13)
at parseAMF0StrictArray (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:212:16)
at parseAMF0Data (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:341:16)
at parseAMF0ECMAArray (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:231:16)
at parseAMF0Data (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:310:16)
at parseAMF0StrictArray (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:212:16)
at parseAMF0Data (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:341:16)
at parseAMF0ECMAArray (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:231:16)
at parseAMF0Data (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:310:16)
at parseAMF0DataMessage (/Users/nvcken/think/node-rtsp-rtmp-server/rtmp.js:249:16)
Hi,
I've been using your excellent picam in combination with node-rtsp-rtmp-server. It seems to work pretty nicely, except I've noticed that when there are multiple connections, the last one left connected gets prematurely disconnected when the second remaining disconnects.
Eg Clients A, B and C all connect. C disconnects, then A and B remain connected (fine). B disconnects, A also gets disconnected (prematurely).
Similarly - A and B connect, B disconnects, then A also gets disconnected (prematurely).
The count of clients connected appears to be correct in the STDOUT log output when monitoring the above scenarios. I'm using RTSP and connecting via a mixture of OS X and iOS vlc clients.
G
I can successfully watch a rtmp stream, but the same stream will not play in rtmpt. I'm using ffmpeg as the publisher and the client. I verified ffmpeg/ffprobe cannot watch the rtmpt stream, and that Strobe Media Player also cannot play it. ffmpeg is version 2.7.1
Here is my log below.
2015-08-20 03:46:52.556 [rtmp] server started on port 1936
2015-08-20 03:46:52.562 [rtsp/http] server started on port 8086
2015-08-20 03:46:57.272 [rtmp:zQdGgS7h] connected
[rtmp: 1 sessions]
zQdGgS7h: addr=127.0.0.1 port=55751
2015-08-20 03:46:57.281 [rtmp:handshake] warning: unknown message format, assuming format 1
2015-08-20 03:46:57.293 [rtmp:receive] unknown (not implemented) AMF command: _checkbw
2015-08-20 03:46:57.295 [rtmp] publish: stream=1 publishingType=live
2015-08-20 03:47:06.667 [rtsp/http] client c1 connected
[rtsp/http: 1 clients]
c1: session=44137417 addr=127.0.0.1 port=48825 type=rtmpt
[rtmp: 1 sessions]
zQdGgS7h: addr=127.0.0.1 port=55751
[rtmpt: 1 sessions]
061d6693fbf4377b198168478b581a0: rtmp_session=U4ijXMXY created_at=Thu Aug 20 2015 03:47:06 GMT+0000 (UTC)
2015-08-20 03:47:06.680 [rtmp:handshake] warning: unknown message format, assuming format 1
2015-08-20 03:47:06.724 [rtmp:receive] unknown (not implemented) AMF command: _checkbw
2015-08-20 03:47:06.763 [rtmp:U4ijXMXY] requested stream 1
2015-08-20 03:47:06.765 [rtmp:U4ijXMXY] waiting for keyframe
2015-08-20 03:47:09.913 [rtmp:U4ijXMXY] started streaming
2015-08-20 03:47:36.831 [rtmpt:U4ijXMXY] close
2015-08-20 03:47:36.832 [rtmpt:U4ijXMXY] received teardown
2015-08-20 03:47:36.833 Socket error (c1): Error: write after end
2015-08-20 03:47:36.834 [rtsp/http] client c1 is closed
[rtsp/http: 0 clients]
Hi, is it possible to publish this repository to the npm. It would be easier to use. Or make a version number in the package.json, because now I can't include this repository on my node project.
Error: No version provided
Hey,
I'm pretty excited about his project. I'm trying to get the server to work. Do you have an example of how you use it?
I'm looking to use this to host network rtsp video feeds. I understand currently it is supposed to get audio/video over a unix domain socket but I'm looking to expand it to TCP/UDP network sockets.
Hi
95% of the time everything works perfect, great job!
Except with some videos I'm getting the following error:
Error: Not implemented: nal_unit_type=24
at Object.api.readH264Payload (rtp.js:486:19)
at Object.api.parseH264Packet (rtp.js:465:25)
at RTPParser.feedUnorderedH264Buffer (rtp.js:64:20)
at RTSPServer.onUploadVideoData (rtsp.js:1924:31)
at Socket.<anonymous> (rtsp.js:497:26)
at Socket.emit (events.js:98:17)
at UDP.onMessage (dgram.js:441:8)
I already tried to drop the frames, but that results in an other error.
If you want a video that produces the error just let me know and I will send you one.
Thanks!
Could you please explain why multiple streams are not supported? README said, that "you can push only one stream at a time". Does it mean, that we cant publish more than one RTMP live stream at a time? Thanks.
Hello there, I just started using node.js and installed node-rtsp-rtmp-server via npm.
So I'm stuck with how to setup it...
I have included it into my server but I'm not sure how to call and setup it.
var module_http = require('http');
var module_ecstatic = require('ecstatic');
var module_stream = require('node-rtsp-rtmp-server');
const server_port = 1313;
var server_options =
{
root: __dirname + '/public',
port: server_port,
baseDir: '/',
cache: 3600,
showDir: true,
showDotfiles: true,
autoIndex: true,
humanReadable: true,
headers: {},
si: false,
defaultExt: 'html',
gzip: false,
serverHeader: true,
contentType: 'application/octet-stream',
mimeTypes: undefined,
handleOptionsMethod: false
};
module_http.createServer(module_ecstatic(server_options)).listen(server_port);
console.log('Listening on : ' + server_port);
If anyone could help me, that would be great!
Can I receive RTSP stream from another server and serve as RTMP?
i have a project written using MonaServer and i'd like to rewrite it in node.js using this rtmp module, but i'm not sure how to communicate with the rtmp server to do things like client authentication (using url parameters, which also don't seem to be supported in this project) and linking web clients to their corresponding rtmp client.
my assumption was i could just require the server in my node.js main file, but it's a synchronous call and the rtmp server just blocks the rest of the application from running, so i'm at a loss. if the functionality is already there, can you point me in the right direction?
Hi!
I'm testing this server with 2 types of rtmp streamers - Flash Media Encoder and Teradek VidiU mini (hardware streamer for hdmi cameras)
It's all ok with first one, but i tried to connect VidiU mini, that supports RTMP streaming with h.264, and server fail's with unhandled exception (debug log listed below)
Any ideas? Please help
2015-07-08 12:16:16.964 [rtmp:BElYtzPD] connected
[rtmp: 1 sessions]
BElYtzPD: addr=91.202.72.98 port=39328
2015-07-08 12:16:16.968 [rtmp:handshake] warning: unknown message format, assuming format 1
2015-07-08 12:16:31.559 [rtmp:zXrA8Myz] connected
[rtmp: 2 sessions]
BElYtzPD: addr=91.202.72.98 port=39328
zXrA8Myz: addr=176.115.97.245 port=51143
2015-07-08 12:16:31.617 [rtmp:handshake] warning: unknown message format, assuming format 1
2015-07-08 12:16:32.849 [rtmp] publish: stream=zzz publishingType=live
2015-07-08 12:16:32.951 receive video: num_nal_units=2 pts=165473106840
2015-07-08 12:16:32.954 video: pts=165473106840 pts_diff=165473106840 md5=2b2606d nal_unit_type=7 bytes=44
2015-07-08 12:16:32.954 video: pts=165473106840 pts_diff=0 md5=ac995ac nal_unit_type=8 bytes=4
2015-07-08 12:16:32.957 receive audio: num_access_units=1 pts=165473112600
2015-07-08 12:16:32.957 audio: pts=165473112600 md5=b504dda bytes=92
2015-07-08 12:16:33.177 receive video: num_nal_units=4 pts=165473106840
/home/ubuntu/node-rtsp-rtmp-server/server.coffee:40
throw err;
^
TypeError: Object gB�^_�(.7��"
I'm trying to stream webcam audio from flash, but flash isn't able to encode AAC. Do you have any plans to support any of these codecs? http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundCodec.html
Hi,
I am trying to set up streaming video using this project but I can't get it to work. Here is what I am doing:
What I notice is that vlc will only start playback iff I point vlc to your rtsp server BEFORE running the ffmpeg command. Even so, I only get the video screen loading up and it does not change beyond what opens initially. The Initial screen also only shows the video in a part of the window. The rest is distorted/greyed out horribly.
Any thoughts on what I am doing wrong?
Hi
This is more a request then an issue, but I was wondering if it's possible to rewind/pause a stream?
Greetings
Jarno
Hi
When playing back a recorded mp4 file using the new features you've recently added (thanks for that!), I get an error relating to the regEx expression around line 350 (avstream.coffee)
Error:
SyntaxError: Invalid regular expression: /(^|)..(|$)/: Unterminated group
I believe is only seen when running node under windows and the fact that the path separator is a backslash and needs to be escaped within a regEx expression.
I added a quick fix local fix
# Check that filename is legitimate
pathSep = path.sep
pathSep += "\\" if (pathSep == "\\")
if (filename is '.') or
new RegExp("(^|#{pathSep})..(#{pathSep}|$)").test filename
logger.warn "rejected request to stream: #{streamId}"
break
I've only tested this on windows 8.
Thanks
I read rtmp publishing is possible? any ideas if so?
thanks
Getting this weird error whenever a client tries to connect via http.
This code is running on a ubuntu version having node 4.4.5 version. Here is the full output:
root@ubuntu-512mb-nyc3-01:~/node-rtsp-rtmp-server# sudo nodejs server.js 2016-06-15 12:54:43.254 attachRecordedDir: dir=file app=file 2016-06-15 12:54:43.299 [rtmp] server started on port 1935 2016-06-15 12:54:43.301 [rtsp/http/rtmpt] server started on port 8080 2016-06-15 12:54:49.620 [rtsp/http/rtmpt:client=c1] connected 2016-06-15 12:54:49.974 [rtsp/http/rtmpt:client=c2] connected 2016-06-15 12:54:50.539 Socket error (c1): Error: write EPIPE 2016-06-15 12:54:50.540 [rtsp/http/rtmpt:client=c1] disconnected
Hi,
Can this connect to a remote RTSP stream? If so, how would that happen?
Thanks.
I tried to use the server by publishing the stream from flash swf and also from Flash Media Encoder . In both I got an error and server crashed .
new RTMPSession
Waiting for complete C0+C1
client type: 3
Waiting for complete C2+RTMPMessage
[rtmp] handshake success, buf.length=1936
/root/node-rtsp-rtmp-server/server.coffee:741
throw err;
^
Error: Unknown AMF0 data type: 49
at parseAMF0Data (/root/node-rtsp-rtmp-server/rtmp.coffee:292:15)
at parseAMF0CommandMessage (/root/node-rtsp-rtmp-server/rtmp.coffee:247:14)
at RTMPSession.handleData (/root/node-rtsp-rtmp-server/rtmp.coffee:1369:28)
at Socket. (/root/node-rtsp-rtmp-server/rtmp.coffee:1446:23)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
at TCP.onread (net.js:528:21)
It would be good to provide support for this. Lots of users are stuck behind firewalls so I think this is really needed at some point. If I knew the protocol well enough I'd try and chip in.
Trying to stream from Action Script 3:
Error: Unknown AMF0 data type: 17
at parseAMF0Data (E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:264:15)
at parseAMF0DataMessage (E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:202:14)
at E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:2516:29
at Sequent. (E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:2433:11)
at Sequent.done (E:\cht\node-rtsp-rtmp-server-master\node_modules\sequent\lib\sequent.js:151:34)
at E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:2546:21
at RTMPSession.respondPublish (E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:1462:5)
at RTMPSession.handleAMFCommandMessage (E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:2325:10)
at E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:2541:16
at RTMPSession.handleData (E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:2580:7)
at Socket. (E:\cht\node-rtsp-rtmp-server-master\rtmp.coffee:2615:23)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:529:20)
Code used: Link to PasteBin
this may be a strange issue, but since the team over at OBS are pushing the issue to other projects, maybe you could help me figure out why OBS streams to the server fine and OBS Studio/multiplatform fails.
OBS Studio seems to deliver the first frame of the stream fine, but then flowplayer buffers forever instead of receiving the next frame. here is the thread i put out on the OBS forums: https://obsproject.com/forum/threads/stream-width-correct-in-obs-not-obs-multiplatform.40703/
you seem to know enough about this protocol to be able to offer some insight on this issue, but if this is too irrelevant to the project then feel free to close it.
What "Edit config.coffee" is for?
And I have done follow your steps, but it still failed, the error is as follow:
D:\node-rtsp-rtmp-server-master>coffee server.coffee
2016-01-08 10:09:45.328 attachRecordedDir: dir=file app=file
D:\node-rtsp-rtmp-server-master\server.coffee:46
throw err;
^
Error: listen EACCES /tmp/node_rtsp_rtmp_videoControl
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at Server._listen2 (net.js:1225:19)
at listen (net.js:1274:10)
at Server.listen (net.js:1364:5)
at CustomReceiver.startUnix (D:\node-rtsp-rtmp-server-master\custom_receiver.coffee:91:27)
at CustomReceiver.start (D:\node-rtsp-rtmp-server-master\custom_receiver.coffee:82:8)
at StreamServer.start (D:\node-rtsp-rtmp-server-master\stream_server.coffee:216:21)
at Object. (D:\node-rtsp-rtmp-server-master\server.coffee:34:14)
at Object. (D:\node-rtsp-rtmp-server-master\server.coffee:1:1)
at Module._compile (module.js:435:26)
at Object.exports.run (D:\Program Files\nodejs\node_modules\coffee-script\lib\coffee-script\coffee-script.js:134:23)
at compileScript (D:\Program Files\nodejs\node_modules\coffee-script\lib\coffee-script\command.js:224:29)
at compilePath (D:\Program Files\nodejs\node_modules\coffee-script\lib\coffee-script\command.js:174:14)
at Object.exports.run (D:\Program Files\nodejs\node_modules\coffee-script\lib\coffee-script\command.js:98:20)
at Object. (D:\Program Files\nodejs\node_modules\coffee-script\bin\coffee:7:41)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
Hello,
I have been analysing the output of the RTMP stream, and it appears that the signature of the video codec is no longer h264, but acv1. I managed to see that through VLC in media informations.
Hence, when I try to play the RTMP stream in flash I get an error message:
[12:45:53.773] <<<< VTVideoDecoderSelection >>>> VTSelectAndCreateVideoDecoderInstanceInternal: no video decoder accepted for 'avc1'
And the framerate compared to the original stream is kind of shitty then ... about 10 fps in opposition of the 22fps provided by the live IP cam feed.
When I open both RTSP and RTMP stream in VLC everything is fine, so obviously the video codec used by the node app is not manageable by flash.
Any idea?
Windows 7.
$ node server.js
2016-06-14 11:20:17.366 attachRecordedDir: dir=file app=file
2016-06-14 11:20:17.379 [rtmp] server started on port 8080
2016-06-14 11:20:17.380 [rtsp/http/rtmpt] server started on port 3000
2016-06-14 11:20:24.099 [rtsp/http/rtmpt:client=c1] connected
2016-06-14 11:20:24.111 [rtsp/http/rtmpt:client=c2] connected
2016-06-14 11:20:26.386 [http] Requested file not found: C:\Users\User\node-rtsp-rtmp-server/public/favicon.ico
2016-06-14 11:20:42.702 [rtsp/http/rtmpt:client=c2] disconnected
[rtsp/http: 1 clients]
c1: session=77152424 addr=127.0.0.1 port=2104
2016-06-14 11:21:11.832 [rtsp/http/rtmpt:client=c3] connected
2016-06-14 11:21:11.971 [mp4] warning: skipping unknown (not implemented) box type: tref (0x74726566)
2016-06-14 11:21:11.975 [mp4] warning: skipping unknown (not implemented) box type: hmhd (0x686d6864)
2016-06-14 11:21:11.977 [mp4] warning: skipping unknown (not implemented) box type: name (0x6e616d65)
2016-06-14 11:21:11.978 [mp4] warning: skipping unknown (not implemented) box type: hnti (0x686e7469)
2016-06-14 11:21:11.979 [mp4] warning: skipping unknown (not implemented) box type: hinf (0x68696e66)
2016-06-14 11:21:11.981 [mp4] warning: skipping unknown (not implemented) box type: tref (0x74726566)
2016-06-14 11:21:11.987 [mp4] warning: skipping unknown (not implemented) box type: hmhd (0x686d6864)
2016-06-14 11:21:11.988 [mp4] warning: skipping unknown (not implemented) box type: name (0x6e616d65)
2016-06-14 11:21:11.989 [mp4] warning: skipping unknown (not implemented) box type: hnti (0x686e7469)
2016-06-14 11:21:11.996 [mp4] warning: skipping unknown (not implemented) box type: hinf (0x68696e66)
2016-06-14 11:21:11.998 [mp4] warning: skipping unknown (not implemented) box type: hnti (0x686e7469)
C:\Users\User\node-rtsp-rtmp-server\server.js:47
throw err;
^
TypeError: Cannot read property 'sequenceParameterSets' of null
at MP4File.getSPS (C:\Users\User\node-rtsp-rtmp-server\mp4.js:174:21)
at Function.MP4Stream.create (C:\Users\User\node-rtsp-rtmp-server\avstreams.js:310:37)
at Object.api.get (C:\Users\User\node-rtsp-rtmp-server\avstreams.js:488:32)
at C:\Users\User\node-rtsp-rtmp-server\rtsp.js:1502:32
at RTSPServer.livePathConsumer (C:\Users\User\node-rtsp-rtmp-server\server.js:26:14)
at RTSPServer.consumePathname (C:\Users\User\node-rtsp-rtmp-server\rtsp.js:1299:21)
at RTSPServer.respondDescribe (C:\Users\User\node-rtsp-rtmp-server\rtsp.js:1490:19)
at RTSPServer.respond (C:\Users\User\node-rtsp-rtmp-server\rtsp.js:2047:21)
at RTSPServer.handleOnData (C:\Users\User\node-rtsp-rtmp-server\rtsp.js:1051:19)
at Socket.<anonymous> (C:\Users\User\node-rtsp-rtmp-server\rtsp.js:512:28)
Also, using Big_buck_bunny.mp4 from http://camendesign.com/code/video_for_everybody/test.html.
Also, Windows 7.
$ ffmpeg.exe -i test.mp4 -c:v copy -c:a copy -f flv rtmp://localhost:3000/live/stream
ffmpeg version N-75794-gd1c8368 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enabl
e-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec -
-enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore
-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsox
r --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --en
able-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-l
ibxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 2.100 / 55. 2.100
libavcodec 57. 4.100 / 57. 4.100
libavformat 57. 3.100 / 57. 3.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 10.100 / 6. 10.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'work1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.24.2
Duration: 00:01:02.32, start: 0.000000, bitrate: 1347 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 959 kb/s, 25 fps, 25 tbr, 128
00 tbn, 50 tbc (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : SoundHandler
RTMP_Connect1, handshake failed.
rtmp://localhost:3000/live/stream: Unknown error occurred
Server's Log:
$ node server.js
2016-06-14 11:40:14.223 attachRecordedDir: dir=file app=file
2016-06-14 11:40:14.237 [rtmp] server started on port 8080
2016-06-14 11:40:14.237 [rtsp/http/rtmpt] server started on port 3000
2016-06-14 11:40:17.798 [rtsp/http/rtmpt:client=c1] connected
2015-05-23 19:21:19.519 [rtmp] server started on port 1935
2015-05-23 19:21:19.573 [rtsp/http] server started on port 80
2015-05-23 19:22:27.546 [rtsp/http] client c1 connected
[rtsp/http: 1 clients]
c1: session=38186821 addr=10.253.66.198 port=58072 type=publish-udp
2015-05-23 19:22:27.710 [rtsp] client c1 started uploading stream stream1
2015-05-23 19:24:45.330 [rtsp/http] client c2 connected
/home/pi/sources/node-rtsp-rtmp-server/server.js:41
throw err;
^
Error: null channels audio is not supported
at Object.api.getChannelConfiguration (/home/pi/sources/node-rtsp-rtmp-server/aac.js:317:17)
at Object.api.createAudioSpecificConfig (/home/pi/sources/node-rtsp-rtmp-server/aac.js:575:36)
at /home/pi/sources/node-rtsp-rtmp-server/rtsp.js:1444:60
at RTSPServer.livePathConsumer (/home/pi/sources/node-rtsp-rtmp-server/server.js:24:14)
at RTSPServer.consumePathname (/home/pi/sources/node-rtsp-rtmp-server/rtsp.js:1264:21)
at RTSPServer.respondDescribe (/home/pi/sources/node-rtsp-rtmp-server/rtsp.js:1408:19)
at RTSPServer.respond (/home/pi/sources/node-rtsp-rtmp-server/rtsp.js:1916:21)
at RTSPServer.handleOnData (/home/pi/sources/node-rtsp-rtmp-server/rtsp.js:1019:19)
at Socket. (/home/pi/sources/node-rtsp-rtmp-server/rtsp.js:496:28)
at Socket.emit (events.js:107:17)
This is more of a feature request - would it be possible to use this server only for RTMPT and use a remote RTMP server? I have tried modifying the server to allow for this, but I am having trouble with getting past the stream registration part, since it is on a remote server and not running through the accompanying rtmp server stack. Would you be at all interested in supporting this, either with a fork or a patch?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.