Giter Club home page Giter Club logo

Comments (1)

kushalkolar avatar kushalkolar commented on June 13, 2024

Right now you could manually call fig.recorder.start() with your own kwargs:

codec: str, default "mpeg4"
codec to use, see ``ffmpeg`` list: https://www.ffmpeg.org/ffmpeg-codecs.html .
In general, ``"mpeg4"`` should work on most systems. ``"libx264"`` is a
better option if you have it installed.
pixel_format: str, default "yuv420p"
pixel format
options: dict, optional
Codec options. For example, if using ``"mpeg4"`` you can use ``{"q:v": "20"}`` to set the quality between
1-31, where "1" is highest and "31" is lowest. If using ``"libx264"``` you can use ``{"crf": "30"}`` where
the "crf" value is between "0" (highest quality) and "50" (lowest quality). See ``ffmpeg`` docs for more
info on codec options
Examples
--------
With ``"mpeg4"``
.. code-block:: python
# start recording video
figure.recorder.start("./video.mp4", options={"q:v": "20"}
# do stuff like interacting with the plot, change things, etc.
# end recording
figure.recorder.stop()
With ``"libx264"``
.. code-block:: python
# start recording video
figure.recorder.start("./vid_x264.mp4", codec="libx264", options={"crf": "25"})
# do stuff like interacting with the plot, change things, etc.
# end recording
figure.recorder.stop()

You can choose a diff codec and/or choose a different q:v or crf value depending on the codec, examples are given above for mpeg4 and libx264.

Long term I wonder if there's a better way to record video with pygfx, posted pygfx/pygfx#754

from fastplotlib.

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.