Code Monkey home page Code Monkey logo

Comments (9)

mpilgrem avatar mpilgrem commented on June 10, 2024

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.

mpilgrem avatar mpilgrem commented on June 10, 2024

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.

mpilgrem avatar mpilgrem commented on June 10, 2024

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.

pdcxs avatar pdcxs commented on June 10, 2024

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.

Could you please tell me how to install rsvg on windows? I cannot find a solution. 😂

from reanimate.

mpilgrem avatar mpilgrem commented on June 10, 2024

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.

pdcxs avatar pdcxs commented on June 10, 2024

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

It finally works. I think the Inkscape and imagemagick do not work properly on windows. This should be clarified in the documentation.

from reanimate.

mpilgrem avatar mpilgrem commented on June 10, 2024

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.

mpilgrem avatar mpilgrem commented on June 10, 2024

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.

mpilgrem avatar mpilgrem commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.