On 16/11/2010 12:34, Tomas Härdin wrote:
On Tue, 2010-11-16 at 12:28 +0000, Mark Kenna wrote:
On 16/11/2010 12:24, sq.cheng wrote:
use the video decode to do it
just like decoding mpeg4 or h.264, with the JPEG codec id(I don't remember
what's name, something like MJPEG)
then decode one frame, it will output one yuv frame,
and it seems I once met the output is yuyv, according to the input image.


On Tue, Nov 16, 2010 at 8:11 PM, Mark Kenna<
[email protected]>   wrote:

Hi Guys

Does anyone know if it's possible to convert a JPEG to YUV frame simply
using LibAv*? Currently I am converting to a Bitmap and converting the RGB
data to a YUV frame using sws. If there is a simpler (and more efficient)
method I would love to know about it.

Thanks,
Mark.

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-useriewsystems.com/support
Interesting - I will give it a try. If someone could specify the exact
codec to use I would appreciate it.

Thanks,
Mark.
Use the mjpeg decoder (CODEC_ID_MJPEG). It should work fine.

Also, since jpeg supports a number of YUV formats you might want to make
sure your input is in the format you want. Otherwise you will have to
use libswscale anyway. It's probably quite a bit faster converting YUV
->  YUV than RGB ->  YUV though.

/Tomas


_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
How exactly would one check the input format first? I would write it like so:

  1. Check input format, if YUV then just decode
  2. If input format != YUV, decode and then scale it to YUV
  3. Handle YUV

Does that sound about right?

Thanks,
Mark.

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to