OpenCV cvGrabFrame_FFMPEG & cvRetrieveFrame_FFMPEG get image

Just starting out? Need help? Post your questions and find answers here.
LiK137
Enthusiast
Enthusiast
Posts: 279
Joined: Wed Jun 23, 2010 5:13 pm

OpenCV cvGrabFrame_FFMPEG & cvRetrieveFrame_FFMPEG get image

Post by LiK137 »

Hi,
trying to get captured image address.
All tries give no result
even with CVMAT I get corrupt image but at least get.
Is there a normal way to get normal image?

Code: Select all

    If cvGrabFrame_FFMPEG(*ffcapture)
      If cvRetrieveFrame_FFMPEG(*ffcapture, @*ffdata, @cvStep, @width, @height, @cn)

        *ffframe = cvMat(height, width, CV_MAKETYPE(#CV_8U, cn), *ffdata)
        cvShowImage(#CV_WINDOW_NAME, *ffframe)

      EndIf
    EndIf  
Thank you very much.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: OpenCV cvGrabFrame_FFMPEG & cvRetrieveFrame_FFMPEG get i

Post by Olliv »

Height var before width var ?
LiK137
Enthusiast
Enthusiast
Posts: 279
Joined: Wed Jun 23, 2010 5:13 pm

Re: OpenCV cvGrabFrame_FFMPEG & cvRetrieveFrame_FFMPEG get i

Post by LiK137 »

You think that is the problem?
This came from "PureBasic Interface to OpenCV" 3.3 cv_RTSP_WriteFrame_FFMPEG.pb the only example with FFMPEG capture/write frame pb example in the iNet.
So I just left as is except "cvPutText" and at least it works.
But what if without Matrix, if no need for cvMat, grab frame to directly IplImage with FFMPEG.
Post Reply