Chunbo H. (Intel) wrote:
The source code in the p2p example can capture stream from webcam in the local machine.
It uses MediaStreamFactory.createMediaStream() to create a video stream( call getDisplayMedia() for srceen and getUserMedia() for webcam).
I want to capture stream from a IPcamera which provides RTSP or RTMP stream, not webcam or screen。
How can I capture the stream from a RTMP url? For example : rtmp://127.0.0.1/live/ (It can played in VLC player)
Below is my code:
<video width="640px" height="480px" id="localVideo" controls playsinline muted>
<source src="rtmp://127.0.0.1/live/" type="rtmp/flv">
<!-- source src="rtmp://media3.sinovision.net:1935/live/livestream" type="rtmp/flv" -->
var video_element = document.getElementById("localVideo");
mediaStream = video_element.captureStream();
When I run the code, an error prompted : "Error: All tracks are ended."
Can you tell me what is wrong with the code above? Thanks.
When the <video> source is a mp4 file, such as :<source src="js/array.mp4" type="video/mp4">, the video_element.captureStream() works OK. Mp4 stream can be transported to the remote peer and played OK.
I want :
Peer B capture RTMP stream and publish to Peer A.
Peer B can play the locally with videojs, but can not publish to Peer A. It prompted : "Error: All tracks are ended."