0

I'm working on a application to show a rtsp stream video. I have used opencv and livbav avplay. The problem is lag or low latency. With this solutions I obtain a latency of 500 ms. But I need about 300 ms in order to have a properly control of the streaming camera.

I'm trying open the same rtsp stream with mplayer command console, and the results are amazing. I have latencies of 250-300 ms. But the problem is that i haven't found a proper solution for working with my app (WPF) For example in opencv and livab avplay i obtain a Mat or a byte structure (frame by frame) that i can use in my app. But what about mplayer. Is there any solution to get the same structure? I mean get frame by frame and the draw it with my application. Any API or lib to use like opencv or avplay?

Thanks.

isra60
  • 512
  • 1
  • 6
  • 18

1 Answers1

0

I trust you have already reviewed the wide range of answers in the older post: How can I display an RTSP video stream in a web page?

More to the point, mplayer on Windows uses DirectX...so compile a Windows binary, parameterize your RTSP source an launch a minimized window in play mode. Use a windows hook from your app to the mplayer window to pass mplayer control calls (pause, resume...) Inside your app, trap the DirectX instance and register a listener that fills a framebuffer object. Use your code to do what you want to those frames...

I'd be more specific, but you didn't really clarify your objectives except to 'get' frames.

If all you want is to display the video feed, then the new window will work and is controllable. The VLC player discussed in the other posts provides an API for more control/versatility.

Community
  • 1
  • 1
JasonInVegas
  • 381
  • 2
  • 10
  • Thanks for your answer. But the the problem with VLC is the delay of the stream. With mplayer i have achieved a really good delay. That is the reason that i want to use the technology behind mplayer. I am trying to found the way mplayer shows the frames it decodes to get that frames to my app – isra60 Jun 07 '14 at 13:46