JuliaIO / VideoIO.jl

Reading and writing of video files in Julia via ffmpeg
https://juliaio.github.io/VideoIO.jl/stable
Other
128 stars 53 forks source link

Attempt to get camera device names from ffmpeg/filesystem. (Fixes #21) #26

Closed kmsquire closed 10 years ago

kmsquire commented 10 years ago

@staticfloat, @ihnorton, can you test this before I merge it?

No hurry--I'll be mostly offline for a couple of days.

staticfloat commented 10 years ago

I think it's working, but README.md seems to be a little behind this PR, so I'm not 100% certain how to test. I seem to remember Images changing how color images are handled recently, so I think that might have something to do with it, but I can get images from my camera automagically which is awesome. I just can't display them. :P

julia> using VideoIO

julia> using Images

julia> cam = VideoIO.opencamera()
[avfoundation @ 0x7f86e7beb400] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7f86e7beb400] Supported pixel formats:
[avfoundation @ 0x7f86e7beb400]   uyvy422
[avfoundation @ 0x7f86e7beb400]   yuyv422
[avfoundation @ 0x7f86e7beb400]   nv12
[avfoundation @ 0x7f86e7beb400]   0rgb
[avfoundation @ 0x7f86e7beb400]   bgr0
VideoReader(...)

julia> img = Image(read(cam))
Unknown Image with:
  data: 3x1280x720 Array{Uint8,3}
  properties:

Looks like we might need to fix up the pixel format as well, but this is definitely progress!

kmsquire commented 10 years ago

Try:

img = read(cam, Image)
...
read!(cam, img) # overwrites img

Images has to bs loaded before VideoIO for this to work. The recent changes to images shouldn't have affected things yet (although I'll need to take them into account soon).

kmsquire commented 10 years ago

Oh, and yes, we'll need to detect the pixel format somehow...

staticfloat commented 10 years ago

Excellent. That does indeed work. It would be nice if we didn't need to enforce an ordering on using statements; perhaps if Images is installed at all, VideoIO can load it directly?

kmsquire commented 10 years ago

Do you actually get an image that you can display, or is the format still wrong?

Regarding load order of modules, the current method is meant to be a compromise. Modules are loading faster than before, but load times are still significant, and there are some (well, one) potential user(s) of VideoIO who specifically don't want to load Images when this module loads.

I'm hoping that we will eventually be able to have triggers so that the code can be made available no matter what order the packages are loaded in, but that it is still possible not to load Images if it's not needed.

Or that precompilation will make this a moot point. :-)

On Wednesday, September 3, 2014, Elliot Saba notifications@github.com wrote:

Excellent. That does indeed work. It would be nice if we didn't need to enforce an ordering on using statements; perhaps if Images is installed at all, VideoIO can load it directly?

— Reply to this email directly or view it on GitHub https://github.com/kmsquire/VideoIO.jl/pull/26#issuecomment-54317395.

staticfloat commented 10 years ago

Yes, I can display it just fine. It works great!

kmsquire commented 10 years ago

Excellent!