Lightweight ffmpeg docker that can execute ffplay and show GUI window

I used ffplay in Ubuntu (without docker) to read a stream and it works fine. Now, I am trying to use ffplay in a container. The ffmpeg container does not contain ffplay. Is there any lightweight ffplay container, please?

Usually Docker containers don’t have GUI applications, except when they are browser based.

Thanks a lot. I see. Previously, I experienced running OpenCV inside docker and it was a pain to setup because the application needed GUI support.
Anyways, does it mean that there is no ffplay docker that can read and show a stream? I am hesitating to use Ubuntu as base image and make ffplay dockerfile as it would certainly not be lightweight

You want to run ffview on Ubuntu in a container to view a file? Like VLC Media Player?

Why? For security? Aren’t all Ubuntu apps installed as snap and therefore are inside a container?

You want to run ffview on Ubuntu in a container to view a file? Like VLC Media Player?

Yes. It is part of big project where one task is to view the stream. Later, I plan to add it to docker-compose.yaml. BTW, currently, I am using ffplay like this:
ffplay “rtmps://wowza:1935/live/watch”

I used VLC but there is a considerable delay in VLC. I certainly don’t want to create a dockerfile with Ubuntu as base image as it will be overkill and heavy.

Docker is about isolation of processes, by default you can’t access the graphics card,
so you can’t play back videos on screen.

Workarounds would be somehow using X11 forwarding, or mounting a graphics card into the container (like they do for AI processing) or using something like VNC or RDP to access the desktop inside a full desktop container.

But it’s all not trivial.

@bluepuma77

Workarounds would be somehow using X11 forwarding, or mounting a graphics card into the container (like they do for AI processing) or using something like VNC or RDP to access the desktop inside a full desktop container.

That’s right. I am doing it in the same way:

  1. Set DISPLAY environment variable same as Host
  2. Enable X11 forwarding

It works. But my question is different. Currently I am using Ubuntu as base image something like following

FROM ubuntu:18.04
RUN apt-get update && apt-get install -y ffmpeg

I feel that having Ubuntu for ffplay does not look lightweight at all. Is there any lightweight ffplay container?

All containers with a desktop will not be lightweight.

But I don’t think you can run ffplay by itself in a tiny container and display it on host desktop.

@bluepuma77

I understand.
Well, instead of Ubuntu as base image, can you suggest a better (lightweight) container as base image?
Thanks for your kind suggestion.

As stated before:

And as you haven’t shared the intention of the whole exercise, we still don’t know what you actually want to achieve.

And as you haven’t shared the intention of the whole exercise, we still don’t know what you actually want to achieve.

I am running a streaming server in one docker container, the other container (I am planning to) is where ffplay is displaying the stream

Why would you want to display the stream inside a Docker container? Docker containers are not made for graphical UI.