f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.74k stars 198 forks source link

Support saving multiple file when using `--animation-autoplay` and `--output` #46

Open mwestphal opened 2 years ago

mwestphal commented 2 years ago

When using --animation-autoplay and --output, write multiple png files, and rely on filename templating to writing different files.

Meakk commented 2 years ago

Actually, it may be out of scope of f3d.
If someone wants to generate a video, the camera, and the animation frame should be specified through the future libf3d API or via command line arguments, and generate a fixed image, with a script. Then the animation with ffmpeg by combining the images.
Wdyt @mwestphal?

mwestphal commented 2 years ago

I agree, but you mean that this should be another application, not F3D ?

xzhub commented 2 years ago

By using command line argument to generate a series of images is very slow, it would be nice to have some parameters for f3d to generate a video file directly:

  1. speed of the rotation
  2. maybe some inbuilt fancy camera routes, circling should be one of them.
mwestphal commented 1 year ago

needs https://github.com/f3d-app/f3d/issues/741 first

mwestphal commented 9 months ago

Supporting writing multiple pngs would already be great

mwestphal commented 8 months ago

related to #1194 and #10 as well.

mwestphal commented 8 months ago

Here is my idea for this.

With autoplay and output, generate numbered screenshot with manipulating the time based on a new output-fps option.

What do you think @snoyer @Meakk ?

Meakk commented 8 months ago

I think there are three different use cases:

  1. Animated model with a fixed camera
  2. Fixed model with animated camera path

There could be a third use case with both but I'll omit it for now.

Case 1: We just need the --autoplay argument and find a way to export several files. Maybe we could support things like --output /tmp/export_%t.png and substitute %t with the time step index?

Case 2: Some file formats like glTF and USD support camera animation so specifying --camera-index should support the given camera path. Otherwise, just like we define a fixed camera by default, we could have an option --camera-path=[orbit,zoom_in,whatever] which will define a new animated camera path (having a --fps defaulted to 30 would be useful here too). Then we could use the same %t substitution as in case 1.

mwestphal commented 8 months ago

Not sure what you mean, animated camera and animated model is exactly the same code path in F3D. Creating an animated camera like an orbit would be nice, but this is a different issue.

In any case, the code we are talking about would need autoplay in both cases.

mwestphal commented 2 months ago

With filename templating in #1194, then this now even more easy to do.

mwestphal commented 2 months ago

updated the text of the issue.

mwestphal commented 1 week ago

autoplay added in #1065