Pipe Raspberry Pi Video into ffmpeg and opencv: A Failure So Far

Trying to get video off of raspberry pi in a low latency way.

 

Piping raspivid through netcat as suggested in raspicam documentation

Mplayer does a decent job. Maybe 0.1 second latency. Pretty dang good.

VLC did not do so good. Maybe 3 second latency. Perhaps some fiddling would fix?

Eventually, we want the stream in a program somewhere, hopefully python is acceptably fast. Here is a site that I heavily cribbed from

http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/

The colors are screwed up. This is not fast enough for our purposes. If you want, I believe you can fix it with cv2.cvtColor

You can see that I’ve tried a bunch of ffmpeg tags but none seem to help.

It does not appear that python is the speed hangup. I inspected with python -m cProfile

 

 

2 thoughts on “Pipe Raspberry Pi Video into ffmpeg and opencv: A Failure So Far”

    1. Hi, I recently came across another approach you might try.
      http://www.linux-projects.org/uv4l/
      It seems like a fairly turn key solution that has been demonstrated to work on the pi. I have not tried it yet though.
      Also gstream seems like another option, but people report less ease or success.
      Try googling or youtubing those.

      -Philip

Leave a Reply

Your email address will not be published. Required fields are marked *