GStreamer: Difference between revisions

Malix (talk | contribs)
mNo edit summary
DHCP (talk | contribs)
m replace lang=nix with lang=console for shell commands
 
(One intermediate revision by the same user not shown)
Line 33: Line 33:


To activate this environment in your terminal run
To activate this environment in your terminal run
<syntaxhighlight lang="nix">
<syntaxhighlight lang=console>
$ nix develop  
$ nix develop  
</syntaxhighlight>
</syntaxhighlight>
Line 40: Line 40:
== Test the installation ==
== Test the installation ==
You can test that the <code>gst_all_1.gstreamer</code> tools are available by running a dummy pipeline
You can test that the <code>gst_all_1.gstreamer</code> tools are available by running a dummy pipeline
<syntaxhighlight lang="nix">
<syntaxhighlight lang=console>
$ gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
$ gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
</syntaxhighlight>
</syntaxhighlight>
Line 46: Line 46:


You can test that the plugins like from <code>gst_all_1.gst-plugins-base</code> are available to the higher level tools by inspecting such a base plugin like <code>filesrc</code> with
You can test that the plugins like from <code>gst_all_1.gst-plugins-base</code> are available to the higher level tools by inspecting such a base plugin like <code>filesrc</code> with
<syntaxhighlight lang="nix">
<syntaxhighlight lang=console>
$ gst-inspect-1.0 filesrc
$ gst-inspect-1.0 filesrc
Factory Details:
Factory Details:
Line 62: Line 62:
or by using it in a pipeline. Here, we could play a video from the local machine with
or by using it in a pipeline. Here, we could play a video from the local machine with


<syntaxhighlight lang="nix">
<syntaxhighlight lang=console>
$ gst-launch-1.0 filesrc location=my_video.mp4 ! videoconvert ! autovideosink
$ gst-launch-1.0 filesrc location=my_video.mp4 ! videoconvert ! autovideosink
</syntaxhighlight>
</syntaxhighlight>


If the plugins are not correctly made available to the higher level tools, you'll get an error
If the plugins are not correctly made available to the higher level tools, you'll get an error
<syntaxhighlight lang="nix">
<syntaxhighlight lang=console>
$ gst-inspect-1.0 filesrc
$ gst-inspect-1.0 filesrc
No such element or plugin 'filesrc'
No such element or plugin 'filesrc'
Line 79: Line 79:
Adding the following export to your script, sets "gstreamer" and "gst-plugins-base" and "gst-plugins-good" paths. Similarly you can add any other "gst-plugins" package as well.
Adding the following export to your script, sets "gstreamer" and "gst-plugins-base" and "gst-plugins-good" paths. Similarly you can add any other "gst-plugins" package as well.


<syntaxhighlight lang="shell">
<syntaxhighlight lang="bash">
export GST_PLUGIN_SYSTEM_PATH_1_0="${gst_all_1.gstreamer.out}/lib/gstreamer-1.0:${gst_all_1.gst-plugins-base}/lib/gstreamer-1.0:${gst_all_1.gst-plugins-good}/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH_1_0="${gst_all_1.gstreamer.out}/lib/gstreamer-1.0:${gst_all_1.gst-plugins-base}/lib/gstreamer-1.0:${gst_all_1.gst-plugins-good}/lib/gstreamer-1.0"
</syntaxhighlight>Note: "gstreamer.out" is the derivative that contains "/lib" directory for that package.
</syntaxhighlight>Note: "gstreamer.out" is the derivative that contains "/lib" directory for that package.
<references />
<references />
Line 89: Line 88:
To fix the issue I found the following solutions:
To fix the issue I found the following solutions:


* Using <code>nix-shell</code>:<syntaxhighlight lang="bash">
* Using <code>nix-shell</code>:
nix-shell -p gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-ugly gst_all_1.gst-libav gst_all_1.gst-vaapi --run "nautilus"
<syntaxhighlight lang=console>
$ nix-shell -p gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-ugly gst_all_1.gst-libav gst_all_1.gst-vaapi --run "nautilus"
</syntaxhighlight>
</syntaxhighlight>
*Using the environment variable "<code>GST_PLUGIN_PATH</code>":[[File:Screenshot From 2025-03-28 12-51-31.png|thumb|"Audio and Video Properties" of "Properties" window of nautilus after fix]]{{File|3={ config, pkgs, ... }:
* Using the environment variable "<code>GST_PLUGIN_PATH</code>":[[File:Screenshot From 2025-03-28 12-51-31.png|thumb|"Audio and Video Properties" of "Properties" window of nautilus after fix]]{{File|3={ config, pkgs, ... }:


{
{