Skip to content

Conversation

@jholveck
Copy link
Contributor

Changes proposed in this PR

Adds demos, which are longer examples than belong in the regular documentation. The first of these is one that streams to a toy TV. Before merging this, I'd like to get a sense of how much of the code would be shared with the other demo I've got in progress, one that saves to an AVI file.

It is very important to keep up to date tests and documentation.

  • Tests added/updated
  • Documentation updated

Is your code right?

  • ./check.sh passed

This is a demo that will probably appeal to few users, but working on
it has helped me with some of the pipeline concepts I'm using in
another demo I'm working on: one to save to an AVI file.

The demo itself seems ready to go, but I still need to add references
to the demos in the documentation.
Copy link
Owner

@BoboTiG BoboTiG left a comment

Choose a reason for hiding this comment

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

This is insane! The quality of the code + comments is awesome. It will be very helpfull to other developers 👍

I am not sure what you want to do with upcoming demos, I would just say it might be good to keep self-contained examples. That would ease sharing informations, and developers tasks. WDYT?

@jholveck
Copy link
Contributor Author

Thank you! I'm glad you like it! MSS is popular enough that it's gone beyond the simple "take a screenshot, save a PNG" use cases. I think that having clear demos showing how to use a library in practical situations, beyond simple examples, is a big help.

As for the code reuse question, this is something I'm of two minds about. On one hand, yes, it's great for demos to be self-contained. On the other hand, I've also got the video encoding demo (you can see an early test, although that's using some features that I was playing with in a separate branch). That uses the same basic pipeline concept. It's still "input -> processing -> output" in separate threads.

The pipeline code in the tinytv-stream demo is nearly 300 lines long. I was thinking it might be worth separating that into a separate file, rather than copying it into a separate

That would let users review both demos without having to check to see if all that code is the same or if they need to re-read it all. It would also make sure that we don't accidentally change the pipeline code in one and not the other.

So as I said, I'm conflicted.

That said, I think we're fine committing this as-is, and possibly factoring things out later if we want to.

@BoboTiG
Copy link
Owner

BoboTiG commented Dec 21, 2025

Ah yes, the pipeline code could be in its own file: it will reduce demos code, and ease understanding MSS-specific usage.

@jholveck
Copy link
Contributor Author

Ok! Do you want me to do that before we commit these, or as part of the video streaming demo commit?

@jholveck
Copy link
Contributor Author

By the way, while writing this I was wondering if it was a particularly useful demo, since it's so focused on pipelines and such, and not much about MSS. Then I realized that there's a reason for that: MSS is so easy to use that it doesn't require a lot of support code!

This makes this compatible with Windows and macOS, where
time.clock_gettime() does not exist.
@jholveck jholveck marked this pull request as ready for review December 21, 2025 08:56
@BoboTiG
Copy link
Owner

BoboTiG commented Dec 21, 2025

That's insanely usefull, we keep it! :)

@BoboTiG
Copy link
Owner

BoboTiG commented Dec 21, 2025

A link in the documentation can be added later, I'm now hungry to see what other cool stuff your wrote with MSS :D

@BoboTiG BoboTiG merged commit 032e587 into BoboTiG:main Dec 21, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants