GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — basic recording for Plot by kushalkolar · Pull Request #178 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Apr 19, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

closes #171

usage:

# make plot and stuff

plot.record_start("./video.mp4")

# ... do stuff, interact, etc

plot.record_stop()

codec options:

plot_movie.record_start("./test_265.mp4", codec="libx264", options={"crf": "20"})

Uses a separate Process for writing frames using PyAV, snapshot of canvas is sent using Queue. It should be fast enough for anything that's not too crazy. Right now the framerate is variable since we just grab frames in an animation function.

Tried OpenCV initially but it was acting really weird. It would write a video file just fine, but then when you started writing the next video file it made the previous one unreadable. VideoCapture.relese() was called, but there was something weird with multiprocessing I think. PyAV doesn't have this issue and seems to be better anyways with codecs etc.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kushalkolar added 5 commits April 19, 2023 04:06
@kushalkolar
basic recording for Plot
0c6ceb0
@kushalkolar
opencv conditional import, reduce fps slightly in recorded vid to com…
b2cc0b4
…pensat, looks fine now
@kushalkolar
forgot to add the actual recorder
05676e9
@kushalkolar
record Plot or GridPlot, uses PyAV, works well enough
31f7d8c
@kushalkolar
Merge branch 'master' into record-plot
3edabaf
@kushalkolar
kushalkolar requested a review from clewis7 May 20, 2023 11:56
@kushalkolar kushalkolar mentioned this pull request May 20, 2023
Toolbar #149
Closed
10 tasks done
kushalkolar added 3 commits May 21, 2023 00:37
@kushalkolar
comment, organization
2f78c2c
@kushalkolar
Merge branch 'record-plot' of https://github.com/kushalkolar/fastplotlib
31d3e11
 into record-plot
@kushalkolar
cleaup
1f48b28
@kushalkolar kushalkolar mentioned this pull request May 21, 2023
record plot to video file #171
Closed
clewis7
clewis7 reviewed May 22, 2023
View reviewed changes

@clewis7 clewis7 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I see what you mean with the mixin class now

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread fastplotlib/layouts/_record_mixin.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/layouts/_record_mixin.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@clewis7

clewis7 commented May 22, 2023

Copy link
Copy Markdown
Member

just out of curiosity, what happens when you change the size during the recording?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented May 22, 2023

Copy link
Copy Markdown
Member Author

