yuv

Load RAW YUV video in OPENCV

两盒软妹~` 提交于 2019-12-10 23:24:25
问题 I have a problem with a RAW YUB video load in OpenCV. I can play it in mplayer with the following command: mplayer myvideo.raw -rawvideo w=1280:h=1024:fps=30:y8 -demuxer rawvideo My code for load in OpenCV is: CvCapture* capture=cvCaptureFromFile("C:\\myvideo.raw"); cvCaptureFromFile always return NULL. But if I try with a normal avi file, the code runs normally (capture is not null). I'm working with the lastest version of OpenCV under Windows 7. EDIT: Output messages are [IMGUTILS @

Why won't AVFoundation accept my planar pixel buffers on an iOS device?

我的未来我决定 提交于 2019-12-10 19:42:51
问题 I've been struggling to figure out what the problem is with my code. I'm creating a planar CVPixelBufferRef to write to an AVAssetWriter . This pixel buffer is created manually through some other process (i.e., I'm not getting these samples from the camera or anything like that). On the iOS Simulator, it has no problem appending the samples and creating a valid output movie. But on the device, it immediately fails at the first sample and provides less than useless error information:

NV21 format and odd image dimensions

你说的曾经没有我的故事 提交于 2019-12-10 17:08:40
问题 I have been working for some time with NV21 images in Android and I have been tracking a bug that might be caused by incorrect indexing bytes in an NV21 image. The image in the answer of this question has a nice overview of how the Y, U and V bytes are positioned in the image buffer. Not sure it is allowed, but I am embedding it below: What happens when the image has odd dimensions (as in parity)? Is that even possible in this format? Do we have an official specification of this format

Convert YUV into HSL or HSV bypassing the RGB step

纵然是瞬间 提交于 2019-12-10 16:17:57
问题 Wikipedia and plethora of online resources provide detailed and abundant help with various color space conversions from/to RGB. What I need is a straight YUV->HSL/HSV conversion . In fact what I need is just the Hue (don't care much for the Saturation or the brightness Lightness/Value). In other words I just need to calculate the "color angle" for a given YUV color. Code in any language would suffice, though my preference is C-style syntax. Note that by YUV I mean specifically Y′UV, a.k.a.

glPopMatrix() yells “unsupported texture format in setup_hardware_state”

南笙酒味 提交于 2019-12-10 13:43:01
问题 I'm trying to make some optimizations in a private video player for Linux aiming to improve performance because playing MP4 files are heavy on the CPU , since the video frames are encoded in YV12 and OpenGL doesn't provide a native way to display this format. Right now there's a code that runs on the CPU to converts YV12 to RGB before the image is sent to the GPU for display, and this consumes 100% of CPU processing. I'm currently investigating how to decode YV12 frames without having to

Convert YUY2 to YV12

核能气质少年 提交于 2019-12-10 07:53:26
问题 I am almost sure that this is much simpler than I think it is, but I have been scouring the internet for a much longer time than I care to admit to try and figure out how the frig to convert the two formats. I am able to extract the Y0, Cb, Y1, Cr data from a stream of unsigned bytes (unsigned char), but I have no idea how these bytes are arranged in YV12 - is this document implying that the various values are actually contained in different rows? I've literally been searching all day for

How to extract frames(or a perticular frame) from a YUV video using ffmpeg

大憨熊 提交于 2019-12-09 19:36:44
问题 Here is the code for extracting frames from a MP4 video. ffmpeg -i above_marathon_250.mp4 images%03d.bmp But the same code does not work for YUV format video. Does anyone knows how it is possible to extract frame(s) from YUV format video? 回答1: It's not working because yuv files have no header, so ffmpeg doesn't know what size/pixfmt the file is. You need to specify resolution and pixmt manually: ffmpeg -video_size 1920x1080 -r 25 -pixel_format yuv422p -i file.yuv output-%d.png And then adjust

Fastest way to draw a MediaCodec-decoded video frame to screen?

风格不统一 提交于 2019-12-09 11:46:58
问题 I'm looking for the fastest way to take an image frame received from the MediaCodec decoder and draw it to the Android device screen. The important constraints and explanations are: Cannot use MediaPlayer. No intermediate app allowed. Must draw output frames from the MediaCodec decoder to the screen as quickly as possible (minimize latency). The available decoder output formats are as follows: ColorFormat[0] 0x00000013 COLOR_FormatYUV420Planar ColorFormat[1] 0x00000015 COLOR

How to display a raw YUV frame in a Cocoa OpenGL program

99封情书 提交于 2019-12-09 01:47:53
问题 I have been assigned wit the task to write a program that takes a sample raw YUV file and display it in a Cocoa OpenGL program. I am an intern at my job and I have little or no clue how to start. I have been reading wikipedia & articles on YUV, but I couldn't find any good source code on how to open a raw YUV file, extract the data and convert it into RGB and display it in the view window. Essentially, I need help with the following aspects of the task -how to extract the YUV data from the

How to perform RGB->YUV conversion with ActionScript?

≡放荡痞女 提交于 2019-12-08 11:54:25
问题 How to perform RGB->YUV conversion with ActionScript? Libs? Tuts? Articles? 回答1: Check this article: http://www.fourcc.org/fccyvrgb.php Conversion is quite easy so you probably could write your own function based on this: Y = (0.257 * R) + (0.504 * G) + (0.098 * B) + 16 Cr = V = (0.439 * R) - (0.368 * G) - (0.071 * B) + 128 Cb = U = -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128 来源: https://stackoverflow.com/questions/1737712/how-to-perform-rgb-yuv-conversion-with-actionscript