How can I get I420 frame correctly?

This forum is about all development around libVLC.
Magic_YH
New Cone
New Cone
Posts: 1
Joined: 06 Aug 2015 03:48

How can I get I420 frame correctly?

Postby Magic_YH » 06 Aug 2015 04:13

I use libvlc_video_set_callbacks to get the output I420 frames but find I get wrong picture. The code is listed below:

libvlc_video_lock_cb

Code: Select all

vlcCallBackHandler* handler = (vlcCallBackHandler*) opaque; int length = handler->width * handler->height; planes[0] = handler->buff; planes[1] = handler->buff + length; planes[2] = handler->buff + length*5/4; handler->mutex.lock();
And when I check the buff, I found that only first 128000 byte have non-zero data while my test video's size is 1280*720.
In my cognition, planes[0] will save the Y channel and it's size will be width*height, and planes[1] will save U channel and it's size will be (width/2)*(height/2) ans so as the planes[2] save V channel. Is it right?

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: How can I get I420 frame correctly?

Postby RSATom » 11 Aug 2015 13:46



Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests