Bin Launch with error on udpsrc

248 views
Skip to first unread message

Farshid Bakhtyari

unread,
Jun 8, 2018, 2:20:50 PM6/8/18
to gstreamer-java
Hello All,

I hope all is well. 

I am trying to use the sample program to run my application in Java. 

From command line I can issue the following without any issue:

/Library/Frameworks/GStreamer.framework/Commands/gst-launch-1.0 -e -v udpsrc port=6004  ! "application/x-rtp, payload=127" ! rtph264depay  ! mpegtsmux ! hlssink max-files=10 playlist-root=http://127.0.0.1:8888/ location=/hlssink%05d.ts playlist-location=/usr/local/var/www/farplaylist.m3u8

The far playlist.m3u8 file along with the *.ts files get created fine.

Now when I try to the same thing in java I get the following error:
(unknown:90294): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed


portion of my java code:

String launchString. (see below for what the launchString has been, I have tried many different ones )
This error occurs when I call the Bin.launch(launchString);

I have tried many different launchString and all of them complains about the same error above.

launchString has been:

1:   launchString = "  udpsrc port=6004  ! \"application/x-rtp, payload=127\" ! rtph264depay  ! mpegtsmux ! hlssink max-files=10 playlist-root=http://127.0.0.1:8888/ location=/hlssink%05d.ts playlist-location=/usr/local/var/www/farplaylist.m3u8 ";

2:    launchString = " uri=udp://127.0.0.1:6004 ! \"application/x-rtp, payload=127\" ! rtph264depay  ! mpegtsmux ! hlssink max-files=10  playlist-root=http://127.0.0.1:8888/  location=./hlssink%05d.ts playlist-location=/usr/local/var/www/farplaylist.m3u8 ";

3:     launchString = " uri=udp://192.168.30.151:6004 ! \"application/x-rtp, payload=127\" ! rtph264depay  ! mpegtsmux ! hlssink max-files=10  playlist-root=udp://192.168.30.151:8888/  location=./hlssink%05d.ts playlist-location=/usr/local/var/www/farplaylist.m3u8 ";


From the last call, I am getting the following error (My code is also printing the launch string):


The Launch String is  uri=udp://192.168.30.151:6004 ! "application/x-rtp, payload=127" ! rtph264depay  ! mpegtsmux ! hlssink max-files=10  playlist-root=http://192.168.30.151:8888/  location=./hlssink%05d.ts playlist-location=/usr/local/var/www/farplaylist.m3u8 


(unknown:90349): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

 exception streaming video syntax error



What am I doing wrong?


I would appreciate your help.


Thanks,

Farshid


 

Farshid Bakhtyari

unread,
Jun 11, 2018, 9:10:40 AM6/11/18
to gstreamer-java
Anyone out there that can help me out on this? I would greatly appreciate your help. Thanks, Farshid

I made my Bin.Launch string look like the one I entered on the command line and still getting the uri error.  What is wrong with my uri? 

I have tried all direct strings for uri and all of them complaining about uri with different error code returned. 

I have tired:

uri=udp://127.0.0.1:6004

port=6004

uri=udp://my_host_ip_address:6004




-e -v udpsrc port=6004 ! "application/x-rtp, payload=127" ! rtph264depay  ! mpegtsmux ! hlssink max-files=10 playlist-root=http://127.0.0.1:8888/ location=/hlssink%05d.ts playlist-location=/Users/farshidbakhtyari/farplaylist.m3u8 



(unknown:94449): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed




What am I missing?



Thanks, 
Farshid

Neil C Smith

unread,
Jun 11, 2018, 10:22:12 AM6/11/18
to gstream...@googlegroups.com
Hi,

On Mon, 11 Jun 2018 at 14:10 Farshid Bakhtyari <farsh...@gmail.com> wrote:
I made my Bin.Launch string look like the one I entered on the command line and still getting the uri error.  What is wrong with my uri?

Firstly, it should be Pipeline.launch().

Secondly, I don't think it's a problem with any URI, it's the double quotes around the caps string.  These would be removed by the shell before passing to GStreamer.  Try without them.  I get the same error with, and none without, although can't check everything else works.

Best wishes,

Neil
--
Neil C Smith
Artist & Technologist

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

Farshid Bakhtyari

unread,
Jun 11, 2018, 10:23:10 AM6/11/18
to gstreamer-java


For those who might experience the same error. 

The error message was deceiving. 

I found out what my problem was:

I have the following text as part of my string "application/x-rtppayload=127\" once I removed the quotes the error went away. So now,  I have it as application/x-rtppayload=127 without any \". 

Thanks,
Farshid
On Friday, June 8, 2018 at 2:20:50 PM UTC-4, Farshid Bakhtyari wrote:

