how do i get the port for vlc

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

how do i get the port for vlc

Postby silvara » 30 Oct 2008 18:00

Hi People;

I am wondering about how can i get or set the port for vlc to start streaming.I am using below command for streaming

Code: Select all

vlc -vvv v4l:// :v4l-vdev="/dev/video0" --sout='#transcode{vcodec=h264,vb=1024,width=320,height=240}:rtp{dst=192.168.0.220,video-port=6000,sdp=file:///home/silvara/Desktop/test.sdp}'
Video is going to port 6000 but released from random port .. I need to get this random port or any way to set the port by manually ?

Code: Select all

vlc -vvv v4l:// :v4l-vdev="/dev/video0" --sout='#transcode{vcodec=h264,vb=1024,width=320,height=240}:rtp{dst=192.168.0.220,port=5000,video-port=6000,sdp=file:///home/silvara/Desktop/test.sdp}'
this didnt work.. i thought this command would start stream from my 5000 port to remote computers 6000..
Please comment

thank you

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: how do i get the port for vlc

Postby Arite » 30 Oct 2008 18:14

This may not work however try:

Code: Select all

vlc -vvv v4l:// :v4l-vdev="/dev/video0" :sout-rtp-port=5000 --sout='#transcode{vcodec=h264,vb=1024,width=320,height=240}:rtp{dst=192.168.0.220:6000,sdp=file:///home/silvara/Desktop/test.sdp}'
--sout-rtp-port specifies the base port for RTP streaming.

The "dst=192.168.0.220:6000" hopefully will work too :P.

Arite.
Don't use PMs for support questions.

silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

Re: how do i get the port for vlc

Postby silvara » 30 Oct 2008 18:34

none of them works.. As i can see vlc sets what i configure for ports. but from wireshark capture program i can see the source port is 39902 and destination is 60000
:roll:

Code: Select all

