Closed IanButterworth closed 5 years ago
Presumably you enabled this because you have a black and white video that you're trying to read.
Has this change been sufficient? It looks fine to me.
Is there a short black-and-white video that we might be able to test with? That might require changing how we get the test videos.
It works for my local videos. How about this for a test video:
Perhaps the best way to handle this is to just make readvideo()
read ColorTypes.gray
for grayscale source videos? That way the testing method wouldn't need to change.
That test video seems fine!
Perhaps the best way to handle this is to just make
readvideo()
readColorTypes.gray
for grayscale source videos?
Assuming you mean read
(and retrieve
, which should probably just be renamed to read
).
I was going to write something about type stability, but most of the code is already type unstable, so I guess that wouldn't change much.
However, I think it would be better to allow the user to specify the desired ColorType
of the output, and map those to ffmpeg's pixel formats, which would allow the function to be type stable. We could still have a type-unstable version which first detected the pixel format of the input, and returned the most appropriate output format.
Those tasks are disjoint, so... that's a long way of saying, sure, we can just change read
to return ColorTypes.gray
for grayscale videos. ;-)
That way the testing method wouldn't need to change.
The tests (like many other parts of this package) could use some love. The basic ideas are fine, but the code itself should be reorganized. However, that doesn't have to be done here.
I'm going to create a some issues for the ideas above.
@kmsquire I've not got around to doing the suggested test improvements. Do you think it would be ok to merge this before that happens?
Sure.
Hopefully a simple change to enable grayscale UInt8 based videos.
Also added an example for reading in a full video