Open shangwenxiang opened 7 years ago
Please use Node.js version >= 0.12
I update Node.js,Now version=6.91,but when i use rtsp://localhost:80/file/test.mp4,it happends:
2016-12-06 19:48:43.680 attachRecordedDir: dir=file app=file 2016-12-06 19:48:43.694 [rtmp] server started on port 1935 2016-12-06 19:48:43.695 [rtsp/http/rtmpt] server started on port 80 2016-12-06 19:48:50.747 [rtsp/http/rtmpt:client=c1] connected 2016-12-06 19:48:50.787 [mp4] warning: skipping unknown (not implemented) box type: �xyz (0xa978797a) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �xsp (0xa9787370) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �ysp (0xa9797370) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �zsp (0xa97a7370) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �fpt (0xa9667074) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �fyw (0xa9667977) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �frl (0xa966726c) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �gpt (0xa9677074) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �gyw (0xa9677977) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �grl (0xa967726c) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �dji (0xa9646a69) 2016-12-06 19:48:50.788 [mp4] warning: skipping unknown (not implemented) box type: �res (0xa9726573) /home/gnss/mlSoftware/node-rtsp-rtmp-server/server.coffee:46 throw err; ^
Error: bits.get_string: the string is not null-terminated at Bits.get_string (/home/gnss/mlSoftware/node-rtsp-rtmp-server/bits.js:460:15) at HandlerBox.read (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:1537:24) at HandlerBox.Box (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:830:14) at new HandlerBox (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:1524:47) at Function.Box.parse (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:954:18) at MetaBox.read (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:2361:19) at MetaBox.Box (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:830:14) at new MetaBox (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:2352:44) at Function.Box.parse (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:984:18) at UserDataBox.Container.read (/home/gnss/mlSoftware/node-rtsp-rtmp-server/mp4.js:1056:19)
@shangwenxiang I suspect your mp4 file is somewhat broken. Please try another mp4 file and see if it works.
I am having a similar problem. I have tried three different MP4s. They all generated different errors, but none worked:
Sample.mp4 sample.mp4.zip
2017-03-21 18:00:12.095 [rtsp/http/rtmpt:client=c2] connected
/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/server.js:47
throw err;
^
Error: VisualSampleEntry: depth is not 0x0018: 0
at AVCSampleEntry.VisualSampleEntry.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1816:15)
at AVCSampleEntry.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2618:37)
at AVCSampleEntry.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at AVCSampleEntry.VisualSampleEntry (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1763:54)
at new AVCSampleEntry (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2613:51)
at Function.Box.parse (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1016:18)
at SampleDescriptionBox.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1676:36)
at SampleDescriptionBox.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at new SampleDescriptionBox (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1659:57)
at Function.Box.parse (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:974:18)
small.mp4 small.mp4.zip
/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/server.js:47
throw err;
^
Error: read_byte error: no more data
at Bits.read_byte (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/bits.js:255:17)
at Bits.read_uint32 (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/bits.js:180:85)
at MPEG4BitRateBox.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2646:37)
at MPEG4BitRateBox.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at new MPEG4BitRateBox (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2638:52)
at Function.Box.parse (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1035:20)
at AVCSampleEntry.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2623:32)
at AVCSampleEntry.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at AVCSampleEntry.VisualSampleEntry [as constructor] (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1763:54)
at new AVCSampleEntry (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2613:51)
car.mp4 car.mp4.zip
2017-03-21 17:51:26.557 [mp4] warning: skipping unknown (not implemented) box type: mvex (0x6d766578)
/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/server.js:47
throw err;
^
TypeError: Cannot read property 'firstChunk' of undefined
at SampleToChunkBox.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2084:56)
at SampleToChunkBox.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at new SampleToChunkBox (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2054:53)
at Function.Box.parse (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:980:18)
at SampleTableBox.Container.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1059:19)
at SampleTableBox.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at SampleTableBox.Container [as constructor] (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1051:46)
at new SampleTableBox (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1083:51)
at Function.Box.parse (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:972:18)
at MediaInformationBox.Container.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1059:19)
The last one I figure the box type isn't supported (that was the first one I tried to view). Ok. But then the other two also failed.
I tried with both node v0.12.0 and v4.8.0 with similar results.
Could you provide an MP4 that you've tested?
FWIW, I was able to get sample.mp4 above to work launching with gstreamer:
gst-launch-0.10 filesrc location=sample.mp4 ! qtdemux name=demux ! flvmux name=mux streamable=true ! queue ! rtmpsink location='rtmp://localhost/live/STREAM_NAME' demux. ! multiqueue name=mq ! h264parse ! mux. demux. ! mq. mq. ! aacparse ! mux.
This is watchable from vlc with vlc rtsp://localhost:80/live/STREAM_NAME
(with RTSP over HTTP turned on, fwiw).
But without gstreamer, I get the depth error already reported above when I try vlc rtsp://localhost:80/file/sample.mp4
root@dev-frontend:~/Software/rtsp-http/node-rtsp-rtmp-server# node server.js
2017-03-21 18:34:34.613 attachRecordedDir: dir=/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/file app=file
2017-03-21 18:34:34.660 [rtmp] server started on port 1935
2017-03-21 18:34:34.663 [rtsp/http/rtmpt] server started on port 80
2017-03-21 18:34:34.664 [rtsp/http/rtmpt:client=c1] connected
2017-03-21 18:34:34.678 [rtsp/http/rtmpt:client=c2] connected
/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/server.js:47
throw err;
^
Error: VisualSampleEntry: depth is not 0x0018: 0
at AVCSampleEntry.VisualSampleEntry.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1816:15)
at AVCSampleEntry.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2618:37)
at AVCSampleEntry.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at AVCSampleEntry.VisualSampleEntry (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1763:54)
at new AVCSampleEntry (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:2613:51)
at Function.Box.parse (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1016:18)
at SampleDescriptionBox.read (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1676:36)
at SampleDescriptionBox.Box (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:834:14)
at new SampleDescriptionBox (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:1659:57)
at Function.Box.parse (/home/joe/Software/rtsp-http/node-rtsp-rtmp-server/mp4.js:974:18)
can the three different protocol including rtsp/http/rtmpt listen on the same port 80 ???
@downgoon Yes
I do these: apt-get install nodejs apt-get install npm npm install coffee-script git clone https://github.com/iizukanao/node-rtsp-rtmp-server.git cd node-rtsp-rtmp-server npm install -d
and I put test.mp4 to file,when I use rtsp://localhost:80/file/test.mp4,it happends: error:failed to read file/test.mp4 or file/test.mp4.mp4:TypeError:Object #