input sdp information from file with VLCJ

This forum is about all development around libVLC.
TheMagge
New Cone
New Cone
Posts: 3
Joined: 20 Aug 2014 14:12

input sdp information from file with VLCJ

Postby TheMagge » 20 Aug 2014 14:22

Hey there

Looking around here got me to try several things.
It is my first time trying to input options into the mediaplayer so i do not know the correct syntax here.

Plz help withe the following:

Im using libstreamer together with android to send a rtp stream to vlc and a PC. If im saving the sdp in a file.sdp and opens it with vlc it works. Video and audio.
The first thing i tried were to open the same file like:

Code: Select all

String mrl = "C:\\folder\\ws.sdp"; p.playMedia( mrl );
did not work. So the next thing were to look into the options and ended up with:

mediaPlayer.playMedia(mrl, option);
2 questions: how to define the mrl? video port 5006 and audio port 5010.
How do i load in the sdp file or are there a third option to just like "click" the file.sdp?

Code: Select all

mediaPlayer.playMedia("rtp://@:5006/", "sout=#transcode{vcodec=h264}", ":sout=#rtp{sdp=file:C:\\folder\\ws.sdp}", ":no-sout-rtp-sap", ":no-sout-standard-sap", ":sout-all", ":rtp-caching=100", ":sout-keep");
.sdp informations

Code: Select all

v=0 o=- 0 0 IN IP4 null s=Unnamed i=N/A c=IN IP4 10.251.1.125 t=0 0 a=recvonly m=audio 5010 RTP/AVP 96 a=rtpmap:96 AMR/8000 a=fmtp:96 octet-align=1; a=control:trackID=0 m=video 5006 RTP/AVP 96 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1;profile-level-id=428014;sprop-parameter-sets=Z0KAFNoFB+gG0KE1,aM4G4g==; a=control:trackID=1

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: input sdp information from file with VLCJ

Postby Rémi Denis-Courmont » 20 Aug 2014 18:04

There are two ways to play a declarative SDP, either pass the URL of a file that contains it, or pass the SDP as is preceded by "sdp://" (i.e. "sdp://v=0\r\no="...).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

TheMagge
New Cone
New Cone
Posts: 3
Joined: 20 Aug 2014 14:12

Re: input sdp information from file with VLCJ

Postby TheMagge » 21 Aug 2014 09:23

There are two ways to play a declarative SDP, either pass the URL of a file that contains it, or pass the SDP as is preceded by "sdp://" (i.e. "sdp://v=0\r\no="...).
Hey there ty for a quick response.
I tried the following and it did't work. Can you plz be more specific? As i wrote i am not sure about the syntax for writing this to VLC. Thanks in advance.

Code: Select all

mrl = "sdp://v=0\r\\o=- 0 0 IN IP4 null\r\\s=Unnamed\r\\i=N/A\r\\c=IN IP4 192.168.1.5\r\\t=0 0\r\\a=recvonly\r\\m=audio 5010 RTP/AVP 96\r\\a=rtpmap:96 AMR/8000\r\\a=fmtp:96 octet-align=1;\r\\a=control:trackID=0\r\\m=video 5006 RTP/AVP 96\r\\a=rtpmap:96 H264/90000\r\\a=fmtp:96 packetization-mode=1;profile-level-id=428014;sprop-parameter-sets=Z0KAFNoFB+gG0KE1,aM4G4g==;\r\\a=control:trackID=1\r\\"; p.playMedia( mrl );
either pass the URL of a file that contains it
I got the file to work. Just like opening it with VLC :D

I will appreciate if you would explain the second possibility even further due to it being the best choice for my program.

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: input sdp information from file with VLCJ

Postby Rémi Denis-Courmont » 21 Aug 2014 18:41

I cannot be more specific than specific, no.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: input sdp information from file with VLCJ

Postby sherington » 21 Aug 2014 19:07

I can't answer your specific question, but something you can try with vlcj is to change your original code to something like this:

Code: Select all

String mrl = "C:\\folder\\ws.sdp"; p.setPlaySubItems(true) p.playMedia( mrl );

TheMagge
New Cone
New Cone
Posts: 3
Joined: 20 Aug 2014 14:12

Re: input sdp information from file with VLCJ

Postby TheMagge » 22 Aug 2014 07:21

I can't answer your specific question, but something you can try with vlcj is to change your original code to something like this:

Code: Select all

String mrl = "C:\\folder\\ws.sdp"; p.setPlaySubItems(true) p.playMedia( mrl );

That worked just like opening it with VLC it self.

What i wish to do, is to open it without using a file. If i could just input a string with the sdp information inside and then playMedia(sdp_String).
That would be truly awesome!

chuck2nd
Blank Cone
Blank Cone
Posts: 13
Joined: 28 Sep 2012 14:36

Re: input sdp information from file with VLCJ

Postby chuck2nd » 25 Sep 2014 16:44

or pass the SDP as is preceded by "sdp://" (i.e. "sdp://v=0\r\no="...).
Per above direction I was hoping you could pass vlc the sdp as a parameter. I have tried many variations of below to no effect.

Code: Select all

vlc "sdp://v=0\r\nC=IN IP4 239.192.8.8\r\nm=video 15099 RTP/AVP 96\r\na=rtpmap:96 H264/90000"
Is it not possible to pass sdp file dynamically as a vlc parameter? I have a situation in a locked down environment where I can not access an external file.

thanks,

Chuck
Chuck Harnden
Qinetiq North America
Kennedy Space Center

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: input sdp information from file with VLCJ

Postby Rémi Denis-Courmont » 25 Sep 2014 17:45

How to format command line parameters depends on your shell or OS. VLC does not intervene here.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests