Page 1 of 1

MFC and libvlc,rtsp

Posted: 08 May 2010 08:34
by passionggg
hi,every body
now i has set up a MFC project in VS2008 to use libvlc.lib, libvlccore.lib and the plugins. it used to read rtsp data in real time and display it in my window. the main code is as follows:
char path[100];
this->GetDlgItemText(IDC_EDIT1, path, 100); //path is "rtsp://192.168.1.1:6002/h264"
libvlc_exception_t ex;
libvlc_exception_init(&ex);
int vlc_argc = 0;
char *vlc_argv[100];
vlc_argv[vlc_argc++] = "--ignore-config";
libvlc_instance_t *p_instance = libvlc_new(
vlc_argc, vlc_argv, &ex);
libvlc_media_t *p_media = libvlc_media_new(
p_instance, path, &ex);
libvlc_media_player_t *p_media_player
= libvlc_media_player_new_from_media(
p_media, &ex);
libvlc_drawable_t hwnd =
(libvlc_drawable_t) this->GetDlgItem(IDC_DISPLAY)->GetSafeHwnd();
libvlc_media_player_set_drawable(p_media_player, hwnd, &ex);
libvlc_media_player_play(p_media_player, &ex);
and display the video indeed.
But the question is: i want to do some process about the raw video data before display it. i can not find the function about register or callback to get the raw data from rtsp. what can i do?
anyone who knows please give me some messages. Thanks.

Re: MFC and libvlc,rtsp

Posted: 08 May 2010 19:32
by Jean-Baptiste Kempf
You want to play the data with VLC and then modify the data and then display it as you want?
Please use vmem module.

Re: MFC and libvlc,rtsp

Posted: 10 May 2010 04:47
by passionggg
i want to get the raw data through rtsp and libvlc and the plugins. is it using the function libvlc_event_attach or others to give a callback function?
i found the decoded raw data in the pointer p_pic of the function DecodeVideo in /module/codec/avcodec/video.c.
i want to do some changes of the raw data in the MFC of using libvlc and the plugins. does anyone have an example? Thanks

Re: MFC and libvlc,rtsp

Posted: 20 May 2010 08:12
by passionggg
Thanks j-b.
Now i have succeeded to do this work according your advice that is to use vmem module. and see some example in the forum about the Qt codes, that is to invoke the lock and unlock callback function.
Thank to all every one's help!

Re: MFC and libvlc,rtsp

Posted: 24 Sep 2010 17:17
by hussam_2000
PASSIONGGG !!!! how did you setup your MFC project to work ???!?!? What do i need to do with plugins and libraries !! i cannot get my 2008 MFC project to do anyting !! im trying to do extactly what you are doing . im experienced in WinForm but i was pushed back to MFC :( where do i need to put dlls and libraries !!please help!!!