<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://developerwiki.proventusnova.com/index.php?action=history&amp;feed=atom&amp;title=How_to_Run_GStreamer_in_a_Docker_Container</id>
	<title>How to Run GStreamer in a Docker Container - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://developerwiki.proventusnova.com/index.php?action=history&amp;feed=atom&amp;title=How_to_Run_GStreamer_in_a_Docker_Container"/>
	<link rel="alternate" type="text/html" href="https://developerwiki.proventusnova.com/index.php?title=How_to_Run_GStreamer_in_a_Docker_Container&amp;action=history"/>
	<updated>2026-04-18T06:18:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://developerwiki.proventusnova.com/index.php?title=How_to_Run_GStreamer_in_a_Docker_Container&amp;diff=220&amp;oldid=prev</id>
		<title>Andres: Created page with &quot;= How to Run GStreamer in Docker =  This tutorial shows you how to install and use &#039;&#039;&#039;GStreamer&#039;&#039;&#039; inside a &#039;&#039;&#039;Docker container&#039;&#039;&#039; on &#039;&#039;&#039;Ubuntu 22.04&#039;&#039;&#039;. We&#039;ll build a minimal Docker image with support for &#039;&#039;&#039;x264enc&#039;&#039;&#039;, then run a simple test pipeline to encode video to an MP4 file.  == Step 1: Create a Dockerfile with GStreamer and x264enc ==  Create a file named &lt;code&gt;Dockerfile&lt;/code&gt; with the following contents:  &lt;syntaxhighlight lang=&quot;dockerfile&quot;&gt; FROM ubuntu:22.04...&quot;</title>
		<link rel="alternate" type="text/html" href="https://developerwiki.proventusnova.com/index.php?title=How_to_Run_GStreamer_in_a_Docker_Container&amp;diff=220&amp;oldid=prev"/>
		<updated>2025-07-23T20:11:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= How to Run GStreamer in Docker =  This tutorial shows you how to install and use &amp;#039;&amp;#039;&amp;#039;GStreamer&amp;#039;&amp;#039;&amp;#039; inside a &amp;#039;&amp;#039;&amp;#039;Docker container&amp;#039;&amp;#039;&amp;#039; on &amp;#039;&amp;#039;&amp;#039;Ubuntu 22.04&amp;#039;&amp;#039;&amp;#039;. We&amp;#039;ll build a minimal Docker image with support for &amp;#039;&amp;#039;&amp;#039;x264enc&amp;#039;&amp;#039;&amp;#039;, then run a simple test pipeline to encode video to an MP4 file.  == Step 1: Create a Dockerfile with GStreamer and x264enc ==  Create a file named &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; with the following contents:  &amp;lt;syntaxhighlight lang=&amp;quot;dockerfile&amp;quot;&amp;gt; FROM ubuntu:22.04...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= How to Run GStreamer in Docker =&lt;br /&gt;
