Can Magick++ work with YUV420P? (4:2:0)

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Airon65
Posts: 75
Joined: 2017-02-26T02:19:38-07:00
Authentication code: 1151

Can Magick++ work with YUV420P? (4:2:0)

Post by Airon65 »

I've found some information about supported formats by IM (https://www.imagemagick.org/script/formats.php). There's some info about YUV 4:2:2 but nothing about 4:2:0.

I want to create a video "on the fly" drawing each frame with Magick++ and encoding it with FFMPEG. The problem is FFMPEG works good with YUV420P but it seems that IM doesn't :) How to automate this process? :)

Should I generate frames in IM using RGB colorspace and then encode each frame to YUV420P manually?

I use the latest IM.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Can Magick++ work with YUV420P? (4:2:0)

Post by snibgo »

When I've made videos, I've used sRGB and thrown the files at ffmpeg, not really caring about colorspace conversions that ffmpeg might do.

If you want to throw YUV at ffmpeg, you can do that with IM. For both IM and ffmpeg, the default variety of YUV seems to be 4:2:0.

ffmpeg doesn't seem to like the input as one yuv file per frame with a wildcard, but wants them joined together in one file.

For example, we make a boring movie with 10 "rose:" frames. Windows BAT syntax.

Code: Select all

convert rose: -duplicate 9 r_%%04d.yuv

copy /B r_*.yuv rm.yuv

ffmpeg -video_size 70x46 -i rm.yuv -y hb1.avi
snibgo's IM pages: im.snibgo.com
Post Reply