Comments (27)
Do you mean that the size of the mp4 file is zero or that it generates a video but each frame is black/white?
from reanimate.
And what's the output of 'ffmpeg -version'? Maybe it was compiled without --enable-librsvg.
from reanimate.
As in zero size. Here's ffmpeg -version
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.2.0 (GCC)
configuration: --disable-static --prefix=/nix/store/s9gj51zibwxylbg0l96m4rfqbsh9mlja-ffmpeg-4.2.2 --arch=x86_64 --target_os=linux --enable-gpl --enable-version3 --enable-shared --enable-pic --enable-runtime-cpudetect --enable-hardcoded-tables --enable-pthreads --disable-w32threads --disable-os2threads --enable-network --enable-pixelutils --enable-ffmpeg --disable-ffplay --enable-ffprobe --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-avutil --enable-postproc --enable-swresample --enable-swscale --disable-doc --enable-bzlib --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libmp3lame --enable-iconv --enable-libtheora --enable-libssh --enable-vaapi --enable-libdrm --enable-vdpau --enable-libvorbis --enable-libvpx --enable-lzma --disable-opengl --disable-libmfx --disable-libaom --enable-libpulse --enable-sdl2 --enable-libsoxr --enable-libx264 --enable-libxvid --enable-zlib --enable-libopus --enable-libspeex --enable-libx265 --enable-libdav1d --disable-debug --enable-optimizations --disable-extra-warnings --disable-stripping
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
from reanimate.
Similarly empty with --format webm, and with --format gif it does not make a file at all.
from reanimate.
Yeah, it looks like your ffmpeg doesn't have svg support. I would have imagined it to throw an error in that case, though. What text output do you see when rendering an animation?
You can use an external rasterizer to convert the SVG images to PNG files. Reanimates supports inkscape, rsvg and imagemagick. See the --raster flag for the render command.
from reanimate.
[nix-shell:~/reanimate/examples]$ runhaskell doc_drawBox.hs render --format mp4
Animation options:
fps: 60
width: 2560
height: 1440
fmt: mp4
target: /home/lc/reanimate/examples/doc_drawBox.mp4
Starting render of animation: 2.0
120/120
from reanimate.
That is quite strange. Apparently ffmpeg silently ignores SVGs if it wasn't compiled with --enable-librsvg. I'll have to add a check for this.
from reanimate.
Hmm it would seem there's also an ffmpeg-full
in nixkpgs, but this too doesn't seem to have libsvg included.
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/ffmpeg-full/default.nix
from reanimate.
Sorry, it turned out I was using an old version of reanimate, this is with the latest.
[nix-shell:~/reanimate/examples]$ runhaskell doc_drawBox.hs render --format mp4
Animation options:
fps: 60
width: 2560
height: 1440
fmt: mp4
target: /home/lc/reanimate/examples/doc_drawBox.mp4
Starting render of animation: 2.0
120/120
doc_drawBox.hs: /nix/store/5kk09z63c6dc5jrm6ygspmq9c90pdw29-ffmpeg-full-4.2.2/bin/ffmpeg -r 60 -i '/run/user/1000/reanimate89676-0/render-%05d.svg' -y '-c:v' libx264 -vf 'fps=60' -preset slow -crf 18 -movflags '+faststart' -progress /run/user/1000/reanimate89676-1.txt -pix_fmt yuv420p /home/lc/reanimate/examples/doc_drawBox.mp4:
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.2.0 (GCC)
configuration: --disable-static --prefix=/nix/store/5kk09z63c6dc5jrm6ygspmq9c90pdw29-ffmpeg-full-4.2.2 --target_os=linux --arch=x86_64 --enable-gpl --enable-version3 --disable-nonfree --enable-shared --enable-pic --disable-small --enable-runtime-cpudetect --disable-lto --enable-gray --enable-swscale-alpha --enable-hardcoded-tables --enable-safe-bitstream-reader --enable-pthreads --disable-w32threads --disable-os2threads --enable-network --enable-pixelutils --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-avutil --enable-postproc --enable-swresample --enable-swscale --enable-doc --disable-htmlpages --enable-manpages --disable-podpages --disable-txtpages --enable-bzlib --enable-libcelt --enable-libdav1d --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-libfribidi --enable-libgme --enable-gnutls --enable-libgsm --enable-ladspa --enable-libmp3lame --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdc1394 --enable-iconv --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmysofa --enable-libopus --enable-libssh --enable-libtheora --enable-libv4l2 --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvmaf --enable-libvpx --enable-libwebp --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-lzma --enable-nvenc --enable-openal --enable-libopencore-amrnb --disable-opengl --enable-libopenjpeg --disable-openssl --enable-libpulse --enable-librtmp --enable-sdl2 --enable-libsoxr --enable-libspeex --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-zlib --disable-debug --enable-optimizations --disable-extra-warnings --disable-stripping
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[image2 @ 0x1c37f40] Could not find codec parameters for stream 0 (Video: svg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, image2, from '/run/user/1000/reanimate89676-0/render-%05d.svg':
Duration: 00:00:04.80, start: 0.000000, bitrate: N/A
Stream #0:0: Video: svg, none, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (? (?) -> h264 (libx264))
Decoder (codec svg) not found for input stream #0:0
CallStack (from HasCallStack):
error, called at src/Reanimate/Misc.hs:33:17 in reanimate-0.2.0.2-DbGYvOMK5eG2wV5gvNF4DQ:Reanimate.Misc
from reanimate.
Will using either inkscape, rsvg or imagemagick (convert) work for you?
from reanimate.
Yes, I managed to get the drawBox example working using --raster convert. So far so good.
I'm having trouble with the blender examples though as below: Maybe I'll open another issue for this.
[nix-shell:~/Source/gitlab.com/shakebook-site/shakebook-site.gitlab.io/site/animations]$ runhaskell tut_glue_blender.hs render
Animation options:
fps: 60
width: 2560
height: 1440
fmt: mp4
target: /home/lc/Source/gitlab.com/shakebook-site/shakebook-site.gitlab.io/site/animations/tut_glue_blender.mp4
Starting render of animation: 60.0
0/3600tut_glue_blender.hs: /run/user/1000/-78348659261649607235792-1.png: renameFile:renamePath:rename: unsupported operation (Invalid cross-device link)
from reanimate.
I pushed a fix for the issue with 'renameFile'. Let me know if it works for you.
from reanimate.
I'm having trouble testing this because haskell.nix apparently doesn't like brining stack extra-deps into the shell, but I'll get back to you.
from reanimate.
Yes, thank you very much this seems to work.
from reanimate.
I have one last problem in that exporting latex_draw.hs
to a gif seems to give the following error, but exporting tut_glue_blender.hs
to a gif seems to work fine.
[nix-shell:~/Source/gitlab.com/shakebook-site/shakebook-site.gitlab.io]$ runhaskell site/animations/latex_draw.hs render --preset quick --raster convert --format gif
Animation options:
fps: 15
width: 320
height: 180
fmt: gif
target: /home/lc/Source/gitlab.com/shakebook-site/shakebook-site.gitlab.io/site/animations/latex_draw.gif
raster: RasterConvert
Starting render of animation: 6.0
Frames rendered: 90/90, time spent: 3s
latex_draw.hs: /nix/store/5kk09z63c6dc5jrm6ygspmq9c90pdw29-ffmpeg-full-4.2.2/bin/ffmpeg -framerate 15 -i '/run/user/1000/reanimate14774-0/render-%05d.png' -y -i /run/user/1000/reanimate14774-2.png -progress /run/user/1000/reanimate14774-1.txt -filter_complex 'fps=15,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse' -t 6.0 /home/lc/Source/gitlab.com/shakebook-site/shakebook-site.gitlab.io/site/animations/latex_draw.gif:
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.2.0 (GCC)
configuration: --disable-static --prefix=/nix/store/5kk09z63c6dc5jrm6ygspmq9c90pdw29-ffmpeg-full-4.2.2 --target_os=linux --arch=x86_64 --enable-gpl --enable-version3 --disable-nonfree --enable-shared --enable-pic --disable-small --enable-runtime-cpudetect --disable-lto --enable-gray --enable-swscale-alpha --enable-hardcoded-tables --enable-safe-bitstream-reader --enable-pthreads --disable-w32threads --disable-os2threads --enable-network --enable-pixelutils --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-avutil --enable-postproc --enable-swresample --enable-swscale --enable-doc --disable-htmlpages --enable-manpages --disable-podpages --disable-txtpages --enable-bzlib --enable-libcelt --enable-libdav1d --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-libfribidi --enable-libgme --enable-gnutls --enable-libgsm --enable-ladspa --enable-libmp3lame --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdc1394 --enable-iconv --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmysofa --enable-libopus --enable-libssh --enable-libtheora --enable-libv4l2 --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvmaf --enable-libvpx --enable-libwebp --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-lzma --enable-nvenc --enable-openal --enable-libopencore-amrnb --disable-opengl --enable-libopenjpeg --disable-openssl --enable-libpulse --enable-librtmp --enable-sdl2 --enable-libsoxr --enable-libspeex --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-zlib --disable-debug --enable-optimizations --disable-extra-warnings --disable-stripping
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, image2, from '/run/user/1000/reanimate14774-0/render-%05d.png':
Duration: 00:00:06.00, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, monob(pc), 320x180 [SAR 96:96 DAR 16:9], 15 fps, 15 tbr, 15 tbn, 15 tbc
Input #1, png_pipe, from '/run/user/1000/reanimate14774-2.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 16x16 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 (png) -> fps
Stream #1:0 (png) -> paletteuse:palette
paletteuse -> Stream #0:0 (gif)
Press [q] to stop, [?] for help
[image2 @ 0x886fc0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Output #0, gif, to '/home/lc/Source/gitlab.com/shakebook-site/shakebook-site.gitlab.io/site/animations/latex_draw.gif':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: gif, pal8, 320x180 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 15 fps, 100 tbn, 15 tbc (default)
Metadata:
encoder : Lavc58.54.100 gif
Error marking filters as finished
Conversion failed!
CallStack (from HasCallStack):
error, called at src/Reanimate/Misc.hs:38:17 in reanimate-0.2.0.2-DbGYvOMK5eG2wV5gvNF4DQ:Reanimate.Misc
from reanimate.
Spoke too soon, one more issue.
This doesn't seem to be able to run headless in CI, here: https://gitlab.com/shakebook-site/shakebook-site.gitlab.io/-/jobs/484192100
Edit: Looks like this is because eevee can't run without an active opengl context, switching to cycles will run headless but is much slower.
from reanimate.
With a threadripper 1950x, it might be doable in a reasonable amount of time. Use the --compile flag to render concurrently using all available cores. Without that flag, it'll only use a single core.
from reanimate.
What's your usecase, btw? Why are you rendering blender graphics in a headless environment?
from reanimate.
Ah great, I'll try that.
This is my use case, see the docs page and gitlab for the general idea. :) Would be nice to get gif output working at least.
from reanimate.
Ah running --compile doesn't play well inside the nix shell apparently.
[nix-shell:~/Source/gitlab.com/shakebook-site/shakebook-site.gitlab.io/site/animations]$ runhaskell tut_glue_blender.hs render --preset quick --raster convert --format mp4 --compile
Cloning 8c7f4f34b75c1c410ce4b951b4410ae9a2b26031 from https://github.com/Lemmih/reanimate
I don't know how to install GHC on your system configuration, please install manually
from reanimate.
Ah, right, it tries to use 'stack' to compile itself. You can do it manually, though. Compile tut_glue_blender and execute it manually with the same 'render --preset quick --raster convert --format mp4' arguments.
from reanimate.
Ah ok, that speeds it up a little bit with cycles. Is there a way to enable the GPU? How do I tell if it's using the GPU
from reanimate.
There is a way to let cycles use the GPU but I'm not sure how. If you can't use Eevee then it might not be possible to access the GPU. If you can figure out how to do it using the Blender GUI then converting it to a script is easy.
Oh, I forgot to say that you should run tut_glue_blender
with +RTS -N -RTS
. Also, compile it with -threaded
and -rtsopts
.
from reanimate.
Everything seems to be resolved. Closing issue.
from reanimate.
@locallycompact I'm also trying to get up and running with nix. I couldn't find your fork, could you share your nix setup?
from reanimate.
See #140 ^^
from reanimate.
@commandodev I have reanimate in a shell over at https://gitlab.com/shakebook-site/shakebook-site.gitlab.io
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
- Windows Image Raster Issue HOT 9
- 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.