OpenCV stream captured CAM with H264 codec (mp4)

I like to stream webcams captured by opencv. I am thinking of a solution with ffmpeg and live555 (bad they are not so well documented). My problems:

  • How to convert captured images to H264 format to match peak / second. If it is in a loop, I get over 25 images / sec, and the video is fast.

  • How can I directly transfer the converted H264 stream over the network via rtp / rtps or similar.

Thank you for your help!

+7
source share
2 answers
  • This is a common problem.
    • If you do not need to distribute your software (private use / server side / open source), you can use FFMpeg compiled with x264 encoder , there is a configuration flag for the FFMpeg config script.
    • If you need to distribute your software, I do not know any licensed LGPL library, I believe that there is no such library. You will need to use some kind of paid solution.
  • You should implement DeviceSource.cpp, see DeviceSource.hh and use it as FramedSource.

Edit : Apple discovered the video encoder API by allowing access to the h264 frame stream in iOS8

+3
source

For an example of using x264 and Live555 for encoding and streaming frames, see the following:

+1
source

All Articles