sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
sudo dnf install gstreamer1-devel gstreamer1-plugins-base-tools gstreamer1-doc gstreamer1-plugins-base-devel gstreamer1-plugins-good gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel gstreamer1-plugins-bad-free-extras
sudo pacman -S gstreamer gst-plugins-{base,good,bad,ugly} python python-gobject
Follow the official docs But i woud recommend following this docs.rocos.io/prod/docs/gstreamer-on-windows
How to run:
git clone https://github.com/Ujjwal-Shekhawat/gstreamer
cd gstreamer
python3 main.py --help
python3 main.py -h
gives information about avalable cli options
usage: main.py [-h] -f -o [-fl ] [-r ] [-px ] [-py ] [-sx ] [-sy ]
Gstreamer pipeline
options:
-h, --help show this help message and exit
-f , --inputfile Input file path
-o , --overlay Overlay file path
-fl [], --filter [] Filter to apply
-r [], --rotation [] Rotatioon of the file. Range (0 - 1) is in Radians
-px [], --positionx []
X Position of the overlay releative to the input file (range 0 - 1)
-py [], --positiony []
Y Position of the overlay releative to the input file (range 0 - 1)
-sx [], --scalex [] Set the scale of the overlay
-sy [], --scaley [] Set the scale of the overlay
An example to overlay an image on top of a video and apply a filter on the video
python3 main.py -f /path/to/vid.ogg -o /path/to/overlay.jpg -fl frei0r-filter-emboss
The above command takes an ogg video format input file and an image format overlay file. It overlays the image on the video and applies the frei0r-filter-emboss filter and then it writes the output as an video.mp4.
Another example which takes two image format imputs and overlays one on top of the other and writes the output on image.{jpg,png}
python3 main.py -f /path/to/image -o /path/to/overlayimage -sx 0.5 -sy 0.5
The above command takes two image format inputs and overlays one on top of the other.
-sx 0.5
sets the x-position of the overlay to the center position releative to the imput image width.
-sy 0.5
sets the y-position of the overlay to the center position releative to the input image height.
command: python3 main.py -f 1.jpg -o 1.png
Image 1 | Image 2 |
---|---|