[00000001] main private debug: looking for memcpy module: 1 candidate [00000001] main private debug: using memcpy module "memcpy" [00000285] main playlist debug: waiting for thread completion [00000285] main playlist debug: thread 3080154000 (playlist) created at priority 0 (playlist/playlist.c:184) [00000286] main private debug: waiting for thread completion [00000286] main private debug: thread 3071761296 (preparser) created at priority 0 (playlist/playlist.c:210) [00000287] main interface debug: looking for interface module: 1 candidate [00000287] main interface debug: using interface module "hotkeys" [00000287] main interface debug: thread 3063368592 (interface) created at priority 0 (interface/interface.c:231) [00000289] main interface debug: looking for interface module: 1 candidate [00000289] main interface debug: using interface module "screensaver" [00000289] main interface debug: thread 3054975888 (interface) created at priority 0 (interface/interface.c:231) [00000285] main playlist debug: adding playlist item `v4l://' ( v4l:// ) [00000291] main interface debug: looking for interface module: 5 candidates [00000291] main interface debug: using interface module "wxwidgets" [00000291] main interface debug: thread 3028614032 (manager) created at priority 0 (interface/interface.c:216) [00000291] wxwidgets interface debug: Using last windows config '(-1,0,0,1440,900)(0,235,117,425,86)(6,0,0,-1,150)' [00000291] wxwidgets interface debug: id=0 p=(235,117) s=(425,86) [00000291] wxwidgets interface debug: id=6 p=(0,0) s=(-1,150) [00000285] main playlist debug: nothing requested, starting [00000285] main playlist debug: creating new input thread [00000294] main input debug: waiting for thread completion [00000294] main input debug: creating statistics handler [00000296] main stream output debug: stream=`transcode' [00000297] main private debug: looking for sout stream module: 1 candidate [00000296] main stream output debug: stream=`rtp' [00000300] main private debug: looking for sout stream module: 1 candidate [b][00000300] main private debug: set sout option: sout-rtp-dst to 192.168.0.220 [00000300] main private debug: set sout option: sout-rtp-port to 50000 [00000300] main private debug: set sout option: sout-rtp-port-video to 60000[/b] [00000300] main private debug: set sout option: sout-rtp-sdp to file:///home/silvara/Desktop/test.sdp [00000300] main private debug: using sout stream module "stream_out_rtp" [00000297] main private debug: set sout option: sout-transcode-vcodec to h264 [00000297] main private debug: set sout option: sout-transcode-vb to 1024 [00000297] main private debug: set sout option: sout-transcode-width to 320 [00000297] main private debug: set sout option: sout-transcode-height to 240 [00000297] stream_out_transcode private debug: codec video=h264 320x240 scaling: 1.000000 1024kb/s [00000297] main private debug: using sout stream module "stream_out_transcode" [00000294] main input debug: `v4l://' gives access `v4l' demux `' path `' [00000294] main input debug: creating demux: access='v4l' demux='' path='' [00000302] main demuxer debug: looking for access_demux module: 1 candidate [00000294] main input debug: thread 3011398544 (input) created at priority 0 (input/input.c:265) [00000302] v4l demuxer debug: V4L device Generic Vimicro 303b 1 channels 0 audios 160 < w < 640 120 < h < 480 [00000302] v4l demuxer debug: invalid width 0 [00000302] v4l demuxer debug: invalid height 0 [00000302] v4l demuxer debug: setting channel ZC301-2(0) 0 tuners flags=0x0 type=0x2 norm=0xb7e9 [00000302] v4l demuxer debug: will use 320x240 [00000302] v4l demuxer debug: v4l device uses brightness: 32768 [00000302] v4l demuxer debug: v4l device uses colour: 0 [00000302] v4l demuxer debug: v4l device uses hue: 0 [00000302] v4l demuxer debug: v4l device uses contrast: 32768 [00000302] v4l demuxer debug: v4l device uses frame size: 115200 [00000302] v4l demuxer debug: v4l device uses chroma: I420 [00000302] v4l demuxer debug: opened adev=`/dev/dsp' stereo 44100Hz [00000302] v4l demuxer debug: v4l grabbing started [00000302] v4l demuxer debug: added new video es I420 320x240 [00000294] main input debug: selecting program id=0 [00000302] v4l demuxer debug: new audio es 2 channels 44100Hz [00000302] main demuxer debug: using access_demux module "v4l" [00000304] main packetizer debug: looking for packetizer module: 17 candidates [00000304] main packetizer debug: using packetizer module "rawvideo" [00000304] main packetizer debug: thread 2998651792 (decoder) created at priority 0 (input/decoder.c:159) [00000318] main packetizer debug: looking for packetizer module: 17 candidates [00000318] main packetizer debug: using packetizer module "packetizer_copy" [00000318] main packetizer debug: thread 2990156688 (decoder) created at priority 0 (input/decoder.c:159) [00000294] main input debug: starting in sync mode [00000294] main input debug: `v4l://' successfully opened [00000296] main stream output debug: adding a new input [00000297] stream_out_transcode private debug: creating video transcoding from fcc=`I420' to fcc=`h264' [00000336] main decoder debug: looking for decoder module: 25 candidates [00000336] main decoder debug: using decoder module "rawvideo" [00000337] main encoder debug: looking for encoder module: 8 candidates [00000337] x264 encoder debug: version x264 0.57.X x264 [info]: [00000296] main stream output debug: adding a new input using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 Cache64 [00000337] main encoder debug: using encoder module "x264" [00000337] main encoder debug: removing module "x264" [00000297] stream_out_transcode private debug: not transcoding a stream (fcc=`s16l') [00000362] main private debug: looking for sout access module: 1 candidate [00000362] main private debug: set sout option: sout-udp-raw to (null) [00000362] main private debug: net: connecting to 192.168.0.220 port 1230 [00000364] main private debug: thread 2974559120 (sout write thread) created at priority 0 (udp.c:268) [00000362] access_output_udp private debug: udp access output opened(192.168.0.220:1230) [00000362] main private debug: using sout access module "access_output_udp" [00000300] stream_out_rtp private debug: access out udp{raw}:192.168.0.220:1230 [00000300] stream_out_rtp private error: cannot add this stream (unsupported codec:s16l) [00000364] access_output_udp private debug: packet has been sent too late (1225398484705613) [00000364] main private debug: thread 2974559120 joined (udp.c:316) [00000362] access_output_udp private debug: udp access output closed [00000362] main private debug: removing module "access_output_udp" [00000318] main packetizer error: cannot create packetizer output (s16l) [00000297] stream_out_transcode private debug: decoder aspect is 576000:432000 [00000297] stream_out_transcode private debug: source pixel aspect is 1.000000:1 [00000297] stream_out_transcode private debug: scaled pixel aspect is 1.000000:1 [00000297] stream_out_transcode private debug: source 320x240, crop 320x240, destination 320x240, padding 320x240 [00000297] stream_out_transcode private debug: encoder aspect is 576000:432000 [00000337] main encoder debug: looking for encoder module: 8 candidates [00000337] x264 encoder debug: version x264 0.57.X x264 [info]: using SAR=1/1 x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 Cache64 [00000337] main encoder debug: using encoder module "x264" [00000365] main private debug: looking for sout access module: 1 candidate [00000365] main private debug: set sout option: sout-udp-raw to (null) [00000365] main private debug: net: connecting to 192.168.0.220 port 60000 [00000366] main private debug: thread 2974559120 (sout write thread) created at priority 0 (udp.c:268) [00000365] access_output_udp private debug: udp access output opened(192.168.0.220:60000) [00000365] main private debug: using sout access module "access_output_udp" [00000300] stream_out_rtp private debug: access out udp{raw}:192.168.0.220:60000 [00000300] stream_out_rtp private debug: we found a startcode for NAL with TYPE:6 [00000300] stream_out_rtp private debug: we found a startcode for NAL with TYPE:7 [00000300] stream_out_rtp private debug: we found a startcode for NAL with TYPE:8 [00000300] stream_out_rtp private debug: maximum RTP packet size: 1450 bytes

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

