shashi / reel.jl Goto Github PK
View Code? Open in Web Editor NEWcomputations caught on camera
License: Other
computations caught on camera
License: Other
Rather than rely on terminal commands, the ImageMagick package could be used.
Does it work?
Loading Reel in Julia 0.4 throws some warnings related to the deprecation of Uint -> UInt, Nothing -> Void, etc.
WARNING: Base.Uint is deprecated, use UInt instead.
likely near /home/tim/.julia/v0.4/Reel/src/Reel.jl:14
WARNING: Base.Nothing is deprecated, use Void instead.
likely near /home/tim/.julia/v0.4/Reel/src/Reel.jl:14
WARNING: Union(args...) is deprecated, use Union{args...} instead.
Is it possible to update the package and then throw in Compat.jl for backwards compatibility? I can take a stab at it and submit a PR if you prefer.
It seems that when roll is called, t is 0.0 for the first two steps rather than just the first step. Is this the intended behavior for some reason? Making a PR to correct it now.
Right now roll
seems to assume jpg or png. It would be nice if the Mime type could be specified.
Transparency becomes black in videos.
One way to solve this is to use IM convert
on push!
to flatten the png. But a better way would of course be some mysterious command-line flag in ffmpeg
which does this.
When running the example from the README the colors are distorted:
most likely related to:
https://stackoverflow.com/questions/58832085/colors-messed-up-distorted-when-making-a-gif-from-png-files-using-ffmpeg
I get the above message while testing Reel
as per this commit - https://github.com/Shushman/Reel.jl/tree/dd46ffc03a88531c8c511a817a6cb441b443d178
Does Reel
need ImageMagick
? I see #15 has something to say about that - is it related?
Is it possible to roll from a generator?
In my case, creating a instance of array is time-consuming.
e.g.
roll((plot(i) for i in huge_dataset), fps=24)
This should be easy to fix:
WARNING: deprecated syntax "inner constructor Frames(...) around C:\Users\Mykel\.julia\v0.6\Reel\src\Reel.jl:22".
Hey @tawheeler could you release a new version for 1.0?
@shashi - I'd like to set up Travis similar to this. The problem is that the package is under shashi/Reel, so I cannot enable testing for it on Travis. I believe it is free. Any chance you could set that up?
You need to:
Anyone pushing to Reel.jl that should automatically trigger a new Travis build.
While trying to follow along with this example given in README.md
, I get an error, as described towards the end.
Platform:
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
Julia:
Version 1.5.0
Packages:
FFMPEG v0.3.0
Gadfly v1.3.0
Reel v1.3.0
$ fmpeg -version
:
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Error:
julia> using Reel, Gadfly
julia> function render(t, dt)
plot([x -> sin(x+t*π), x -> cos(x+t*π)], 0, 6)
end
render (generic function with 1 method)
julia> film = roll(render, fps=30, duration=2)
Frames{MIME{Symbol("text/html")}}("/tmp/jl_4MxfPR", 0x000000000000003c, 30.0, nothing)
julia> write("output0.gif", film)
Decoder (codec none) not found for input stream #0:0
ERROR: failed process: Process(`/home/sid/.julia/artifacts/7f40eeb66d90d3026ae5fb68761c263b57adb840/bin/ffmpeg -y -r 30.0 -f image$
-i /tmp/jl_4MxfPR/%d.html output0.gif -loglevel error`, ProcessExited(1)) [1]
Stacktrace:
[1] pipeline_error at ./process.jl:525 [inlined]
[2] run(::Cmd; wait::Bool) at ./process.jl:440
[3] run at ./process.jl:438 [inlined]
[4] (::FFMPEG.var"#4#6"{Cmd})(::String) at /home/sid/.julia/packages/FFMPEG/vocw2/src/FFMPEG.jl:114
[5] (::FFMPEG_jll.var"#8#9"{FFMPEG.var"#4#6"{Cmd}})() at /home/sid/.julia/packages/FFMPEG_jll/w0b7h/src/wrappers/x86_64-linux-gnu.
jl:49
[6] withenv(::FFMPEG_jll.var"#8#9"{FFMPEG.var"#4#6"{Cmd}}, ::Pair{String,String}, ::Vararg{Pair{String,String},N} where N) at ./en
v.jl:161
[7] ffmpeg(::FFMPEG.var"#4#6"{Cmd}; adjust_PATH::Bool, adjust_LIBPATH::Bool) at /home/sid/.julia/packages/FFMPEG_jll/w0b7h/src/wra
ppers/x86_64-linux-gnu.jl:48
[8] ffmpeg at /home/sid/.julia/packages/FFMPEG_jll/w0b7h/src/wrappers/x86_64-linux-gnu.jl:31 [inlined]
[9] #exe#2 at /home/sid/.julia/packages/FFMPEG/vocw2/src/FFMPEG.jl:113 [inlined]
[10] ffmpeg_exe at /home/sid/.julia/packages/FFMPEG/vocw2/src/FFMPEG.jl:125 [inlined]
[11] #write#6 at /home/sid/.julia/packages/Reel/Mu9ck/src/Reel.jl:68 [inlined]
[12] write(::String, ::Frames{MIME{Symbol("text/html")}}) at /home/sid/.julia/packages/Reel/Mu9ck/src/Reel.jl:66
[13] top-level scope at REPL[8]:1
Thanks for the great work on Reel.jl.
On Windows 8.1 Reel does not work because tempname
already creates a temporary file, and the subsequent mkdir
call in Reel.jl line 21 fails.
The fix is to use the mktempdir
call instead, i.e. replace
type Frames{M <: MIME}
tmpdir::AbstractString
length::Uint
fps::Float64
rendered::Union(Nothing, AbstractString)
function Frames(; fps=30)
tmpdir = tempname()
mkdir(tmpdir)
new(tmpdir, 0, fps, nothing)
end
end
with
type Frames{M <: MIME}
tmpdir::AbstractString
length::Uint
fps::Float64
rendered::Union(Nothing, AbstractString)
function Frames(; fps=30)
tmpdir = mktempdir()
new(tmpdir, 0, fps, nothing)
end
end
Also, it would be great if the Reel.jl test case could check for the presence of ffmpeg, or even better, would bring it's own ffmpeg installation.
This doesn't seem to work on Windows (currently starting at line 71 of src/Reel.jl):
cmd = try readstring(`which convert`)
catch e1
try readstring(`which magick`)
catch e2
error("Could not find imagemagick binary. Is it installed?")
end
end |> strip
The command which
is not supported. We end up getting this error:
Could not find imagemagick binary. Is it installed?
when it is actually installed.
It would be nice to support multi-threaded rendering. Candidates for Threads.@spawn
may be the render(t, dt)
call in roll
and (perhaps even more importantly) the call to writeframe
. This might require some more restructuring since the push!(frames,...)
design requires things to be rather sequential.
Looks like Reel has quite a few updates that aren't in the first v0.1.0 release.
Would it be possible to tag a new one?
tikzref
is a nice way to refer to the shown lines by legend entry (cf. this SO answer).
Would be nice if PGFPlots would add labels to the plots with e.g. pgfplots:<label>
automatically.
The 'convert' command of imagemagick has been replaced by magick
in the latest version. It needs to be replaced if you want to export in gif.
I get the error
LoadError: MethodError: extension
has no method matching extension(::MIME{symbol("text/html")})
while loading In[3], in expression starting on line 1
in push! at /Users/solver/.julia/v0.4/Reel/src/Reel.jl:40
in roll at /Users/solver/.julia/v0.4/Reel/src/Reel.jl:93
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.