Comments (9)
I also use Windows (Windows 11), and I have obtained the dependencies on Windows described here: https://reanimate.readthedocs.io/en/latest/; and I have C:\Program Files\Blender Foundation\Blender 2.93\blender.exe
on my PATH
.
If I enter at the PowerShell prompt:
> stack ./examples/blender_default_cube.hs render --compile -w 320
then, eventually, I get the output:
Animation options:
fps: 60
width: 320
height: 180
fmt: mp4
target: output.mp4
raster: RasterRSvg
Starting render of animation: 5.0
Frames generated: 300/300, time spent: 23:11
Frames rastered: 300/300, time spent: 48s
Frames rendered: 300/300, time spent: 1s
If I then use the command:
> start output.mp4
the 'Films & TV' app opens the .mp4
file and plays it. I don't know why your experience is different from mine.
from reanimate.
However, I then tried:
❯ stack ./examples/blender_default_cube.hs render --compile -w 320 --raster imagemagick
Animation options:
fps: 60
width: 320
height: 180
fmt: mp4
target: output.mp4
raster: RasterMagick
Starting render of animation: 5.0
Frames generated: 300/300, time spent: 5s
Frames rastered: 300/300, time spent: 07:27
Frames rendered: 300/300, time spent: 1s
and the command:
> start output.mp4
plays an 5 second clip with the text 'default cube' but no spinning cube.
from reanimate.
Returning to the rsvg
raster brings back the spinning cube:
Animation options:
fps: 60
width: 320
height: 180
fmt: mp4
target: output.mp4
raster: RasterRSvg
Starting render of animation: 5.0
Frames generated: 300/300, time spent: 5s
Frames rastered: 300/300, time spent: 44s
Frames rendered: 300/300, time spent: 1s
So, perhaps it is an issue with ImageMagick
? I have:
❯ stack exec -- magick --version
Version: ImageMagick 7.0.10-11 Q16 x86_64 2021-07-24 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5)
Delegates (built-in): bzlib cairo djvu fftw flif fontconfig freetype gslib gvc heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf xml zlib
from reanimate.
I also use Windows (Windows 11), and I have obtained the dependencies on Windows described here: https://reanimate.readthedocs.io/en/latest/; and I have
C:\Program Files\Blender Foundation\Blender 2.93\blender.exe
on myPATH
.If I enter at the PowerShell prompt:
> stack ./examples/blender_default_cube.hs render --compile -w 320
then, eventually, I get the output:
Animation options: fps: 60 width: 320 height: 180 fmt: mp4 target: output.mp4 raster: RasterRSvg Starting render of animation: 5.0 Frames generated: 300/300, time spent: 23:11 Frames rastered: 300/300, time spent: 48s Frames rendered: 300/300, time spent: 1s
If I then use the command:
> start output.mp4
the 'Films & TV' app opens the
.mp4
file and plays it. I don't know why your experience is different from mine.
Could you please tell me how to install rsvg on windows? I cannot find a solution.
from reanimate.
The easiest way to get rsvg-convert.exe
on Windows, I think, is via MSYS2
and its package manager (pacman
); and stack
comes with MSYS2
. stack exec
adds the relevant MSYS2
bin
folder to its environment. rsvg-convert.exe
is part of MSYS2 package mingw-w64-x86_64-librsvg
(see here: https://packages.msys2.org/package/mingw-w64-x86_64-librsvg). So, to get it (if you have stack
):
> stack exec -- pacman --sync --refresh
> stack exec -- pacman --sync mingw64/mingw-w64-x86_64-librsvg
and to check that it is, indeed, on the PATH
in the stack exec
environment:
> stack exec -- where.exe rsvg-convert
C:\Users\mike\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\bin\rsvg-convert.exe
> stack exec -- rsvg-convert --version
rsvg-convert version 2.52.3
from reanimate.
The easiest way to get
rsvg-convert.exe
on Windows, I think, is viaMSYS2
and its package manager (pacman
); andstack
comes withMSYS2
.stack exec
adds the relevantMSYS2
bin
folder to its environment.rsvg-convert.exe
is part of MSYS2 packagemingw-w64-x86_64-librsvg
(see here: https://packages.msys2.org/package/mingw-w64-x86_64-librsvg). So, to get it (if you havestack
):> stack exec -- pacman --sync --refresh > stack exec -- pacman --sync mingw64/mingw-w64-x86_64-librsvg
and to check that it is, indeed, on the
PATH
in thestack exec
environment:> stack exec -- where.exe rsvg-convert C:\Users\mike\AppData\Local\Programs\stack\x86_64-windows\msys2-20210604\mingw64\bin\rsvg-convert.exe > stack exec -- rsvg-convert --version rsvg-convert version 2.52.3
It finally works. I think the Inkscape and imagemagick do not work properly on windows. This should be clarified in the documentation.
from reanimate.
Reanimate.Blender.blender
uses Reanimate.Raster.mkImage
, which warns in its Haddock documentation: "For security reasons, most SVG renderer do not allow arbitrary image links. For some renderers, we can get around this ..." I'll investigate of that is the root of the problem.
from reanimate.
A simple test (below) suggests that is is mkImage
that is the problem, with the raster engines ImageMagick (no render of image) or Inkscape (image replaced by the app's 'linked image not found' warning). I am going to see if the same thing happens on macOS.
module Main where
import Reanimate
import Paths_raTest -- package raTest
main :: IO ()
main = do
image <- loadImage
reanimate $ staticFrame 1.0 image
loadImage :: IO SVG
loadImage = do
imagePath <- getDataFileName "Red_Apple.png"
pure $ mkImage 8.0 8.0 imagePath
from reanimate.
I have found the problem. Reanimate.Raster.mkImage
uses "file://"
, when a valid file URI starts file:///
. That works on Unix-like operating systems, because paths already start with /
, but not on Windows where absolute paths start (for example) C:\
. I'll propose a pull request to fix.
from reanimate.
Related Issues (20)
- reanimateLiveEntry only shows animation with given name once, then switches to "main" animation HOT 4
- "Color" values that are a string should probably allow things like hex values. HOT 1
- Reanimate won't compile on MacOS Big Sur HOT 2
- How do I use a non-default browser HOT 3
- Wrong default latex svg behavior HOT 4
- Live viewer stopped working, saying 'Failed to establish connection', due to port being hogged
- Feature Request: rendering without optparse HOT 2
- Different animations in browser and rendered when using scaleXY HOT 4
- More graphs? HOT 7
- Avoiding 'empty' Animations, with non-positive durations HOT 1
- Animating Diagrams HOT 2
- Animate from SVG files HOT 2
- getting start fail to compile hgeometry-0.13
- Feature request: Embed video
- 3D vector animations HOT 1
- Breakage due to missing dependency bounds HOT 3
- Build error caused by missing `Eq a => Eq (APolygon a)` instance. HOT 2
- Relax aeson bounds. HOT 2
- Simplifier ticks exhausted (GHC 9.2.5) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reanimate.