How to create Python service run on remote server that ingest video stream from client via RTMP?

Viewed 310

Sorry I am new to video streaming and I know nothing about online live stream yet.

Use Case:

  • I want to stream IP camera, which is only accessible on local network, to 1 remote server on the internet. Remote server cannot access those IPs camera (NAT firewall, dynamic IP, ...etc). A local machine on local network will access those camera and live stream to my remote server. Remote server will do processing on those video feed (computer vision task ...)

  • Simple case of local machine that take video feed from my IP camera and stream to Twitch.tv with ffmpeg.

    ./ffmpeg.exe -rtsp_transport -tcp -i rtsp://admin:Aa123456@192.168.1.2:554/onvif1 -vcodec libx264 -b:v 5M -acodec aac -b:a 256k -f flv rtmp://sin.contribute.live-video.net/app/live_this_is_my_private_twitch_stream_key

  • I want to build a web service host on a remote server that receive streams like rtmp://sin.contribute.live-video.net

  • I prefer my RTMP service in Python, and work with OpenCV. My service will receive stream from multiple client (like Twitch, Youtube streaming service that have many user, with different streaming key).

  • Python-OpenCV can directly access RTSP stream from IP Camera on same local network. However, open port forwarding to direct access RTSP stream of IP camera from the internet is not good solution and required to manually handle case-by-case on client network, which may time-consuming or not possible. So I would like the client to stream video to remote server rather than have remote server get it from client

I am new into streaming stuff, so please advise me.

  • What should I start looking into ?
  • What library, open-source, framework ?
  • Please give me the keyword, name, and example code if possible.
0 Answers
Related