I'm writing simple VLCPlayer on panel1. It worked fine using following code. And using "libvlc_media_add_option" worked for recording to file.
But this file was video only, i.e. no sound stream. I did something wrong around "mux=mp4" or some other set-up?
Incoming sound stream should be someting like g726. Playback is fine with sound.
Code: Select all
void __fastcall TForm1::Button1Click(TObject *Sender)
{
libvlc_instance_t* instance = libvlc_new(0, NULL);
libvlc_media_t* VlcMedia;
VlcMedia = libvlc_media_new_location(instance,"rtsp://yourid:yourpassword@192.168.0.253:554/nphMpeg4/g726-640x480");
media_player = libvlc_media_player_new_from_media(VlcMedia);
libvlc_media_add_option(VlcMedia,":sout=#duplicate{dst=display,dst=std{access=file,mux=mp4,dst=test.mp4}"); // no sound
libvlc_media_release(VlcMedia);
libvlc_media_player_set_hwnd(media_player,Panel2->Handle);
libvlc_media_player_play(media_player);
}
//---------------------------------------------------------------------------