I’m struggling to figure out how to read in a UInt8 grayscale video.
read(open(videofilename)) isn’t working on this video format. I just get a 1D array of UInt8 that’s about 20k elements longer than the video should be based on w x h x nframes
Any ideas appreciated. I’d like most to have a basic function where I can tweak ffmpeg to match the source format and control the codec precisely. I’m writing videos like that based on the example given here: Creating a video from a stack of Images - #8 by stillyslalom
It seems that the 3x taller issue with FFmpegPipe.jl was actually because of an oddity in how Image J saves it’s AVIs, with 3 duplicated grayscale channels, or something to that effect.
I’ve hardcoded a stride into my FFmpegPipe code for now and it seems to work.
But it is VERY slow… Lots of small readbytes() seem to be slowing things down significantly
Yes, as I mentioned in the issue, the readpngdata could be much better implemented using IOBuffers. I hadn’t properly learned how to use these in Julia at the time that I wrote it. (And read speed didn’t matter for what I needed it for.)
However, I suspect a lot of the slowdown comes from the fact that each frame is compressed as a png and then immediately decompressed. If you want to write something faster, it’s proabably be better to go with an uncompressed intermediate format.
Better would be to reduce the output framerate of ffmpeg with the r_out keyword argument. That way you don’t waste time on transferring frames that will not be used.