Code: Select all
# Write an uncompressed RGB video file to RAM, at the full resolution of the High-Quality camera: raspividyuv -w 4056 -h 3040 -rgb -o /dev/shm/testvid.rgb -t 2000 -fps 4 # On separate machine, use ImageMagick to convert RGB video file to a set of still images # Note that the X dimension must be increased to an even multiple of 32, so 4056 becomes 4064 sudo apt install imagemagick convert -depth 8 -size 4064x3040 rgb:testvid.rgb test%04d.jpg
So far, so good. However RGB files are so large that I quickly run out of space recording to /dev/shm after just a few frames.
I'm OK with lower chrominance resolution than luminance resolution, so YUV seems like a better option.
I can (I think) record a YUV file, doing for example:
raspividyuv -w 4056 -h 3040 -o /dev/shm/testvid.yuv -t 2000 -fps 6
But try as I might, I have been unable to convert an uncompressed YUV video file to a sequence of stills in a similar way as with RGB. Does anyone know how this is done in ImageMagick? I've tried the below command, which produces an interesting result, but it is not yet quite right:
convert -depth 8 -sampling-factor 4:2:0 -interlace plane -identify -size 4064x3040 rgb:testvid.yuv frame%04d.jpg