&lt;br /&gt;
This tutorial shows you how to install and use &amp;#039;&amp;#039;&amp;#039;GStreamer&amp;#039;&amp;#039;&amp;#039; inside a &amp;#039;&amp;#039;&amp;#039;Docker container&amp;#039;&amp;#039;&amp;#039; on &amp;#039;&amp;#039;&amp;#039;Ubuntu 22.04&amp;#039;&amp;#039;&amp;#039;. We&amp;#039;ll build a minimal Docker image with support for &amp;#039;&amp;#039;&amp;#039;x264enc&amp;#039;&amp;#039;&amp;#039;, then run a simple test pipeline to encode video to an MP4 file.&lt;br /&gt;
&lt;br /&gt;
== Step 1: Create a Dockerfile with GStreamer and x264enc ==&lt;br /&gt;
&lt;br /&gt;
Create a file named &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; with the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;dockerfile&amp;quot;&amp;gt;&lt;br /&gt;
FROM ubuntu:22.04&lt;br /&gt;
&lt;br /&gt;
ENV DEBIAN_FRONTEND=noninteractive&lt;br /&gt;
&lt;br /&gt;
# Install GStreamer with x264 support and minimal required tools&lt;br /&gt;
RUN apt-get update &amp;amp;&amp;amp; apt-get install -y \&lt;br /&gt;
    libgstreamer1.0-dev \&lt;br /&gt;
    libgstreamer-plugins-base1.0-dev \&lt;br /&gt;
    libgstreamer-plugins-bad1.0-dev \&lt;br /&gt;
    gstreamer1.0-plugins-base \&lt;br /&gt;
    gstreamer1.0-plugins-good \&lt;br /&gt;
    gstreamer1.0-plugins-bad \&lt;br /&gt;
    gstreamer1.0-plugins-ugly \&lt;br /&gt;
    gstreamer1.0-libav \&lt;br /&gt;
    gstreamer1.0-tools \&lt;br /&gt;
    gstreamer1.0-x \&lt;br /&gt;
    gstreamer1.0-alsa \&lt;br /&gt;
    gstreamer1.0-gl \&lt;br /&gt;
    gstreamer1.0-gtk3 \&lt;br /&gt;
    gstreamer1.0-qt5 \&lt;br /&gt;
    gstreamer1.0-pulseaudio \&lt;br /&gt;
    libx264-dev \&lt;br /&gt;
    &amp;amp;&amp;amp; rm -rf /var/lib/apt/lists/*&lt;br /&gt;
&lt;br /&gt;
CMD [ &amp;quot;tail&amp;quot;, &amp;quot;-F&amp;quot;, &amp;quot;/dev/null&amp;quot; ]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This Dockerfile installs a complete GStreamer stack along with the necessary packages to support &amp;lt;code&amp;gt;x264enc&amp;lt;/code&amp;gt;, allowing you to encode H.264 video streams.&lt;br /&gt;
&lt;br /&gt;
== Step 2: Build the Docker image ==&lt;br /&gt;
&lt;br /&gt;
Use the following command to build the Docker image and tag it as &amp;lt;code&amp;gt;gstreamer-test&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
docker build -t gstreamer-test .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3: Start the GStreamer container in the background ==&lt;br /&gt;
&lt;br /&gt;
Run the container in detached mode and give it a name:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
docker run -d --name gstreamer-test gstreamer-test&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4: Run a sample GStreamer pipeline inside the container ==&lt;br /&gt;
&lt;br /&gt;
Use the following GStreamer command to generate a test video, encode it with x264, and save it as an MP4 file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gst-launch-1.0 videotestsrc num-buffers=300 is-live=true ! video/x-raw,width=640,height=480,framerate=30/1 ! x264enc ! mp4mux ! filesink location=output.mp4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a short 10-second video called &amp;lt;code&amp;gt;output.mp4&amp;lt;/code&amp;gt; using GStreamer&amp;#039;s built-in &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; source.&lt;br /&gt;
&lt;br /&gt;
== Step 5: Exit the container ==&lt;br /&gt;
&lt;br /&gt;
After the pipeline finishes, you can exit the container shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 6: Copy the video output to the host system ==&lt;br /&gt;
&lt;br /&gt;
Transfer the generated MP4 file from the container to your local system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
docker cp gstreamer-test:/output.mp4 ./output.mp4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 7: Preview the video on your host machine ==&lt;br /&gt;
&lt;br /&gt;
Open &amp;lt;code&amp;gt;output.mp4&amp;lt;/code&amp;gt; with any media player that supports MP4 and H.264, such as VLC or your system&amp;#039;s default video player.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;ve successfully created a Dockerized GStreamer environment with x264 encoding support. This is useful for rapid prototyping of pipelines, isolated testing, or running GStreamer apps on systems without native installations.&lt;br /&gt;
&lt;br /&gt;
For more GStreamer examples, pipeline debugging tips, or Docker use cases in embedded systems, explore our other tutorials.&lt;br /&gt;
&lt;br /&gt;
{{Footer}}&lt;/div&gt;</summary>
		<author><name>Andres</name></author>
	</entry>
</feed>