iOS capture problem

rpappalax rpappalax at gmail.com
Thu Nov 15 15:38:48 PST 2012


We've received a response back from Apple that (as of iOS6), they are now
adding padding to the video source.  So just passing the pointer onto
GstBuffer (the way avfvideosrc currently does) will no longer work, for
resolutions/orientations where padding has been added.

------
Apple:
------
Both the stride (bytes of padding added to each row), as well as the
extended rows (rows of padding at the bottom or top of the buffer) are
important.
The extended rows are what changed in iOS6; you can find out how many rows
of padding are added to the buffer using:
CVPixelBufferGetExtendedPixels(pixelBuffer, &columnsLeft, &columnsRight,
&rowsTop, &rowsBottom)

In the example you gave (Medium preset on iOS6) you should be seeing
rowsBottom = 8.

The stride is effectively CVPixelBufferGetBytesPerRowOfPlane() and includes
padding (if any).
When no padding is present CVPixelBufferGetBytesPerRowOfPlane() will be
equal to CVPixelBufferGetWidth(), otherwise it'll be greater.

------
Question:
------
If we were using Apple's buffer handling, I assume this would be an
non-issue.  But since avfvideosrc just passes a data pointer and overall
size of data directly onto GstBuffer, I assume we'll now need to
post-process this padding within GStreamer.  

Does anyone know if it's possible to set a flag with padding info on a
GstBuffer created from a Core Foundation CMSampleBuffer?  Our objective is
to avoid allocating an entirely new buffer and the performance hit that
might come with it.

Here's the way the new video frame image looks:
<http://gstreamer-devel.966125.n4.nabble.com/file/n4656939/pixel-buffer-with-padding-in-yuv.jpg.jpeg> 

rpappalax wrote
> Hi,
> 
> I've been able to do video capture on iOS 5.1, but after upgrade to 6.0,
> there's a green stripe across the top of the video and some color
> separation.  This happens only when using AVCaptureSessionPresetMedium
> (480x360).  I'm trying to track down if the issue is in recent changes to
> AVFoundation or in the way gstreamer handles them. 
> 
> I've tried filing a defect with Apple, but they're requesting more
> information about use of API (and taking stride into account).  I assume
> they want to see if there's some mishandling with postprocessing of video
> stream.  I'm not familiar enough with avfvideosrc to understand padding
> might be might be taking place.
> 
> Any help in better understanding this would be appreciated.
> 
> Thanks!
> -Richard
> 
<http://gstreamer-devel.966125.n4.nabble.com/file/n4656685/ios6_GREEN_BAR.png> 




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/iOS-capture-problem-tp4656685p4656939.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list