CV_8UC3 pixel format question Update
Thanks to berak's answer I've been able to get something going with OpenCV that uses much less code than the FFmpeg equivalent.
My new problem is that the resultant YUV image doesn't look correct. Following tutorials for saving/showing the image, it looks like the Y and/or U component are missing.
cv::Mat input_image = cv::imread("CustomInput.jpg"); cv::Mat output_image; cv::cvtColor(input_image, output_image, CV_BGR2YUV); cv::imwrite("/home/nmenne/hri/trunk/dsat/dsat_lsa/CustomOutput.jpg", output_image);