Farshid Bakhtyari

unread,
Jun 11, 2018, 1:35:27 PM6/11/18
to gstreamer-java
Hello Niel,

I truly appreciate your response. 

I made some progress but not there yet. 

Her his my command line string:


gst-launch-1.0 -e -v udpsrc uri=udp://127.0.0.1:6004  ! "application/x-rtp, payload=127" ! rtph264depay  ! mpegtsmux ! hlssink max-files=10 playlist-root=http://127.0.0.1:8888/ location=/hlssink%05d.ts playlist-location=/usr/local/var/www/farplaylist.m3u8


Everything works fine, the farplaylist.m3u8 and the hlssink**.ts files get created fine. I am trying to do the same thing via java code. Here is my code:


launchString = " tee name=t " +

" t. ! queue !  application/x-rtp, payload=127 ! rtph264depay  ! mpegtsmux  !  appsink name=appsink " +

" t. ! queue !  application/x-rtp, payload=127 ! rtph264depay  ! mpegtsmux  ! hlssink max-files=10 playlist-root=http://127.0.0.1:8888/ location=/hlssink%05d.ts playlist-location=/farplaylist.m3u8  ";

Bin bin = null;

System.out.println("streamCameraVideo : The Launch String is " + launchString );

try{

bin = Pipeline.launch(launchString, true);

                            

                        and the rest is


I create the playbin and try to set the URI for Playbin. My question is, what should be the Playbin URI.


I do set it to udp://127.0.0.1:6004. but no (*.m3u8 and *.ts )files get created. Any idea?


I am using your multi link example code as a base for this code here. I created the "AppSink" because the SimpleVideoComponent needs it. 


Thanks,

Farshid









On Friday, June 8, 2018 at 2:20:50 PM UTC-4, Farshid Bakhtyari wrote:

Farshid Bakhtyari

unread,
Jun 12, 2018, 9:23:36 AM6/12/18
to gstreamer-java

Anyone's help would greatly be appreciated here. 

Thanks,
Farshid

On Friday, June 8, 2018 at 2:20:50 PM UTC-4, Farshid Bakhtyari wrote:

Neil C Smith

unread,
Jun 12, 2018, 11:51:37 AM6/12/18
to gstream...@googlegroups.com
Hi,

This is starting to not make any sense to me - are you using udpsrc or playbin???

To replicate the pipeline you have on the CLI you would use Pipeline.launch(String desc) - no boolean argument - there is currently a PR in discussion that will change the names of those methods so they don't get confused.

To use the playbin with a custom sink, you'll need to use Bin, but you also cannot connect the undecoded video directly to appsink and display it.

May I ask what this project is for?

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.

Farshid Bakhtyari

unread,
Jun 12, 2018, 1:21:28 PM6/12/18
to gstreamer-java
Thanks Neil,

This is to show a remote source of video on a  web browser or  a mobile device. The source is from a UDP port.   That's why we are creating the *.m3u8 file and *.ts files so they can be displayed on the browser/mobile. 

I will try your advice in your email and see if I can make any progress.   All I am trying to do is to get the java version of the command line working.  I am new to this field (relatively) and still learning.

The configuration is this:

There are IP cameras connected to a Video Controller (Java code on a Linux device, I worked on it earlier)  and  a Video Server (this code that I am working on currently)  which connects to the Video Controller and gets the stream.   The Video Controller takes a rtsp video source and sends it to a UDP port. The Video Server connects to the Video Controller UDP port and get the video ready for a web browser/mobile. 

The Video Controller and the IP cameras are on the same network and physically close to each other. The Video Controller and Video Server are miles away from each other. 

If there is an easier way to this, please let me know.  

Thanks,
Farshid

On Friday, June 8, 2018 at 2:20:50 PM UTC-4, Farshid Bakhtyari wrote:

Farshid Bakhtyari

unread,
Jun 13, 2018, 2:52:01 PM6/13/18
to gstreamer-java

Hello All,


I resolved my issue. I used Pipeline as Neill suggested. 

I also wanted to express my gratitude and sincere thanks to Mr. Neil C Smith for supporting the gstreamer-java Code/Package and establishing this Google group to answer and address all the coding questions. 

Neil, you have been a great help and your suggestions/responses have helped me a lot in the course of the past few months.

Thanks a lot,
Farshid 


On Friday, June 8, 2018 at 2:20:50 PM UTC-4, Farshid Bakhtyari wrote:

Neil C Smith

unread,
Jun 13, 2018, 3:00:33 PM6/13/18
to gstream...@googlegroups.com
Emails like this make it all worthwhile! :-)

You're welcome.

Thanks and 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.
Reply all
Reply to author
Forward
0 new messages