Code Monkey home page Code Monkey logo

Comments (15)

dmadisetti avatar dmadisetti commented on June 2, 2024 1

It should be fine once the nixpkgs PR is merged

As far as the new notebook, it's not widely used or even known about- I'm slowly moving over from Jupyter because I like it, and hope it takes off.
The project is called Marimo, and hopes to address some of the state-based pains that Jupyter brings: https://marimo.io/
Also really polished widgets, nicer UI, and feels less bloated

If you want to highlight what is possible in documentation, I'm sure they would appreciate it. I think this issue from the lead: marimo-team/marimo#794
shows they have some interested in deeper integration with manim like tools - but what I did is a bit of a magics hack

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024 1

Great news! Thanks for your work @dmadisett!

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024 1

@dmadisetti, before I close this, would you mind adding a small section about how to install Manim Slides via NixOS in https://github.com/jeertmans/manim-slides/blob/main/docs/source/installation.md?

If you have time, I would really appreciate! I can review your PR and make some changes on top of it :-) Thanks!

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024

Hello, you are right that dependencies can become very hard to manage, especially on OSes like yours.

Is NixOS Linux based? I would have guessed that it support the manylinux binaries, but maybe not.
As you can read, the Qt plug-in for displaying multimedia does not seem to be available on your platform.. I might be good to first investigate that issue further

from manim-slides.

sierpinskiii avatar sierpinskiii commented on June 2, 2024

Right, NixOS is Linux based. So I think there might not be some specific issue that can cause the malfunction of the Qt multimedia plug-in.
Is manim-slides specifically depending on qt5? I tried both qt5 and qt6 on my system, but it didn't work properly.
If there is a Dockerfile for manim-slides, I might be able to investigate the issue by comparing the Dockerfile's setup procedure and that of my system.

from manim-slides.

sierpinskiii avatar sierpinskiii commented on June 2, 2024

Also, I'd like to mention that someone proposed the packaging of manim-slides for the NixOS package manager, but looks like there is no significant progress for a few months, so it might be a good idea for us to resume the packaging.

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024

Creating a working Dockerfile is an ongoing issue but I didn’t time yet to work on that…

Qt is a required dependency for the present mode (+ wizard).
What I don’t know is whether the issue is from Qt, or from PySide6 bindings. Maybe you can try using PyQt6. For that, I might need to rewrite the code so people can chose the bindings they prefer.

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024

Just a side note:

I thought this is the problem coming from the absence of ffmpeg or qt5, so I installed them globally on my system. However, the problem persists.

Starting with v5.1, also waiting next Manim release (to be in sync), Manim Slides and Manim should not depend on a global FFMPEG installation anymore, because we will use PyAV that ships the necessary bindings. PySide6 should also ship ffmpeg bindings itself, I think.

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024

Regarding your issue, can you try installing PyQt6 and see if you can import the multimedia module?

E.g., run this (change the video file path):

import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QPushButton, QSlider
from PyQt6.QtMultimedia import QMediaPlayer
from PyQt6.QtMultimediaWidgets import QVideoWidget
from PyQt6.QtCore import QUrl, Qt


class VideoPlayer(QMainWindow):
    def __init__(self):
        super().__init__()

        self.setWindowTitle("Video Player")
        self.setGeometry(100, 100, 1024, 768)

        self.media_player = QMediaPlayer()
        self.media_player.setSource(QUrl.fromLocalFile("Video.mp4"))

        self.video_widget = QVideoWidget()

        self.start_button = QPushButton("Start")
        self.start_button.clicked.connect(self.start_video)

        self.pause_button = QPushButton("Pause")
        self.pause_button.clicked.connect(self.pause_video)

        self.stop_button = QPushButton("Stop")
        self.stop_button.clicked.connect(self.stop_video)

        self.slider = QSlider(Qt.Orientation.Horizontal)
        self.slider.sliderMoved.connect(self.set_position)

        self.media_player.setVideoOutput(self.video_widget)
        self.media_player.positionChanged.connect(self.position_changed)
        self.media_player.durationChanged.connect(self.duration_changed)

        layout = QVBoxLayout()
        layout.addWidget(self.video_widget)
        layout.addWidget(self.start_button)
        layout.addWidget(self.pause_button)
        layout.addWidget(self.stop_button)
        layout.addWidget(self.slider)

        container = QWidget()
        container.setLayout(layout)
        self.setCentralWidget(container)

    def start_video(self):
        self.media_player.play()

    def pause_video(self):
        self.media_player.pause()

    def stop_video(self):
        self.media_player.stop()

    def set_position(self, position):
        self.media_player.setPosition(position)

    def position_changed(self, position):
        self.slider.setValue(position)

    def duration_changed(self, duration):
        self.slider.setRange(0, duration)


if __name__ == "__main__":
    app = QApplication(sys.argv)
    video_player = VideoPlayer()
    video_player.show()
    sys.exit(app.exec())

from manim-slides.

dmadisetti avatar dmadisetti commented on June 2, 2024

I got this to work with nixpkgs: NixOS/nixpkgs#298198

no problem using ffmpeg

with this env
nix-shell -p ffmpeg manim "python3.withPackages(ps: with ps; [ marimo manim-slides ])"
even got magics working in a new type of notebook:
https://static.marimo.app/static/manim-example-rket

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024

So I am not sure to catch everything: is the original issue solved?

Nonetheless, I didn't know about the "new type of notebook" thing, and this might be nice to document it in the docs. Do you have some reference for this?

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024

Nice!

Thanks for the link to Marimo's docs, I'll give it a look once I have some time :-)

from manim-slides.

dmadisetti avatar dmadisetti commented on June 2, 2024

nixos has now packaged manim-slides, should be in cache and widely accessible in a few days

from manim-slides.

dmadisetti avatar dmadisetti commented on June 2, 2024

No problem! I will once this gets into unstable cache, this should then get officially supported in 24.05 (released sometime in May)

from manim-slides.

jeertmans avatar jeertmans commented on June 2, 2024

No problem! I will once this gets into unstable cache, this should then get officially supported in 24.05 (released sometime in May)

thanks!

from manim-slides.

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.