Page 1 of 1
How to play TS stream from socket under win32?
Posted: 05 Jan 2011 10:30
by kenping
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.
Re: How to play TS stream from socket under win32?
Posted: 05 Jan 2011 17:20
by Jean-Baptiste Kempf
vlc should support ts over http for playback.
Re: How to play TS stream from socket under win32?
Posted: 05 Jan 2011 20:30
by hussam_2000
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
Re: How to play TS stream from socket under win32?
Posted: 05 Jan 2011 20:31
by hussam_2000
BTW i used VLC1.1.4
Re: How to play TS stream from socket under win32?
Posted: 06 Jan 2011 09:35
by kenping
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.
Re: How to play TS stream from socket under win32?
Posted: 09 Oct 2011 05:27
by wg206
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.
Re: How to play TS stream from socket under win32?
Posted: 09 Oct 2011 10:16
by RĂ©mi Denis-Courmont
--sout is totally redumdant.