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

Reading image from stream #10

Open
yakir12 opened this issue Sep 2, 2020 · 3 comments
Open

Reading image from stream #10

yakir12 opened this issue Sep 2, 2020 · 3 comments

Comments

@yakir12
Copy link

yakir12 commented Sep 2, 2020

I'm having a hard time figuring out how to read an image from a stream:

using FFMPEG_jll, ImageIO
x = ffmpeg() do exe
    open(`$exe -loglevel 8 -ss 0 -i file.mov -vframes 1 -f image2pipe -`)
end
ImageIO.load(x)

I'm getting

ERROR: MethodError: no method matching lock

but not sure if it's because I'm using the wrong syntax?

@IanButterworth
Copy link
Member

IanButterworth commented Sep 2, 2020

Can you share the full stack trace, and the versions of ImageIO and PNGFiles

@yakir12
Copy link
Author

yakir12 commented Sep 2, 2020

Yes, of course, sorry:

julia> ImageIO.load(x)
ERROR: MethodError: no method matching lock(::PNGFiles.var"#4#5"{Nothing,Bool,Base.Process,Ptr{Nothing},Ptr{Nothing}}, ::Base.Process)
Closest candidates are:
  lock(::Any, ::Base.GenericCondition) at condition.jl:78
  lock(::Any, ::Base.AbstractLock) at lock.jl:158
  lock(::Any, ::WeakKeyDict) at weakkeydict.jl:76
Stacktrace:
 [1] maybe_lock(::Function, ::Base.Process) at /home/yakir/.julia/packages/PNGFiles/Sgsmw/src/io.jl:33
 [2] load(::Base.Process; gamma::Nothing, expand_paletted::Bool) at /home/yakir/.julia/packages/PNGFiles/Sgsmw/src/io.jl:44
 [3] load(::Base.Process) at /home/yakir/.julia/packages/PNGFiles/Sgsmw/src/io.jl:38
 [4] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [5] invokelatest(::Any, ::Any) at ./essentials.jl:709
 [6] load(::Base.Process; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/yakir/.julia/packages/ImageIO/DOpZl/src/ImageIO.jl:27
 [7] load(::Base.Process) at /home/yakir/.julia/packages/ImageIO/DOpZl/src/ImageIO.jl:23
 [8] top-level scope at REPL[8]:1
 [9] run_repl(::REPL.AbstractREPL, ::Any) at /build/julia/src/julia-1.5.0/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288

@IanButterworth
Copy link
Member

@SimonDanisch sorry to bother you again with this, but JuliaIO/PNGFiles.jl#19 didn't quite fix it.
I haven't got my head around these stream setups yet, so don't see a fix without spending more time on it.

Perhaps we just need to not lock on those anonymous functions.. but I don't see how we could set up the method signatures to avoid that

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

2 participants