Skip to content

Commit

Permalink
Added GIF warnings about FPS and size
Browse files Browse the repository at this point in the history
  • Loading branch information
EriKWDev committed Nov 1, 2021
1 parent 7014a51 commit eb03959
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ Options:
-v, --video, --render
Enables video rendering mode. Will output video to renders/<name>.mp4
--gif
WARNING: Huge files. Please use with --size:400 or, preferably, manually convert
the mp4 from --render to a GIF.
WARNING: Huge files. Please use with --size:400 --fps:15 or, preferably,
manually convert the mp4 from --render to a GIF.
Enables gif rendering mode. Will output gif to renders/<name>.gif
--snap, --screenshot, --image, --picture, --png
Will create a PNG screenshot of the Scene. Will output to renders/<name>.png
Expand All @@ -159,13 +159,11 @@ Options:
-s:SIZE, --size:SIZE
Sets both width andd height to SIZE
--fps:FPS, --rate:FPS
Sets the desired framerate to FPS. Something like --render --fps:15 is very
useful for a quick test render
Sets the desired framerate to FPS
--debug:true|false
Enables debug mode which will visualize the scene's tracks.
Default behaviour is to show the visualization in live mode
but not in render mode.
```

Remember that the rendering to video requires [FFMpeg](https://www.ffmpeg.org/) to be installed and available in your `PATH`.
Expand Down
11 changes: 9 additions & 2 deletions src/nanim/rendering.nim
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ proc renderWithPipe(scene: Scene, createGif = false) =

if createGif:
warn "Currently, the built in GIF-generation is very primitive. It is recommended to instead use --render and manually convert the render to GIF for better results."

if scene.goalFps > 20.0:
warn "You are rendering a GIF at a high framerate. Consider using --fps:15"

if scene.width > 1000 or scene.height > 1000:
warn "You are rendering a GIF at a larger than optimal size. Consider shrinking it down with --width:W, --height:H or --size:S"

ffmpegOptions = @[
"-y",
"-f", "rawvideo",
Expand Down Expand Up @@ -439,8 +446,8 @@ proc renderImpl*(userScene: Scene) =
echo " -v, --video, --render"
echo " Enables video rendering mode. Will output video to renders/<name>.mp4"
echo " --gif"
echo " WARNING: Huge files. Please use with --size:400 or, preferably, manually convert"
echo " the mp4 from --render to a GIF."
echo " WARNING: Huge files. Please use with --size:400 --fps:15 or, preferably,"
echo " manually convert the mp4 from --render to a GIF."
echo " Enables gif rendering mode. Will output gif to renders/<name>.gif"
echo " --snap, --screenshot, --image, --picture, --png"
echo " Will create a PNG screenshot of the Scene. Will output to renders/<name>.png"
Expand Down

0 comments on commit eb03959

Please sign in to comment.