Ask Your Question
0

Stream RTMP?

asked 2014-07-21 03:07:23 -0600

klo gravatar image

updated 2014-07-21 03:08:11 -0600

I'm using opencv Python module 2.4.9 and want to capture RTMP stream.

I tried this:

import cv2
cap = cv2.VideoCapture()
cap.open('rtmp://stream_url')

which returns False

If I try to play same url with ffplay all is fine:

Metadata:  :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0
  videocodecid          avc1
  width                 704.00
  height                576.00
  frameWidth            704.00
  frameHeight           576.00
  displayWidth          704.00
  displayHeight         576.00
  framerate             6.25
trackinfo:
  timescale             90000.00
  language              eng
sampledescription:
  sampletype            H264
  type                  video
  profile-level-id      420029
  sprop-parameter-sets  Z0KAFoiLUFgJNCAAA4QAACvyAIA=,aM44gA==
  description           {H264CodecConfigInfo: profile: "Baseline", level: 2.2, frameSize: 704x576, displaySize: 704x576,
 frameRate: 6.25}
rtpsessioninfo:
  emailaddress          NONE
  name                  Media Presentation
  origin                - 1405834265312553 1405834265312553 IN IP4 <ip-address>
  timing                0 0
  protocolversion       0
attributes:
Input #0, flv, from 'rtmp://<stream_url>':
  Metadata:
    frameWidth      : 704
    frameHeight     : 576
    displayWidth    : 704
    displayHeight   : 576
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p, 704x576, 6.25 fps, 43.42 tbr, 1k tbn, 12.50 tbc
 117.49 M-V: -0.038 fd=   8 aq=    0KB vq=   15KB sq=    0B f=1/1

Any ideas how to resolve?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-01-22 02:59:41 -0600

guoxz gravatar image

updated 2018-01-22 03:00:04 -0600

you must install opencv with ffmpeg

my cmake list:

  Video I/O:
    DC1394 1.x:                  NO
    DC1394 2.x:                  YES (ver 2.2.4)
    FFMPEG:                      YES
      avcodec:                   YES (ver 57.89.100)
      avformat:                  YES (ver 57.71.100)
      avutil:                    YES (ver 55.58.100)
      swscale:                   YES (ver 4.6.100)
      avresample:                NO
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-07-21 03:07:23 -0600

Seen: 2,326 times

Last updated: Jan 22 '18