5

I'm developing a python program to receive a live streaming video from android device via RTMP. I created a server and also I'm capable of transmitting a videoStream from android device. But the problem is I can't access that stream in opencv. Can anyone tell me a way to access it via opencv. It is better if you can post any python code snippets.

Vajira Prabuddhaka
  • 744
  • 2
  • 11
  • 29
  • Possible duplicate of [OpenCV won't capture frames from a RTMP source, while FFmpeg does](https://stackoverflow.com/questions/30096327/opencv-wont-capture-frames-from-a-rtmp-source-while-ffmpeg-does) – aergistal Sep 01 '17 at 06:24

1 Answers1

9

Just open the address instead of your cam :

myrtmp_addr = "rtmp://myip:1935/myapp/mystream" cap = cv2.VideoCapture(myrtmp_addr) frame,err = cap.read()

From there you can handle your frames like when you get it from your cam. if it still doesn't work, check if you have a valid version of ffmpeg linked with your opencv. You can check it with print(cv2.getBuildInformation())

Hope I could help

Martin Faucheux
  • 601
  • 7
  • 14