How to play TS stream from socket under win32?

This forum is about all development around libVLC.
kenping
New Cone
New Cone
Posts: 2
Joined: 05 Jan 2011 10:22

How to play TS stream from socket under win32?

Postby kenping » 05 Jan 2011 10:30

HI,all
I have an application need to play TS stream (in H.264 format) that is come from TCP socket. If i receive that TS stream from socket and save to a .ts file, I can use libvlc_media_new_path/libvlc_media_new_location to load and play it success successfully. But who can tell me how can i play that TS stream directly from TCP socket, but not via file, because my server output that TS stream by pure TCP socket and i cann't change that server.

thanks.

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

Re: How to play TS stream from socket under win32?

Postby Jean-Baptiste Kempf » 05 Jan 2011 17:20

vlc should support ts over http for playback.
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.

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How to play TS stream from socket under win32?

Postby hussam_2000 » 05 Jan 2011 20:30

try:

Code: Select all

// when you import// typedef struct libvlc_instance_t libvlc_instance_t; typedef struct libvlc_imedia_player_t libvlc_imedia_player_t; typedef struct libvlc_imedia_t libvlc_imedia_t; so .. libvlc_instance_t* instance; libvlc_media_player_t* mediaPlayer; libvlc_media_t* media; instance = libvlc_new(0,NULL); media = libvlc_media_new_path(instance,"udp://@1234"); mediaPlayer = libvlc_media_player_new_from_media(media); libvlc_media_player_play(mediaPlayer );
good luck
Last edited by hussam_2000 on 05 Jan 2011 20:37, edited 1 time in total.

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How to play TS stream from socket under win32?

Postby hussam_2000 » 05 Jan 2011 20:31

BTW i used VLC1.1.4

kenping
New Cone
New Cone
Posts: 2
Joined: 05 Jan 2011 10:22

Re: How to play TS stream from socket under win32?

Postby kenping » 06 Jan 2011 09:35

try:

Code: Select all

...
good luck
Thanks you very much. but I can not work with "udp://@1234". My TS stream socket is a pure socket (TCP or UDP), there is not any control data like as RTP.

wg206
New Cone
New Cone
Posts: 1
Joined: 09 Oct 2011 05:23

Re: How to play TS stream from socket under win32?

Postby wg206 » 09 Oct 2011 05:27

Please use following command line to paly TS stream from tcp socket:

vlc tcp://10.12.21.100:1234 --demux=ts --sout="#duplicate{dst=display}"

replace 10.12.21.100:1234 with your IP address and port.

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

Re: How to play TS stream from socket under win32?

Postby Rémi Denis-Courmont » 09 Oct 2011 10:16

--sout is totally redumdant.
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 18 guests