Hello all,
After following this post: looking for a light X11 server for production ready deployment of GUI app.
I’ve been able to get a simple GUI playing a video playing in balena. Issue now however is that the video plays back super choppy. Wondering if anyone has input on how to correct this. For reference, my docker-compose.yml is:
version: "2"
volumes:
x11:
services:
xserver:
image: balenablocks/xserver
restart: always
privileged: true
volumes:
- 'x11:/tmp/.X11-unix'
labels:
io.balena.features.dbus: "1"
multimedia:
build: ./multimedia
privileged: true
restart: always
devices:
- /dev/dri
group_add:
- video
volumes:
- 'x11:/tmp/.X11-unix'
labels:
io.balena.features.dbus: "1"
And dockerfile in media directory is this:
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:bullseye-run
RUN install_packages \
x11-apps mesa-utils mesa-utils-extra python3-wxgtk4.0 python3-wxgtk-media4.0 gstreamer1.0-gtk3 gstreamer1.0-libav dbus-x11 at-spi2-core
COPY ./app /app
WORKDIR /app
ENV UDEV=1
CMD ["python3", "multimedia.py"]
The python code that plays the video is a simple wx.media call:
import wx
import wx.media
class TestPanel(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None)
self.testMedia = wx.media.MediaCtrl(self)
self.testMedia.Bind(wx.media.EVT_MEDIA_LOADED, self.play)
self.testMedia.Bind(wx.media.EVT_MEDIA_FINISHED, self.quit)
self.testMedia.Load('/app/mymedia.mp4')
def play(self, event):
self.testMedia.Play()
def quit(self, event):
self.Destroy()
if __name__ == '__main__':
app = wx.App()
Frame = TestPanel()
Frame.Show()
app.MainLoop()
I’ve tested this locally running the video in macos and runs perfectly. Any input is appreciated!