The video width and height are fixed, so if you change the canvas size the width and height will change. I think it then would get trimmed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
kushalkolar merged commit 162910a into master May 22, 2023
@kushalkolar
kushalkolar deleted the record-plot branch May 23, 2023 04:47
kushalkolar added a commit that referenced this pull request Jun 14, 2023
@clewis7 @kushalkolar
restarted tests, now work from the command line (#179)
a08e84c
* restarted tests, now work from the command line

* more tests

* more tests, still working on iw

* ipywidget can only be tested w/ nbmake

* updated tests

* support numpy fancy indexing for colors and data features (#177)

* type annotation fix for older python versions

* adding fancy indexing implemented in #177

* requested changes

* adding diff storage for CI pipeline usage

* use readthedocs.yaml for doc build (#189)

* tests changes, ready to start CI pipeline

* allow for screenshots to be regenerated via os.environ key

* CI build

* linux-build passes, still working on examples passing

* progress on CI pipeline, still need to figure out test build

* still failing test build, what I have for now

* kwargs for Plot and GridPlot to set canvas star size (#194)

* Update ci.yml

use pygfx before pylinalg refactor

* Update ci.yml

sed to remove pygfx from setup.py

* Update ci.yml

imageio

* Delete requirements_rtd.txt

* Update ci.yml

testing upload screens

* create BaseSelector, heatmap also works with LinearSelector and LinearRegionSelector (#187)

* BaseSelector handles most of the event handling, simplifies a lot of implementation.
* same functionality between Linear and LinearRegion, shift + arrow keys to move
* sync not tested for LinearRegion
* HeatmapGraphic has helpers to add Linear and LinearRegion
* indices getters and get_selected_data() are now based on Graphic type, so line and heatmap are handled differently
* started RectangleRegionSelector, will finish in another PR

* add features section to docs for Graphics

* fix sync bug, arrow key movements are toggleable (#198)

* finishes #107, #119, #192 (#200)

* more selector stuff (#199)

* garbage collection of selectors, not tested yet

* selecors gc progress, not there yet but not broken either

* move events for transparent fill areas

* rectangle region selector basic functionality works

* more rectangle region stuff

* basic recording for Plot (#178)

* basic recording for Plot

* opencv conditional import, reduce fps slightly in recorded vid to compensat, looks fine now

* forgot to add the actual recorder

* record Plot or GridPlot, uses PyAV, works well enough

* comment, organization

* cleaup

* changing linux build to have python versions matrix

* working on toolbar (#195)

* working on toolbar

* toolbar updates

* basic toolbar for plot implemented

* base logic in notebook for gridplot toolbar

* gp toolbar working when subplots have names & mix names/no names

* initial changes to simple plot toolbar

* updates to plot toolbar, still need to refactor into separate file

* fixed gridplot toolbar, still need to move to separate class

* add flip button

* adding click event handler for gp toolbar dropdown options

* keep new clicked plot up-to-date with toggle button values

* requested changes

* catchup with pygfx linalg refactor (#203)

* WIP, mapping to points and selectors not updated

* everything updated for linalg refactor except rectangle selector

* update toolbar w.r.t. linalg refactor

* update examples w.r.t. linalg refactor

* update readme

* image selector and heatmap linalg fixes (#204)

* add selector performance example nb

* Docs build fix (#210)

* Update .readthedocs.yaml, install pygfx from main

* Update .readthedocs.yaml

* Update .readthedocs.yaml

* all feature docs (#212)

* add all feature docs

* Create examples README

* Update README

* Update and rename README to README.md

* finish buttons for toolbar (#207)

* working on toolbar

* toolbar updates

* basic toolbar for plot implemented

* base logic in notebook for gridplot toolbar

* gp toolbar working when subplots have names & mix names/no names

* initial changes to simple plot toolbar

* updates to plot toolbar, still need to refactor into separate file

* fixed gridplot toolbar, still need to move to separate class

* add flip button

* adding click event handler for gp toolbar dropdown options

* keep new clicked plot up-to-date with toggle button values

* requested changes

* adding record button

* record button

* silly miss in merge conflict resolve

* wow I am struggling this am

* imagewidget toolbar for single plot iw

* toolbar for iw with gridplot

* requested changes

* update flip icon

* toolbar updates

* changes to linear selector event handler removal

* Update fastplotlib/widgets/image.py

* simplify toolbar stuff in show(), simplify image widget toolbar

---------

Co-authored-by: Kushal Kolar <[email protected]>

* nbmake tests work

* updating CI file

* all tests passing locally

* trying to get CI to run on ghub

* change screenshots to be stored as png files

* restarted tests, now work from the command line

* more tests

* more tests, still working on iw

* ipywidget can only be tested w/ nbmake

* updated tests

* adding fancy indexing implemented in #177

* requested changes

* adding diff storage for CI pipeline usage

* tests changes, ready to start CI pipeline

* allow for screenshots to be regenerated via os.environ key

* CI build

* linux-build passes, still working on examples passing

* progress on CI pipeline, still need to figure out test build

* still failing test build, what I have for now

* Update ci.yml

use pygfx before pylinalg refactor

* Update ci.yml

sed to remove pygfx from setup.py

* Update ci.yml

imageio

* Update ci.yml

testing upload screens

* changing linux build to have python versions matrix

* nbmake tests work

* updating CI file

* all tests passing locally

* trying to get CI to run on ghub

* change screenshots to be stored as png files

* rebase with master and update CI

* track *.png files using Git LFS

* yml for regenerating screenshots, updating CI yml to not regenerate

* update .gitignore and regen screenshots yml

* hopefully works

* add screenshots

* remove screenshots from git

* add screenshots, yet again

* setup options

* remove type annotation

* change workflow to use setup optiosn

* add pyav to setup for tests

* add scikit-image

* opencv instead of pyav

* add libpng-dev

* try pillow, better work ffs

* bah

* add git-lfs to apt install for github actions

* add interactive again

* install git lfs before checkout repo

* add git lfs fetch pull

* diffs

* diffs path

* update examples for canvas size and autoscale

* remove gpu screenshots

* add screenshot ground truth files from github actions generated screenshots

* remove interactive session stuff

---------

Co-authored-by: Kushal Kolar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@clewis7 clewis7 clewis7 left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

record plot to video file

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kushalkolar @clewis7
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.