Hi all,
I have a question on streaming:Using one PC as a Server to get video streaming from a rtsp-based box,then record and push rtp streaming to the client via UDP. The PC server has an application developed by libvlc in C++. As you know,the original VLC Player can record while streaming when it has authentication,and also can control the streaming and record. But my issue is that it can't record while streaming when it has authentication, I assume that the box refused multi-access.(The app. did work well when the box has no authentication.)
the following code is from my application. thx!!
//define all global var of libvlc at here
getvideo(p1,p2)
{
......
sMRLGet="rtsp://username:password@"+boxIP;
libvlc_exception_init(&ex[0]);
vlc_argv[0][vlc_argc[0]++] = "-I";
vlc_argv[0][vlc_argc[0]++] = "dummy";
vlc_argv[0][vlc_argc[0]++] = "--ignore-config";
vlc_argv[0][vlc_argc[0]++] = "--extraintf=logger";
vlc_argv[0][vlc_argc[0]++] = "--no-video-title-show";
vlc_argv[0][vlc_argc[0]++] = "--video-filter=deinterlace";
vlc_argv[0][vlc_argc[0]++] = "--deinterlace-mode=blend";
p_instance[0] = libvlc_new(vlc_argc[0], vlc_argv[0], &ex[0]);
p_media[0]=libvlc_media_new(p_instance[0], sMRLGet, &ex[0]);
p_media_player[0] = libvlc_media_player_new_from_media (p_media[0], &ex[0]);
libvlc_media_player_set_hwnd(p_media_player[0],(void *)(PnlVlc->Handle),&ex[0]);
libvlc_media_player_set_media(p_media_player[0],p_media[0], &ex[0]);
libvlc_media_player_play(p_media_player[0], &ex[0]);
......
}
record(p3,p4)
{
......
sOption=":sout=#std{access=file,mux=avi,dst=avi";
libvlc_media_add_option(p_media[0],sOption, &ex[0]);
p_media_player[1] = libvlc_media_player_new_from_media (p_media[0], &ex[0]);
libvlc_media_player_set_media(p_media_player[1],p_media[0], &ex[0]);
libvlc_media_player_play(p_media_player[1], &ex[0]);
......
}