2

I am developing the rtmps live streaming by videojs.

But I have a problem. T_T

The rtmps live-streaming do not play. (Rtmp works well.)

Even if you use another flash player, it won't play. (ex) jwplayer


<video ...
data-setup='{ "techOrder":["html5", "flash"]}'>
...
<source src = " ** RTMPS_URL ** " type ="rtmp/flv"/>
</video>
  • RTMPS_URL : rtmps://{SERVER_URL}/?{PARAMETER}
  • SERVER_URL : IP:PORT/args1/args2
  • PARAMETER : key = value

videojs error message.

"FLASH: rtmpconnectfailure"

The suspected part is as follows.

  1. The rtmps server is writing a personal certificate.(Certificate not certified by public institutions) So I installed a personal certificate on my computer, and the error is identical.

  2. Videojs blogs are said to offer rtmps.Are you sure?

What am I doing wrong?

I need your help.

thanks :-)

Kevin Yan
  • 1,236
  • 11
  • 19

1 Answers1

1

I hope you solved this problem but I still post the solution here for those have the same issues like me.

My working environment: nginx with rtmp module, ffmpeg get RTSP from ip camera and push to nginx in flv format, display the this streaming in web.

videojs changed a lot so I put my html here:

<html>
<script src="./video.min.js"></script>  //download the videojs from npm or use the online url one
<link rel="stylesheet" type="text/css" href="./video-js.css">
<script src="https://cdn.jsdelivr.net/npm/videojs-flash@2/dist/videojs-flash.min.js></script>

<body>
<video id="liveVideo" class="video-js" controls autoplay preload="auto" width="320" height="240" data-setup="{}">
        <!-- <source src="rtmp://ns8.indexforce.com/home/mystream" type="rtmp/flv">-->
        <!-- the above rtmp link is for testing your videojs works or not -->
        <source src="rtmp://192.168.1.180/cam1/" type="rtmp/flv">
</video>
</body>
</html>

########################

rtmp://192.168.1.180/cam1/ is my nignx server ip address (both my server and client are in the same local network)

ffmpeg -i <Your video/stream> -f flv <Your RTMP url>

########################

I get the FLASH: rtmpconnectfailure, VIDEOJS: ERROR: (CODE:0 MEDIA_ERR_CUSTOM) FLASH: rtmpconnectfailure, at first.

I solved by just adding a '/' at the end in "<video....><source src="rtmp://.../.../ <----this one '/' "></video>" in my html file

So make sure you add '/' at the end in your source url.

Successful run in Chrome, Opera and Edge (have to enable flash in browser setting) at DEC 2020

Good Luck :o)

kiu
  • 111
  • 1
  • 6