receiving rtsp and send it to UDP

797 views
Skip to first unread message

Farshid Bakhtyari

unread,
Apr 30, 2018, 1:45:22 PM4/30/18
to gstreamer-java
Hello All,

I have an IP camera streaming  h264 over rtsp. 

In my video controller (in Java) , I have the following to capture the stream , save a copy and then forward the video over UDP. Here is my command (sending end):


 Bin bin = Bin.launch("tee name=t  t.  ! queue ! videoconvert ! autovideosink "

  +" t. ! queue ! videoconvert ! videoscale ! capsfilter caps=video/x-raw,width=640,height=480 ! appsink name=appsink "

  +" t. ! queue ! matroskamux ! filesink location=./MultiSinkPlayBin.mkv"

  + " t. ! queue ! videoconvert ! udpsink host=127.0.0.1 port=5432", true );


I am using the MultiSinkExample code. The playbin's URI is set to the camera's URL. 


The video stream shows up and the file gets created with video. But I cannot get the UDP working. 



(On the receiving end):

In order to receive the video over UDP I am issuing the following from command line:


gst-launch  -e udpsrc port=5432 !  filesink location=./UDP3IPIP.mkv


What am I doing wrong? 


I would appreciate your help.


Thanks,

Farshid




Farshid Bakhtyari

unread,
May 1, 2018, 9:28:55 AM5/1/18
to gstreamer-java
Hello All, 

Anyone, any hint? I would appreciate your time and help on this issue.

Thanks,
Farshid

Neil C Smith

unread,
May 2, 2018, 10:31:12 AM5/2/18
to gstream...@googlegroups.com
Hi,

I'll have a look properly next week. But try drawing out your pipeline on paper and noting the data passing through each element / connection. An obvious problem is that there is only a matroskamux before the filesink, not the udpsink. But I would probably add a second tee. Get rid of either the appsink or autovideosink section too.

Best wishes, 

Neil

--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-jav...@googlegroups.com.
To post to this group, send email to gstream...@googlegroups.com.
Visit this group at https://groups.google.com/group/gstreamer-java.
For more options, visit https://groups.google.com/d/optout.
--
Neil C Smith
Artist & Technologist

Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org

Farshid Bakhtyari

unread,
May 2, 2018, 11:44:53 AM5/2/18
to gstreamer-java
Thanks a lot, Neil. 

I will take your advice and see if I make any progress, and will let you know. 
I also look forward to your suggestions sometimes next week.

Thanks again,
Farshid

On Monday, April 30, 2018 at 1:45:22 PM UTC-4, Farshid Bakhtyari wrote:

Farshid Bakhtyari

unread,
May 3, 2018, 12:25:01 PM5/3/18
to gstreamer-java
Hello All,

Finally, I managed to get the updsrc/udpsink working. But I don't know in depth what was wrong and why it's working now. I assume it had to do with encoding and decoding (rtph264pay and rtph264depay) the stream. 

here is what I did on sending (or forwarding) part :

Bin bin = Bin.launch("tee name=t  " 

  +" t. ! queue ! videoconvert ! videoscale ! capsfilter caps=video/x-raw,width=640,height=480 ! videorate ! video/x-raw,framerate=1/3 ! appsink name=appsink "

  + " t. ! queue ! videorate ! video/x-raw,framerate=1/3 ! x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=5432 ", true);



and on the receiving end: I issued this on the command line:


gst-launch-1.0 -e -v udpsrc port=5432  ! "application/x-rtp, payload=127" ! rtph264depay ! decodebin ! glimagesink


 


Since I am new to gstreamer and all its intricacies, I will continue educating myself. 


The original signal/uri from the camera was :

rtsp://192.168.0.92/axis-media/media.amp?videocodec=h264&camera=1


I am wondering if I can do this better (more efficient) in any form or shape. Anyone has any idea how can I improve this stream?


I would greatly appreciate your inputs and suggestions.


Thanks,

Farshid






On Monday, April 30, 2018 at 1:45:22 PM UTC-4, Farshid Bakhtyari wrote:
Reply all
Reply to author
Forward
0 new messages