Page 1 of 1
How to definde streaming SOURCE port of VLC?
Posted: 05 Apr 2006 08:43
by Adamus
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
Posted: 09 Apr 2006 11:23
by Rémi Denis-Courmont
Which access output module are you using?
Output
Posted: 11 Apr 2006 10:52
by Adamus
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
Posted: 11 Apr 2006 12:44
by Rémi Denis-Courmont
This is not supported. This is not quite compatible with the IPv6/IPv4 agnostic API framework (getaddrinfo et al).
Posted: 30 Apr 2006 11:36
by sMiLe
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
Posted: 30 Apr 2006 11:47
by Rémi Denis-Courmont
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...
Posted: 30 Apr 2006 15:08
by Guest
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
Posted: 30 Apr 2006 15:15
by Rémi Denis-Courmont
Yes, that's my concern. And indeed, the socket should be in modules/access/udp.c or modules/access_output/udp.c
Posted: 04 May 2006 16:20
by sMiLe
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
Posted: 04 May 2006 17:38
by Rémi Denis-Courmont
The socket is created via the net_ConnectUDP() function call that is called from within the Open(). It's called i_handle.
Posted: 05 May 2006 17:52
by wang
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
Posted: 05 May 2006 17:54
by wang
PS: this method is available in JDK 1.5
Posted: 05 May 2006 17:58
by Rémi Denis-Courmont
I think this is utterly helpless. VLC is not written in Java, and the socket is not allocated by Java either.
Posted: 06 May 2006 09:06
by wang
You are right, VLC is not a Java project
;
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.
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 !!!!
Posted: 06 May 2006 09:31
by Rémi Denis-Courmont
AFAICT, VLC separates audio from video when using RTSP.
Posted: 08 May 2006 13:13
by wang
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....
Posted: 08 May 2006 16:14
by Rémi Denis-Courmont
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).