MattsProjects / pylon_gstreamer

A robust integration of Basler's Pylon API with GStreamer. Delivers applications as ready-to-run standalone compiled executables (gst-launch-1.0 is not needed). Designed for reliability and easy access to performance optimizations. Note: This is not a plugin. It is an intergration using GStreamer's GstAppSrc element.
Apache License 2.0
29 stars 18 forks source link

Equivalent pipeline gst-launch-1.0 #22

Open Tidus84 opened 4 years ago

Tidus84 commented 4 years ago

Firsly, congratulations for your work! :-)

I'm working on a Basler camera and I'm studiyng your code in order to better understand gstreamer. In particularly, I'm interested to understand what's the equivalent pipeline in order to send a video streaming from my Basler camera...

E.g. If the demopylongstreamer ask me to launch the following command on the terminal of the receiver PC:

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! autovideosink sync=false async=false -e

If I wanted to experiment the equivalent command in order to launch a sender on the terminal:

gst-launch-1.0 appsrc ! videoconvert ! x264enc speed-preset=1 ! video/x-h264,stream-format=byte-stream ! rtph264pay ! udpsink host=127.0.0.1 port=5000 sync=false async=false

There's appsrc, because I'm writing a simple sender with C++ and OpenCV.

Is that comand correct? Because I tried it, but it doesn't work and the gstreamer documentation is gaunt... :-(

Thank your in advance for your response! :-)

frankSDeviation commented 4 years ago

Hello,

I am doing something similar as to what you wish to do. I could not get this program to completely work on my system but I was able to use the @joshdoe vision plugin. I can currently send two video streams with almost zero latency over UDP. The pipeline I am currently running for one camera is :

gst-launch-1.0 -v pylonsrc pixel-format=mono8 width=1600 height=1200 ! "video/x-raw,format=GRAY8" ! videoflip method=vertical-flip ! videoconvert ! x264enc bitrate=30000 speed-preset=superfast qp-min=30 tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=5000

On the receiver PC, I am running this pipeline:

gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! queue ! decodebin ! videoconvert ! videoscale ! autovideosink sync=true

I hope this information helps! I am sure these pipelines will work on this program. This pipeline might work with the "parse" argument in the demopylongstreamer sample.

Cheers, Frank

MattsProjects commented 2 years ago

Hi, So sorry I am seeing this so late!!! :-(. This program does not create a source plugin that can be used with gst-launch. It creates a fully finished application. The gstreamer people really only intend for gst-launch to be used for testing/debugging (although I think most people make up pipelines with it and put them into some shell scripts to create the "application" :)). For example, you can use gst-launch and gstreamer's test camera source to experiment with different pipelines for streaming across networks, saving to disk, etc. Then once you have that backend pipeline as you like it, you can copy/paste the configuration into this project's sample code. Then once you build it, you have a final binary you can run and ship, like a windows .exe