doesn't read YV12 files properly
Status: Pre-Alpha
Brought to you by:
chris1ennis
the current version allocates and sets the length of the byte[] array returned in getFrame to be "frame->GetPitch() * frame->GetHeight()". This isn't correct for planar colorspaces with reduced color resolution (e.g. like YV12).
A simple fix for YV12 is something like this (tested and implemented):
"
// Construct the java byte array for return
int length = frame->GetPitch() * frame->GetHeight();
if ((*venv->clip)->GetVideoInfo().IsYV12())
length += (frame->GetPitch() * frame->GetHeight())/2;
"
you may want to adapt to something more generic to handle any colorspace with compressed color difference channels. You would need to know the resolutions for the Y, U, and V channels.
I will take a look at this, but the original intent was to always convert to RGB for display in java. In fact the java code always appends a filter to convert to RGB if the format is not already RGB. The java code will also need to change to support YV12. Is there a need to get YV12 data in java for manipulation?