How to specify the local video port in rtp package

This forum is about all development around libVLC.
jerry007
Blank Cone
Blank Cone
Posts: 10
Joined: 19 Jun 2009 11:03

How to specify the local video port in rtp package

Postby jerry007 » 15 Jul 2009 05:07

Hi all,

I am using libvlc to capture video stream and send via rtp in my application. Through the following command:
sout=#duplicate{dst=display,dst={transcode{venc=x264,vcodec=h264,vb=120}:rtp{mux=ts,dst=192.168.0.3,port=1234}}}
I can set the remote IP and port as: 192.168.0.3:1234
And I want to set the special local rtp port for libvlc, the send port for video stream using by libvlc. I have try the following :
sout=#duplicate{dst=display,dst={transcode{venc=x264,vcodec=h264,vb=120}:rtp{mux=ts,dst=192.168.0.3,port=1234,portvideo=8888}}}
But it can not make sense. Can somebody tell me how to set ?
Thanks in advance!


xutm

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to specify the local video port in rtp package

Postby Jean-Baptiste Kempf » 15 Jul 2009 09:05

port-audio and port-video, not portvideo and portaudio
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

jerry007
Blank Cone
Blank Cone
Posts: 10
Joined: 19 Jun 2009 11:03

Re: How to specify the local video port in rtp package

Postby jerry007 » 15 Jul 2009 11:40

Hi j-b,

Thank you for your reply!
Exactly I also try the command:
:sout=#duplicate{dst=display,dst={transcode{venc=x264,vcodec=h264,vb=120}:rtp{mux=ts,dst=127.0.0.1,port=1235,port-video=8888}}}
the log is following:
main debug: set config option: sout-rtp-mux to ts
main debug: set config option: sout-rtp-dst to 127.0.0.1
main debug: set config option: sout-rtp-port to 1235
main debug: set config option: sout-rtp-port-video to
8888
...
main debug: net: connecting to [127.0.0.1]:1235
main debug: net: connecting to [127.0.0.1]:1236 from [127.0.0.1]:5759

So I dont think the local video port has been setted to 8888, instead it has been setted as 5759
Am i right? I am sorry if I am wrong.

xutm

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

Re: How to specify the local video port in rtp package

Postby Rémi Denis-Courmont » 15 Jul 2009 17:05

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

jerry007
Blank Cone
Blank Cone
Posts: 10
Joined: 19 Jun 2009 11:03

Re: How to specify the local video port in rtp package

Postby jerry007 » 16 Jul 2009 03:27

Hi Rémi Denis-Courmont,

Thank you very much! So what isthe attribute "port-video" doing for ? And can you show me how to set the source video port?

xutm

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

Re: How to specify the local video port in rtp package

Postby Rémi Denis-Courmont » 16 Jul 2009 16:54

port-video sets the destination port of the (first) video elementary stream.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

jerry007
Blank Cone
Blank Cone
Posts: 10
Joined: 19 Jun 2009 11:03

Re: How to specify the local video port in rtp package

Postby jerry007 » 20 Jul 2009 04:57

Hi Rémi Denis-Courmont,

Now i modify the corresponding method __net_ConnectDgram:
Before connect to the des IP, I call bind to set the local video rtp port . And through the following:
#define MYPORT 9999
...
{
struct sockaddr_in addr;

memset (&addr, 0, sizeof (addr));

addr.sin_family = AF_INET;
addr.sin_port = htons(MYPORT);
addr.sin_addr.s_addr = INADDR_ANY;
//bzero(&(addr.sin_zero));

if (bind(fd, (struct sockaddr*)&addr, sizeof(struct sockaddr)) < 0)
msg_Dbg( p_this, "......... return no 0 ");
else
msg_Dbg( p_this, ".......... return 0 and bind success......");
}

if( connect( fd, ptr->ai_addr, ptr->ai_addrlen ) == 0 )
{
/* success */
i_handle = fd;

break;
}

I can set the local video rtp port to 9999

But now i found a strange problem. I modify the file modules/stream_out/rtp.c , I want to send attribute (from my command line in my application) to the method __net_ConnectDgram , and i execute "make" again, but i found there is no new libvlc.dll. Can you tell me why this happen?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests