[GH-ISSUE #13] Webm output #12

Closed
opened 2026-03-02 16:47:06 +03:00 by kerem · 8 comments
Owner

Originally created by @TheKnarf on GitHub (Jan 24, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/13

It would be nice with support for outputting .webm videos.

Originally created by @TheKnarf on GitHub (Jan 24, 2023). Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/13 It would be nice with support for outputting `.webm` videos.
kerem closed this issue 2026-03-02 16:47:06 +03:00
Author
Owner

@initialcommit-io commented on GitHub (Jan 25, 2023):

@TheKnarf Thanks for the suggestion. Currently Manim only supports exporting to .mp4 or .gif.

Can you let me know your use case for .webm exports and why the currently exported .mp4 can't just be converted to .webm after it is generated?

<!-- gh-comment-id:1403275555 --> @initialcommit-io commented on GitHub (Jan 25, 2023): @TheKnarf Thanks for the suggestion. Currently Manim only supports exporting to .mp4 or .gif. Can you let me know your use case for .webm exports and why the currently exported .mp4 can't just be converted to .webm after it is generated?
Author
Owner

@initialcommit-io commented on GitHub (Jan 27, 2023):

Hi @TheKnarf,

Just following up to see if you can provide those details.

<!-- gh-comment-id:1406247432 --> @initialcommit-io commented on GitHub (Jan 27, 2023): Hi @TheKnarf, Just following up to see if you can provide those details.
Author
Owner

@TheKnarf commented on GitHub (Jan 27, 2023):

Using a converter is obviously possible.
But it would be more ergonomic for the use of the tool to get the format one wants directly.

.webm files are useually about 1/10th of the size of .mp4 files, and so that would be my preferred filetype to use on the web if I where to embed some output of git-sim online. I plan to use git-sim together with Docusaurus to document our git workflow.

<!-- gh-comment-id:1406612194 --> @TheKnarf commented on GitHub (Jan 27, 2023): Using a converter is obviously possible. But it would be more ergonomic for the use of the tool to get the format one wants directly. `.webm` files are useually about 1/10th of the size of `.mp4` files, and so that would be my preferred filetype to use on the web if I where to embed some output of `git-sim` online. I plan to use `git-sim` together with Docusaurus to document our git workflow.
Author
Owner

@abhijitnathwani commented on GitHub (Jan 27, 2023):

I have seen webm widely used in webpages to embed videos. @TheKnarf put up a nice use case.
@initialcommit-io we do have ffmpeg installed as part of manim dependencies. May be we can accept an argument to output as webm and internally convert the MP4 to webm using ffmpeg ?

<!-- gh-comment-id:1406909575 --> @abhijitnathwani commented on GitHub (Jan 27, 2023): I have seen webm widely used in webpages to embed videos. @TheKnarf put up a nice use case. @initialcommit-io we do have `ffmpeg` installed as part of manim dependencies. May be we can accept an argument to output as webm and internally convert the MP4 to webm using ffmpeg ?
Author
Owner

@initialcommit-io commented on GitHub (Jan 27, 2023):

@TheKnarf Sounds like a cool use case - ok we'll give it a try!

@abhijitnathwani Good suggestion - do you want to try your hand at implementing this with calls to ffmpeg? I think a global option like --video-format=webm would work well.

<!-- gh-comment-id:1406928218 --> @initialcommit-io commented on GitHub (Jan 27, 2023): @TheKnarf Sounds like a cool use case - ok we'll give it a try! @abhijitnathwani Good suggestion - do you want to try your hand at implementing this with calls to ffmpeg? I think a global option like `--video-format=webm` would work well.
Author
Owner

@abhijitnathwani commented on GitHub (Jan 27, 2023):

Sure @initialcommit-io ! I'll give it a try and let you know how it goes

<!-- gh-comment-id:1406929811 --> @abhijitnathwani commented on GitHub (Jan 27, 2023): Sure @initialcommit-io ! I'll give it a try and let you know how it goes
Author
Owner

@abhijitnathwani commented on GitHub (Jan 28, 2023):

@initialcommit-io I have the bare bones working for the webm output. You can find the code in the branch here.
One question for you, the mp4 to webm conversion takes a few seconds to run. While ffmpeg is running, the user doesn't see any messages so he/she is kinda lost at what is happening. How do we address this better? One option would be to use some progress to display, via some python libraries

On another note, we need to add some logging so that we can also enable verbose mode to the dev can follow the flow. We can also replace the print with logging.info/debug/error.

<!-- gh-comment-id:1407378651 --> @abhijitnathwani commented on GitHub (Jan 28, 2023): @initialcommit-io I have the bare bones working for the webm output. You can find the code in the branch [here](https://github.com/abhijitnathwani/git-sim/tree/add-support-for-webm-output). One question for you, the mp4 to webm conversion takes a few seconds to run. While ffmpeg is running, the user doesn't see any messages so he/she is kinda lost at what is happening. How do we address this better? One option would be to use some progress to display, via some python libraries On another note, we need to add some logging so that we can also enable verbose mode to the dev can follow the flow. We can also replace the `print` with `logging.info/debug/error`.
Author
Owner

@initialcommit-io commented on GitHub (Jan 28, 2023):

@abhijitnathwani Looks good! As for logging, it's a good point and we should switch to an actual logging facility instead of just print statements like you said, and I also do like the idea of the --verbose flag to enable detailed output.

For now, I think you can just add a print statement that says "Converting video output to .webm format..." Then feel free to submit the PR for merging.

Then we can address logging in a new issue if you want to open an issue for that. It would also be cool to do a separate issue for showing progress bars (not sure if we could get one for the Manim generation itself), but lets try and keep each of these functionalities as its own separate GitHub issue.

<!-- gh-comment-id:1407454392 --> @initialcommit-io commented on GitHub (Jan 28, 2023): @abhijitnathwani Looks good! As for logging, it's a good point and we should switch to an actual logging facility instead of just print statements like you said, and I also do like the idea of the `--verbose` flag to enable detailed output. For now, I think you can just add a print statement that says "Converting video output to .webm format..." Then feel free to submit the PR for merging. Then we can address logging in a new issue if you want to open an issue for that. It would also be cool to do a separate issue for showing progress bars (not sure if we could get one for the Manim generation itself), but lets try and keep each of these functionalities as its own separate GitHub issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sim#12
No description provided.