Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get available pixel formats for camera device #31

Closed
ssfrr opened this issue Sep 9, 2014 · 37 comments
Closed

Get available pixel formats for camera device #31

ssfrr opened this issue Sep 9, 2014 · 37 comments

Comments

@ssfrr
Copy link

ssfrr commented Sep 9, 2014

When opening the camera on OSX the image is upside-down. It also prints the following:

julia> using ImageView
julia> using VideoIO
julia> VideoIO.viewcam()
# [avfoundation @ 0x7f83cbb21c00] Selected pixel format (yuv420p) is not supported by the input device.
# [avfoundation @ 0x7f83cbb21c00] Supported pixel formats:
# [avfoundation @ 0x7f83cbb21c00]   uyvy422
# [avfoundation @ 0x7f83cbb21c00]   yuyv422
# [avfoundation @ 0x7f83cbb21c00]   nv12
# [avfoundation @ 0x7f83cbb21c00]   0rgb
# [avfoundation @ 0x7f83cbb21c00]   bgr0

But it's working!!

@kmsquire
Copy link
Collaborator

kmsquire commented Sep 9, 2014

Interesting! Thanks for the report, Spencer.

Can you try with master and see if you get the same behavior? (Assuming you haven't already, of course. )

@kmsquire
Copy link
Collaborator

kmsquire commented Sep 9, 2014

Whoops, no, it should be fixed by #21, but I haven't merged that yet. Will do so sometime today.

@maxruby
Copy link
Contributor

maxruby commented Sep 9, 2014

Kevin,

I replied to your kind message in JuliaLang/julia#8288. But since the issues I am having right now have more immediately to do with trying VideoIO, I thought I´d repost the message here.

I Installed VideoIO (following the instructions on GitHub) but it did not work on my Mac OSX 10.9.4 with Julia v0.3. The downloading of the sample movie Io stream worked fine, but the window display was black (no image).

When I tried f = VideoIO.opencamera() failed to capture any live video from my camera (MacBookPro 2010). julia> f = VideoIO.opencamera() [AVFoundation input device @ 0x7fece837c5e0]
Video device not foundERROR: Could not open file Integrated
Can you suggest what I should do to tackle these problems with the installation?

@kmsquire
Copy link
Collaborator

kmsquire commented Sep 9, 2014

I just tagged a new version of VideoIO which (I hope) addresses some of these issues. Can you run Pkg.update() and try again?

I'm a little concerned about the window display being black--that sounds like an issue with either the ImageView or Tk packages, which are involved in image display.

@timholy, any thoughts on those?

@maxruby
Copy link
Contributor

maxruby commented Sep 9, 2014

I did the Pkg update, and then tried both the instructions in the main VideoIO page and the ones from Spencer above. However, I still get a black window with the downloaded IO stream as follows:

julia> VideoIO.playvideo(f)
ERROR: mapinfo has no method matching mapinfo(::Type{Uint32}, ::Image{Uint8,3,SubArray{Uint8,3,Array{Uint8,3},(UnitRange{Int64},UnitRange{Int64},UnitRange{Int64})}})

With the built-in video, I saw this
julia> VideoIO.viewcam()
[AVFoundation input device @ 0x7fa41a27be00] Video device not found
ERROR: Could not open file Integrated

Any thoughts?

@timholy
Copy link
Member

timholy commented Sep 9, 2014

If you're using recent versions of both VideoIO and Images, I don't understand why the image is a 3d Uint8 image rather than a 2d RGB{Ufixed8} image. Can you provide a complete example, starting from the very beginning?

@maxruby
Copy link
Contributor

maxruby commented Sep 10, 2014

Thanks for checking this out. I did not use my images or anything with 3d as far as I know. I used the following example straight from thee VideoIO GitHub page:

import ImageView
import VideoIO 

f = VideoIO.testvideo("annie_oakley")  # downloaded if not available 
VideoIO.playvideo(f)  # no sound

Aternatively, you can just open the camera

#VideoIO.viewcam()

I obtained the errors I posted already in the messages above.
Is the "annie_oakley" example a Unit 8 3d video?
Should I play around with other images and try other sources of video?
What about the VideoIO.viewcam() command? What can I do to that working?

@maxruby
Copy link
Contributor

maxruby commented Sep 10, 2014

Since the last Pkg.update(), I obtained a Warning when I typed "using ImageView" at the Julia prompt.
Is this warning something to be concerned about or related to the problems with VideoIO?

    Warning: New definition 
    reinterpret(Type{T<:Union(FloatingPoint,FixedPoint)},AbstractArray{CV<:Union(ColorValue{T},
    AbstractAlphaColorValue{C<:ColorValue{T},T<:Real}),N}) 
    at /Users/maximilianosuster/.julia/v0.3/Images/src/core.jl:128 is ambiguous with: 
    reinterpret(Type{T},SparseMatrixCSC{Tv,Ti}) at sparse/sparsematrix.jl:52.

    To fix, define 
    reinterpret(Type{_<:Union(FloatingPoint,FixedPoint)},SparseMatrixCSC{_<:Union(ColorValue{T},
    AbstractAlphaColorValue{C<:ColorValue{T},T<:Real}),Ti}) before the new definition.
    Warning: New definition reinterpret(Type{CV<:Union(ColorValue{T},AbstractAlphaColorValue
    {C<:ColorValue{T},T<:Real})},AbstractArray{T<:Union(FloatingPoint,FixedPoint),N}) at 
    /Users/maximilianosuster/.julia/v0.3/Images/src/core.jl:147 is ambiguous with: 
    reinterpret(Type{T},SparseMatrixCSC{Tv,Ti}) at sparse/sparsematrix.jl:52.

    To fix, define 
    reinterpret(Type{_<:Union(ColorValue{T},AbstractAlphaColorValue{C<:ColorValue{T},T<:Real})},
    SparseMatrixCSC{_<:Union(FloatingPoint,FixedPoint),Ti}) before the new definition.

@timholy
Copy link
Member

timholy commented Sep 10, 2014

The 3d in my comment was because of Image{Uint8,3, .... This means the element type was Uint8 and the array was 3d. In older versions, one dimension of the array is for rgb color (like in Matlab, an m-by-n-by-3 array). In more recent versions, it should likely be Image{RGB{Ufixed8}, 2, ..., meaning a 2d array of RGB objects (which represent color without adding a dimension to the array, which allows many image-processing algorithms to not have to worry about the distinction between a grayscale and color image).

So basically if you're running a recent version of the package I don't understand how you could possibly be getting that error. (The example works for me.) I also don't get the same ambiguity warning you do, although julia's ambiguity warnings are occasionally flaky.

So, let's ask: what does versioninfo() say? What does Pkg.status() say?

@maxruby
Copy link
Contributor

maxruby commented Sep 10, 2014

julia> versioninfo()
Julia Version 0.3.0
Commit 7681878* (2014-08-20 20:43 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.3.0)
CPU: Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
LAPACK: libopenblas
LIBM: libopenlibm
LLVM: libLLVM-3.3

julia> Pkg.status()

12 required packages:

  • DataFrames 0.5.7
  • Gadfly 0.3.7
  • HDF5 0.4.1
  • IJulia 0.1.15
  • ImageView 0.1.3
  • Images 0.4.3 master
  • OpenCL 0.3.0
  • OpenGL 2.0.3
  • PyPlot 1.3.3
  • VideoIO 0.0.3
  • Winston 0.11.4
  • ZMQ 0.1.13
    41 additional packages:
    • ArrayViews 0.4.6
  • BinDeps 0.3.5
  • Cairo 0.2.17
  • Cartesian 0.3.0
  • Codecs 0.1.2
  • Color 0.3.7
  • Compose 0.3.7
  • Contour 0.0.4
  • DataArrays 0.2.0
  • DataStructures 0.3.2
  • Datetime 0.1.7
  • Distances 0.1.1
  • Distributions 0.5.4
  • FixedPointNumbers 0.0.4
  • GZip 0.2.13
  • GetC 1.1.1
  • HTTPClient 0.1.4
  • Hexagons 0.0.2
  • Homebrew 0.1.10
  • ImmutableArrays 0.0.6
  • IniFile 0.2.3
  • Iterators 0.1.6
  • JSON 0.3.7
  • KernelDensity 0.0.2
  • LibCURL 0.1.4
  • Loess 0.0.3
  • Nettle 0.1.6
  • PDMats 0.2.4
  • Plotly 0.0.0- master (unregistered)
  • PyCall 0.4.8
  • REPLCompletions 0.0.3
  • Reexport 0.0.1
  • SHA 0.0.3
  • SIUnits 0.0.2
  • SortingAlgorithms 0.0.1
  • StatsBase 0.6.4
  • TexExtensions 0.0.1
  • Tk 0.2.13
  • URIParser 0.0.2
  • ZipFile 0.2.2
  • Zlib 0.1.7

@kmsquire
Copy link
Collaborator

Somehow you ended up on te master branch of Images, which in your repo is
set at v0.3.4, which is preventing VideoIO from being updated to the latest
version. Try

Pkg.release("Images")
Pkg.update()

On Wednesday, September 10, 2014, Maximiliano Suster <
notifications@github.com> wrote:

julia> versioninfo()
Julia Version 0.3.0
Commit 7681878* (2014-08-20 20:43 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.3.0)
CPU: Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
LAPACK: libopenblas
LIBM: libopenlibm
LLVM: libLLVM-3.3

julia> Pkg.status()

12 required packages:

  • DataFrames 0.5.7
  • Gadfly 0.3.7
  • HDF5 0.4.1
  • IJulia 0.1.15
  • ImageView 0.1.3
  • Images 0.4.3 master
  • OpenCL 0.3.0
  • OpenGL 2.0.3
  • PyPlot 1.3.3
  • VideoIO 0.0.3
  • Winston 0.11.4
  • ZMQ 0.1.13 41 additional packages:
    • ArrayViews 0.4.6
      • BinDeps 0.3.5
  • Cairo 0.2.17
  • Cartesian 0.3.0
  • Codecs 0.1.2
  • Color 0.3.7
  • Compose 0.3.7
  • Contour 0.0.4
  • DataArrays 0.2.0
  • DataStructures 0.3.2
  • Datetime 0.1.7
  • Distances 0.1.1
  • Distributions 0.5.4
  • FixedPointNumbers 0.0.4
  • GZip 0.2.13
  • GetC 1.1.1
  • HTTPClient 0.1.4
  • Hexagons 0.0.2
  • Homebrew 0.1.10
  • ImmutableArrays 0.0.6
  • IniFile 0.2.3
  • Iterators 0.1.6
  • JSON 0.3.7
  • KernelDensity 0.0.2
  • LibCURL 0.1.4
  • Loess 0.0.3
  • Nettle 0.1.6
  • PDMats 0.2.4
  • Plotly 0.0.0- master (unregistered)
  • PyCall 0.4.8
  • REPLCompletions 0.0.3
  • Reexport 0.0.1
  • SHA 0.0.3
  • SIUnits 0.0.2
  • SortingAlgorithms 0.0.1
  • StatsBase 0.6.4
  • TexExtensions 0.0.1
  • Tk 0.2.13
  • URIParser 0.0.2
  • ZipFile 0.2.2
  • Zlib 0.1.7


Reply to this email directly or view it on GitHub
#31 (comment).

@maxruby
Copy link
Contributor

maxruby commented Sep 10, 2014

Fantastic, at least I got to see the movie now! However, it was not all smooth as a number of errors appeared in the shell and also a warning widget. Could these errors be related to resizing the window frame during the viewing? Here is the shell output during the movie:

julia> VideoIO.playvideo(f)  # no sound
error during Tk callback:
                    ERROR: BoundsError()
in getindex at range.jl:269
in _reslice! at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:167
in panvert at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:633
in anonymous at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:450
in jl_tcl_callback at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:145
in tcl_doevent at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:20 (repeats 2 times)
in _uv_hook_asynccb at stream.jl:489
in process_events at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in wait at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)
in stream_wait at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in sleep at stream.jl:520
in play at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:646
in playvideo at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:652
error during Tk callback:
                    ERROR: BoundsError()
in getindex at range.jl:269
in _reslice! at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:167
in panvert at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:633
in anonymous at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:450
in jl_tcl_callback at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:145
in tcl_doevent at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:20
in reveal at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:263
in redraw at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:500
in resize at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:513
in anonymous at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:439
in configure at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:246
in view at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:347
in play at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:645
in playvideo at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:652

signal (11): Segmentation fault: 11
render_to_cairo at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:279
reveal at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:256
configure at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:246
view at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:347
julia_view;22544 at  (unknown line)
play at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:645
jlcall_play;22222 at  (unknown line)
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/gf.c:1416
playvideo at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:652
jlcall_playvideo;22154 at  (unknown line)
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/gf.c:1416
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/interpreter.c:59
eval at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/interpreter.c:207
jl_toplevel_eval_flex at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-  
0.3/src/toplevel.c:494
jl_f_top_eval at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/builtins.c:396
eval_user_input at REPL.jl:54
jlcall_eval_user_input;19869 at  (unknown line)
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/./julia.h:980
anonymous at task.jl:96
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/task.c:427
julia_trampoline at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/init.c:1007

@kmsquire
Copy link
Collaborator

Yes, some of those errors are definitely from resizing Tk. The crash is
quite likely because of VideoIO, though. I think there are a few more
library calls which need to have interrupts explicitly turned off (Julia
doesn't do that by default). I haven't had time to explore, though.

On Wed, Sep 10, 2014 at 10:37 AM, Maximiliano Suster <
notifications@github.com> wrote:

Fantastic, at least I got to see the movie now! However, it was not all
smooth as a number of errors appeared in the shell and also a warning
widget. Could these errors be related to resizing the window frame during
the viewing? Here is the shell output during the movie:

julia> VideoIO.playvideo(f) # no sound
error during Tk callback:
ERROR: BoundsError()
in getindex at range.jl:269
in _reslice! at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:167
in panvert at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:633
in anonymous at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:450
in jl_tcl_callback at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:145
in tcl_doevent at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:20 (repeats 2 times)
in _uv_hook_asynccb at stream.jl:489
in process_events at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in wait at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib (repeats 2 times)
in stream_wait at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in sleep at stream.jl:520
in play at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:646
in playvideo at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:652
error during Tk callback:
ERROR: BoundsError()
in getindex at range.jl:269
in _reslice! at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:167
in panvert at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:633
in anonymous at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:450
in jl_tcl_callback at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:145
in tcl_doevent at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:20
in reveal at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:263
in redraw at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:500
in resize at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:513
in anonymous at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:439
in configure at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:246
in view at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:347
in play at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:645
in playvideo at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:652

signal (11): Segmentation fault: 11
render_to_cairo at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:279
reveal at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:256
configure at /Users/maximilianosuster/.julia/v0.3/Tk/src/tkwidget.jl:246
view at /Users/maximilianosuster/.julia/v0.3/ImageView/src/display.jl:347
julia_view;22544 at (unknown line)
play at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:645
jlcall_play;22222 at (unknown line)
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/gf.c:1416
playvideo at /Users/maximilianosuster/.julia/v0.3/VideoIO/src/avio.jl:652
jlcall_playvideo;22154 at (unknown line)
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/gf.c:1416
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/interpreter.c:59
eval at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/interpreter.c:207
jl_toplevel_eval_flex at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-
0.3/src/toplevel.c:494
jl_f_top_eval at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/builtins.c:396
eval_user_input at REPL.jl:54
jlcall_eval_user_input;19869 at (unknown line)
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/./julia.h:980
anonymous at task.jl:96
jl_apply at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/task.c:427
julia_trampoline at /Users/vagrant/tmp/julia-packaging/osx10.7+/julia-release-0.3/src/init.c:1007


Reply to this email directly or view it on GitHub
#31 (comment).

@timholy
Copy link
Member

timholy commented Sep 10, 2014

Resizing during playback works fine for me, and I don't see such errors. If you
can discover a specific sequence of events that trigger it, that would be very
helpful.

FYI my tk version is 8.6.

@maxruby
Copy link
Contributor

maxruby commented Sep 10, 2014

ok. I will update TK and try again. I don´t think there was a specific sequence of events, just repeated dragging out of the window to get a better look at the movie. Meanwhile, are you aware of any further work towards the OpenCV wrapper which has not been merged with the Git repo yet? I checked the files in the Git repo, but this is still very early days . . .

@timholy
Copy link
Member

timholy commented Sep 10, 2014

It's not my repo, and I'm not working on it (I'm going to focus my efforts on Images), so I have no idea about what hasn't been committed. For the latest you can just look for commits to that repository. Better yet, make some commits yourself 😄.

@maxruby
Copy link
Contributor

maxruby commented Sep 10, 2014

Sure, the idea is to start working on this! However, before I embark on completely new terrain with Julia image processing/analysis, I would much prefer to know what has been done, who else is working on this and whether there is much else in the pipeline. I noticed that Alexander Sun was the one working on this (GSoC 2014 project) but I have not received any reply from him yet about the repo (even though something presumably was updated 3 days ago). Anyway, I am looking into what I may be able realistically to contribute towards the wrapper - would be nice.

@kmsquire
Copy link
Collaborator

@ssfrr, I've committed #21 (and a few other changes/fixes) which might help this issue. Can you run Pkg.update() and let us know the status?

@maxruby, the segfault that you saw should hopefully be fixed by JuliaGraphics/Tk.jl#81. Can you also update and try again? Note that the warnings when resizing or doing other window manipulations might still be there--at least, I still see them occasionally.

@maxruby
Copy link
Contributor

maxruby commented Sep 14, 2014

Lots of errors after doing Pkg.update() on my MacOSX upon your request (everything seem to be working before this update, except for VideoIO not accessing ffmpeg DEFAULT_CAMERA_DEVICE)

using VideoIO.viewcam(), I get "ERROR: viewcam not defined"
using VideoIO.playvideo(f) from "annie_oakley", I get ERROR: "ERROR: playvideo not defined"

When I checked Pkg.status(), I got (other
- ImageView 0.1.4
- VideoIO 0.0.5
- GLAbstraction 0.0.0- master (unregistered)
- GLFW 1.0.0-alpha.3
- GLPlot 0.0.0- master (unregistered)
- GLText 0.0.0- master (unregistered)
- GLWindow 0.0.0- master (unregistered)

I ran Simon Danish´s code that uses VideoIo, GLPlot, React and GLAbstraction. This worked before updating so something has happened with the update.

import VideoIO 
using GLPlot, React, GLAbstraction

#VideoIO.DEFAULT_CAMERA_DEVICE

device = "Innebygd iSight"
format = VideoIO.DEFAULT_CAMERA_FORMAT
camera = VideoIO.opencamera(device, format)
img = VideoIO.read(camera)

Just for fun, lets apply a laplace filter:

kernel = [-1 -1 -1;
-1 8 -1;
-1 -1 -1]

#async=true, for REPL use. Then you don't have to call renderloop(window)
window = createdisplay(#=async=true =#)
img = glplot(Texture(img, 3), kernel=kernel, filternorm=0.1f0)

#Get Gpu memory object
glimg = img.uniforms[:image]

#Asynchronous updating with React:
lift(Timing.fpswhen(window.inputs[:open], 30.0)) do x
newframe = VideoIO.read(camera)
update!(glimg, mapslices(reverse, newframe, 3)) # needs to be mirrored :(
end

renderloop(window)

I will try again updating and rechecking all the packages but if you have any ideas why this is happening, please let me know.

@ssfrr
Copy link
Author

ssfrr commented Sep 14, 2014

Hmm, I'm still seeing the same behavior as the top post (upside-down image and "Selected pixel format" warnings.

@kmsquire
Copy link
Collaborator

@maxruby, try running import ImageView before using VideoIO. Since some people don't want the dependency on Images brought in, it has to be done explicitly. (Need to give much better errors for this...)

@kmsquire
Copy link
Collaborator

@ssfrr, Hmmm.. @staticfloat saw the same thing here, but found that it worked after that.

Just to check, can you give the output of VideoIO.versioninfo(), and verify the version of VideoIO you have installed?

At any rate, we probably need to be querying the supported formats anyway. This depends on #27, so I'll try to work on that next.

@kmsquire
Copy link
Collaborator

I just pushed a small change which will give a more informative error message when the user doesn't load ImageView first.

@maxruby
Copy link
Contributor

maxruby commented Sep 14, 2014

OK. I included both import VideoIO and ImageView and I still had trouble.
The iSight window did come up but after a while trying hard to show something, it failed with an error.

julia> include("/Users/maximilianosuster/RubymineProjects/daily_programmer/Julia/webcam.jl")
INFO: loaded GLFW 3.0.4 Cocoa NSGL chdir menubar dynamic from /Users/maximilianosuster/.julia/v0.3/GLFW/deps/usr64/lib/libglfw
Warning: Method definition filter(Function,Any,Any) in module Reactive at /Users/maximilianosuster/.julia/v0.3/Reactive/src/Reactive.jl:331 overwritten in module React at /Users/maximilianosuster/.julia/v0.3/React/src/React.jl:331.
Warning: New definition
merge(Signal{T}...,) at /Users/maximilianosuster/.julia/v0.3/React/src/React.jl:362
is ambiguous with:
merge(Signal{T}...,) at /Users/maximilianosuster/.julia/v0.3/Reactive/src/Reactive.jl:362.
To fix, define
merge()
before the new definition.
Warning: Method definition merge(Any,) in module Reactive at /Users/maximilianosuster/.julia/v0.3/Reactive/src/Reactive.jl:363 overwritten in module React at /Users/maximilianosuster/.julia/v0.3/React/src/React.jl:363.
[avfoundation @ 0x7fcb1563c200] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7fcb1563c200] Supported pixel formats:
[avfoundation @ 0x7fcb1563c200] uyvy422
[avfoundation @ 0x7fcb1563c200] yuyv422
[avfoundation @ 0x7fcb1563c200] nv12
[avfoundation @ 0x7fcb1563c200] 0rgb
[avfoundation @ 0x7fcb1563c200] bgr0
ERROR: fpswhen has no method matching fpswhen(::Input{Bool}, ::Float64)
in include at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include_from_node1 at /Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
while load

@kmsquire
Copy link
Collaborator

React.jl was renamed to Reactive.jl, and it looks like you have both on
your system right now. Try uninstalling React.jl.

So that we don't diverge too much more from the original report here, if
you have further problems, can you open up a new Issue?

On Sun, Sep 14, 2014 at 9:38 AM, Maximiliano Suster <
notifications@github.com> wrote:

OK. I included both import VideoIO and ImageView and I still had trouble.
The iSight window did come up but after a while trying hard to show
something, it failed with an error.

julia>
include("/Users/maximilianosuster/RubymineProjects/daily_programmer/Julia/webcam.jl")
INFO: loaded GLFW 3.0.4 Cocoa NSGL chdir menubar dynamic from
/Users/maximilianosuster/.julia/v0.3/GLFW/deps/usr64/lib/libglfw
Warning: Method definition filter(Function,Any,Any) in module Reactive at
/Users/maximilianosuster/.julia/v0.3/Reactive/src/Reactive.jl:331
overwritten in module React at
/Users/maximilianosuster/.julia/v0.3/React/src/React.jl:331.
Warning: New definition
merge(Signal{T}...,) at
/Users/maximilianosuster/.julia/v0.3/React/src/React.jl:362
is ambiguous with:
merge(Signal{T}...,) at
/Users/maximilianosuster/.julia/v0.3/Reactive/src/Reactive.jl:362.
To fix, define
merge()
before the new definition.
Warning: Method definition merge(Any,) in module Reactive at
/Users/maximilianosuster/.julia/v0.3/Reactive/src/Reactive.jl:363
overwritten in module React at
/Users/maximilianosuster/.julia/v0.3/React/src/React.jl:363.
[avfoundation @ 0x7fcb1563c200] Selected pixel format (yuv420p) is not
supported by the input device.
[avfoundation @ 0x7fcb1563c200] Supported pixel formats:
[avfoundation @ 0x7fcb1563c200] uyvy422
[avfoundation @ 0x7fcb1563c200] yuyv422
[avfoundation @ 0x7fcb1563c200] nv12
[avfoundation @ 0x7fcb1563c200] 0rgb
[avfoundation @ 0x7fcb1563c200] bgr0
ERROR: fpswhen has no method matching fpswhen(::Input{Bool}, ::Float64)
in include at
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include_from_node1 at
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
while load


Reply to this email directly or view it on GitHub
#31 (comment).

@ssfrr
Copy link
Author

ssfrr commented Sep 15, 2014

julia> VideoIO.versioninfo()
Using ffmpeg
AVCodecs version 55.69.100
AVFormat version 55.48.100
AVUtil version 52.92.100
SWScale version 2.6.100
AVDevice version 55.13.102
AVFilters version 4.11.100

@kmsquire
Copy link
Collaborator

Thanks. And this is defintely VideoIO v0.0.5 or later?

@ssfrr
Copy link
Author

ssfrr commented Sep 15, 2014

Yep, Pkg.status() shows 0.0.5, and git shows me to be on commit 5d4ac37

@ssfrr
Copy link
Author

ssfrr commented Sep 15, 2014

and ImageView is 0.1.4, if that matters.

@kmsquire
Copy link
Collaborator

Alright, I should have looked closer: the upside down image was actually caused by that merge!

I just updated VideoIO. You'll probably still get the warnings (let me know), but the flipped image should be fixed.

@kmsquire
Copy link
Collaborator

To be clearer: can you update with Pkg.update() and test again? :-)

@kmsquire
Copy link
Collaborator

Bump. @ssfr, is this still an issue?

@ssfrr
Copy link
Author

ssfrr commented Sep 23, 2014

Whoops, sorry for losing track of this. I just ran Pkg.update(), and as you predicted, I still see the warnings but the image is now right-side-up.

@maxruby
Copy link
Contributor

maxruby commented Sep 23, 2014

Perhaps I can help with this? For me, VideoIO is working fine. Maybe there is something about the setup of the camera with VideoIO?

@maxruby
Copy link
Contributor

maxruby commented Sep 23, 2014

Sorry I reread @ssfrr - I guess its all fine.

@kmsquire kmsquire changed the title Warnings and upside-down image on OSX camera Warnings on OSX camera Sep 23, 2014
@kmsquire kmsquire changed the title Warnings on OSX camera Get available pixel formats for camera device Sep 23, 2014
@kmsquire
Copy link
Collaborator

Okay, thanks! I reworded the title to better reflect the remaining issue. As I mentioned previously, that depends on #27.

@kmsquire
Copy link
Collaborator

This particular issue seems to have been fixed, although there are related issues (e.g., #148)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants