Skip to content

Instantly share code, notes, and snippets.

@brillout
Last active December 22, 2024 11:31
Show Gist options
  • Save brillout/73624de22e636977b7738e2946c8df9e to your computer and use it in GitHub Desktop.
Save brillout/73624de22e636977b7738e2946c8df9e to your computer and use it in GitHub Desktop.

Making Video from 3D Spline model

  1. Spline Video export: https://www.youtube.com/watch?v=OgN8TZElx6M&t=130s
    • Export as image sequence.
    • Trick: set 15 fps with 0.5x speed then create video with 30 fps.
  2. Convert to video:
    # Remove redundant images from image sequence
    ls -1 *png # then use bash in vim normal mode to remove all superfluous images
    # resize
    mkdir resized && for f in *.png; do ffmpeg -i "$f" -vf scale=150:-1 "resized/$f"; done
    # mp4
    ffmpeg -framerate 30 -pattern_type glob -i '*.png' -crf 20 -preset veryslow -pix_fmt yuv420p -c:v libx264 out.mp4
    # webm
    ffmpeg -framerate 30 -pattern_type glob -i '*.png' -crf 30 -preset veryslow -pix_fmt yuva420p -c:v libvpx-vp9 out.webm
  3. Create cover by converting last frame to webp:
    # Lossless
    convert -format webp -quality 100% 483.png 483.webp # sudo apt-get install imagemagick
    # Compressed
    convert -format webp -quality 99% 483.png 483.webp # Changing 99% to 0% doesn't make any difference

    Take the last image from the image sequence, i.e. the highest number from $ ls *png.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment