converting from whatever to YUY2... endianness?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Posts: 1
Joined: 2016-02-12T10:58:02-07:00
Authentication code: 1151

converting from whatever to YUY2... endianness?

Post by luggerz » 2016-02-12T11:06:38-07:00


Sorry if this is a dumb question... I've searched and read and searched and haven't found too much detail on the YUV output. I'm trying to go from an input file (it can be anything from jpg to png, etc.) into a specific 8-bit packed YUY2 4:2:2 output.

I'm running version Q16 (cool rev, bro :D ) on Centos 7.1 (soon to be 7.2)

My command line looks like this:
convert someinputfile.jpg -resize 1280x720\! -sampling-factor 4:2:2 -depth 8 colorspace YUV -interlace none output.yuv

I get a packed 4:2:2 8-bit yuv, but it's in uyvy format instead of yuyv, so I'm having to do an extra byte swap after the convert.

So my question is... is there a command line option I can add to get the bytes in the order I'd like? I've tried -endian MSB as well as LSB and was surprised to see the output yuv files generated were identical.

Thanks in advance for any help!

Post Reply