How to definde streaming SOURCE port of VLC?

About encoding, codec settings, muxers and filter usage
Adamus
Blank Cone
Blank Cone
Posts: 11
Joined: 27 Mar 2006 17:33

How to definde streaming SOURCE port of VLC?

Postby Adamus » 05 Apr 2006 08:43

Hello everybody!

For streaming vlc needs to know the destination IP and port, but decides automatically which source port will be used. I need to know the source port.

How can I define the streaming source port for VLC?

Tkanks Adamus

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

Postby Rémi Denis-Courmont » 09 Apr 2006 11:23

Which access output module are you using?
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Adamus
Blank Cone
Blank Cone
Posts: 11
Joined: 27 Mar 2006 17:33

Output

Postby Adamus » 11 Apr 2006 10:52

Hi!

I am using the standard output.
Here an example for streaming webcam pictures to another machine:

vlc dshow:// :dshow-vdev="Logitech ClickSmart 510" :dshow-adev="" :dshow-size="640x480"
:sout=#transcode{vcodec=mp4v,vb=1024,scale=1}
:duplicate{dst=std{access=udp,mux=ts,
url=[2001:6f8:1391:4:2c1:26ff:fe07:dac5]:1234}}

Every time I start the streaming process, the source port is changing (between 1024 and something about 1050), but I need a static port for mesurements.

How can I setup VLC to stream always from emp.: ths port 1030?

Thanks, Adamus

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

Postby Rémi Denis-Courmont » 11 Apr 2006 12:44

This is not supported. This is not quite compatible with the IPv6/IPv4 agnostic API framework (getaddrinfo et al).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sMiLe

Postby sMiLe » 30 Apr 2006 11:36

Hi,

sorry for bringing this matter up again, but I have a question that is closely related to this one.

I'm starting the VLC as a process from within a Java program. is there any way to tell VLC which port to use for RTP transmission or even to determine which port VLC chose for transmission? FYI, I need this information about the source port for QoS reservation before the actual transmission starts in the ideal case.

Kind regards,
sMiLe

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

Postby Rémi Denis-Courmont » 30 Apr 2006 11:47

Telling an application to use some predefined port really sucks by design (there are various well documented issues with using sockets that way), so this is not implemented and it's not going to be.

The only proper solution would be to call getsockname() after the socket was connected and to find out the port assigned by the kernel. But this is currently not implemented. You know, printing a debug message would be trivial, but that's about it. If you have a better idea...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Guest

Postby Guest » 30 Apr 2006 15:08

Hello,

thanks for your quick reply. I understand that assigning a source port in such manner sucks. But can you understand my problem as well? In the experimental QoS system I'm using, the reservation is based on protocol, source IP and port and destination IP and port and therefore I need to know the sourceport before I can make any reservation.

If I understood your answer correctly, then you see the main problem in how to return the source port to the calling java program in my case, is this correct?
Could you tell me in which source file I could call getsockname() for figuring out how I could get this info to the calling process? maybe in upd.c for RTP?

Thanks in advance and best regards,
sMiLe

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

Postby Rémi Denis-Courmont » 30 Apr 2006 15:15

Yes, that's my concern. And indeed, the socket should be in modules/access/udp.c or modules/access_output/udp.c
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sMiLe

Postby sMiLe » 04 May 2006 16:20

Hello again,

I'm trying to get hold of the source port in the source code of access_output/udp.c and pass it to stdout so that I can read this info in my Java program. Unfortunately, I could not figure out where the socket is created and how I can retrieve the port information. Could you please give me another hint? It would really appreciate it!

Best regards,
sMiLe

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

Postby Rémi Denis-Courmont » 04 May 2006 17:38

The socket is created via the net_ConnectUDP() function call that is called from within the Open(). It's called i_handle.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

wang
Blank Cone
Blank Cone
Posts: 31
Joined: 17 Mar 2006 15:02

Postby wang » 05 May 2006 17:52

Hi Smile !!!
I am new in Java, but I think there is one method you can use to get VLC socket: Socket.getPort() . Thus you'll just have to set up your listenning port and then, you'll get VLC's one.

I hope, it will help you. Tell me if it does !!!!
Good luck

wang
Blank Cone
Blank Cone
Posts: 31
Joined: 17 Mar 2006 15:02

Postby wang » 05 May 2006 17:54

PS: this method is available in JDK 1.5

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

Postby Rémi Denis-Courmont » 05 May 2006 17:58

I think this is utterly helpless. VLC is not written in Java, and the socket is not allocated by Java either.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

wang
Blank Cone
Blank Cone
Posts: 31
Joined: 17 Mar 2006 15:02

Postby wang » 06 May 2006 09:06

You are right, VLC is not a Java project :lol: ;

I was just thinking, it is possible to get remote socket informations in Java when two applications are running on the same network. And i was also thinking his project might imply two apps: a Java one and VLC.
Of course, you 'll need to start a stream before getting any piece of information. :cry:

Switching to another topic I would like to ask you a question: Does VLC demux a stream into multiple tracks before sending it on a network when you use RTSP?

OK have to go now!!!! And I wish to all French people a nice long week-end !!!! :D

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

Postby Rémi Denis-Courmont » 06 May 2006 09:31

AFAICT, VLC separates audio from video when using RTSP.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

wang
Blank Cone
Blank Cone
Posts: 31
Joined: 17 Mar 2006 15:02

Postby wang » 08 May 2006 13:13

Thanks for your quick answer... I'll try to separate tracks and stream them on the same UDP port to finalize my VoD server....

:) Just a little question: When I set UDP stream with Wxwidget interface, data are sent on a unique port... but are the tracks (audio and video) already demuxed when it is send?
Thank you in advance for your answer.... :)

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

Postby Rémi Denis-Courmont » 08 May 2006 16:14

I guess you should use the “vlm” VoD server if you want to use multiple ports... that should support sending SDP with different RTP/UDP ports.

If you use plain UDP, then everything goes to the same port. And yes, everything will have been demuxed then re-muxed, depending on the “mux” chosen (normally MPEG-TS).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 19 guests