Re: how do i get the port for vlc

Postby Rémi Denis-Courmont » 30 Oct 2008 19:08

This is not implemented.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

Re: how do i get the port for vlc

Postby silvara » 30 Oct 2008 19:43

thank you for the info... Actually i am using libvlc api.. is there API to get that random port ?

silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

Re: how do i get the port for vlc

Postby silvara » 30 Oct 2008 19:57

okay .. i can change my question with explaining what i am trying to do.. I need to stream my webcam and display the remote computers webcam at the same time.. When vlc starts to stream , the incomming video from remote computer comes the same port..
I think I need this remote port to modify the sdp file to open the stream or something else to display the h264 rtp stream with the same port. Is there any way ?

silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

Re: how do i get the port for vlc

Postby silvara » 31 Oct 2008 14:01

any comment ?
is there a way to display the incomming frames without knowing that random port ?

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

Re: how do i get the port for vlc

Postby Rémi Denis-Courmont » 01 Nov 2008 12:36

You don't need the source port to receive RTP packets.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

Re: how do i get the port for vlc

Postby silvara » 03 Nov 2008 09:14

AFAIK i need to listen the port where the video packets are comming with sdp file ?.. am i wrong? This sdp file also contains the information like codec ..


even with vlc rtp://ipadress:portnumber i need that port number.. please correct me if i am wrong

Thank you

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

Re: how do i get the port for vlc

Postby Rémi Denis-Courmont » 03 Nov 2008 17:50

You need to know the destination port, which is found in the SDP m= line. That you can set with --sout-rtp-port-audio, --sout-rtp-port-video and --sout-rtp-port settings, should you be unhappy with the default values (50000, 50002 and 50004).

There is no need to know the source port.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

Re: how do i get the port for vlc

Postby silvara » 03 Nov 2008 18:22

sorry i guess i couldnt explain my problem in a right way .

When i started to rtp stream from vlc to client it starts the stream from random port to --sout-rtp-port-video value which i gave with command line..
When Client receives that stream it starts video stream to vlc s random port .. And I want to display clients packets at vlc side .. but because i dont know that random port i am not able to set sdp file..

vlc (random port) ----------------H264 packets-------------------->Client
vlc (random port)<----------------H264 packets-------------------Client

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

Re: how do i get the port for vlc

Postby Rémi Denis-Courmont » 03 Nov 2008 18:28

There is no way this is going to work. VLC does not implement symmetric RTP. Even if you knew the source port number, it still wouldn't work.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

silvara
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Jul 2008 10:52

Re: how do i get the port for vlc

Postby silvara » 03 Nov 2008 19:01

thank you for the info. I thought if i know the port.. i can start new vlc with sdp file and start to decode the incomming stream with new vlc instance.

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

Re: how do i get the port for vlc

Postby Rémi Denis-Courmont » 03 Nov 2008 19:08

No. VLC would create two sockets on the same port, and whatever happens is unlikely to be what you'd like. VLC is not a SIP agent.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 8 guests