How to open file\live stream with FFMPEG edit each frame with openCV and save that as encoded with FFMPEGfile\live stream?
H开发者_如何学Pythonow to open file\live stream with FFMPEG edit each frame with openCV and save that as encoded with FFMPEGfile\live stream?
Well it is quite simple.
I suggest you begin with the simple ffmpeg decoding example. With that you get a struct which is an FFMPEG image. You have to convert it to an opencv image struct (IplImage). Then you can apply any opencv operation. Then you can look at FFMPEG encoding example and you have your whole processing chain :)
The point is to convert FFMPEG image struct to opencv image struct. It is quite simple after you have read the documentation (the code ?).
Edit your question if you have more precise needs.
my2c
Here is an example of how-to capture a video stream with OpenCV, encode as mpeg-4 and then deocde back to a:
http://dimitri-christodoulou.blogspot.com/2012/02/encode-and-decode-video-from-memory.html
精彩评论