How do I make P and B frames in C++?

asked 2015-05-21 23:00:36 -0600

I have a directory of images (frames of a video) than I'm trying to create to make P frames and B frames. How do I go about this after reading in the directory of frames (I currently have the images stored as grey scale in a vector)? I've been poking around and I think I'm supposed to use goodFeaturesToTrack() and calcOpticalFlowPyrLK(), but I'm not entirely sure how to use these functions since I'm new to opencv. Any tips or links to sample code would be appreciated.

Thanks!

edit retag flag offensive close merge delete

Comments

1

explain to us, what P and B frames are.

berak gravatar imageberak ( 2015-05-22 03:23:39 -0600 )edit
1

@berak it has to do with video encoding/decoding and compression, wiki. I do not know though if Opencv supports such a thing in the surface, @goofchou I think you will need to go deep in the source code of Opencv in order to get something...

theodore gravatar imagetheodore ( 2015-05-22 06:58:49 -0600 )edit
1

I see something here, but I do not know if that makes any sense to be used, plus it is involved into the cuda module. Otherwise as I said search into the source code, and my guess would be the part that is related with ffmpeg.

theodore gravatar imagetheodore ( 2015-05-22 07:10:02 -0600 )edit

i guess, both corner detection/tracking and optical flow are far too expensive / advanced for this, but anyway, corners and a gftt/lk demo

berak gravatar imageberak ( 2015-05-22 07:13:40 -0600 )edit