Creating video with pygfx
See original GitHub issueI’m working on the sphinx gallery for the examples and I got the basic pieces working. At the moment we can generate a gallery and have sphinx-gallery use pygfx to render images and add them. Something like this:
There are a few more things to iron out (like giving each example a title so that sphinx can link it automatically), but the basics are there.
One thing that is, perhaps, a bit of a luxury, but is still really useful for us is to show videos/animations in the gallery. This essentially works by creating a GIF that gets shown instead of the usual PNG. For this I have two discussion points:
- Is there an existing example of capturing a video with pygfx?
- The code for the video may have to be partly embedded in the example (to say “take a picture here, but do a video for X seconds there”). From a pedagogical perspective, this is suboptimal because we would ideally like to just show the example with the usual
run()
call so that they can see it nicely once they copy the code. Would an alternative be to say “we always show 5 sec of video for each render”?
I’m not 100% clear yet on how I want to solve this problem, but if you have ideas, I’m all ears 😃
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Text rendering · Issue #20 · pygfx/pygfx - GitHub
I think our goal should be: Aim for high quality text rendering (though not necessarily perfect). Make sure that there is a default...
Read more >Integrate pygfx in Qt — pygfx documentation
... from wgpu.gui.qt import WgpuCanvas import pygfx as gfx class Main(QtWidgets. ... _on_button_click) # Create canvas, renderer and a scene object self.
Read more >Kushal Kolar on Twitter: "@sofroniewn @camachodejay ...
Thanks! I've been looking for people interested in developing a full scientific plotting library with it. Using the `pygfx` render engine directly is...
Read more >Practical GPU Graphics with wgpu-py and Python: Creating ...
Practical GPU Graphics with wgpu-py and Python: Creating Advanced Graphics on Native Devices and the Web Using wgpu-py: the Next-Generation GPU API for ......
Read more >Payden Global Fixed Income Fund PYGFX:NASDAQ - CNBC
Get Payden Global Fixed Income Fund (PYGFX:NASDAQ) real-time stock quotes, news, price and financial information from CNBC.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using
canvas.draw()
does the trick. If we are not concerned about timings, we can do:This solves my issue. Closing!
Another option could be to update the examples not to use the time, but assume that the fps is at 30 (which the GUI backends run at by default). Then we can just take screenshots (which may take much longer on lavapipe) and set the mp4/gif playback speed at 30 fps.