I´m having a lot of problems trying to record a MPEG4 stream (served via RTSP, Bosch camera) into a file (.avi).
The thing is that I can reproduce the stream quite easily, but I´m not able to record it into a file.
I´m using the DZ VLC Library (component in C# Windows Form application.
This is how I reproduce the stream:
DZ VLC component for C# (inside the form designer):
Code: Select all
private DZ.MediaPlayer.Vlc.WindowsForms.VlcPlayerControl vlcPlayerControl1;
Code: Select all
vlcPlayerControl1.Initialize();
Code: Select all
mediaInput = new MediaInput(MediaInputType.NetworkStream, "rtsp://192.168.0.1");
vlcPlayerControl1.Play(this.mediaInput);
This is how I try to record the stream into a File (inside Record button callback):
Code: Select all
PlayerOutput playerOutput = new PlayerOutput();
OutFile outputFile = new OutFile(@"D:\Videos\test.avi");
playerOutput.Files.Add(outputFile);
MediaLibraryFactory mediaLibraryFactory =
new VlcMediaLibraryFactory(
new string[] {
"--no-snapshot-preview",
"--ignore-config",
"--no-osd" });
Player player = mediaLibraryFactory.CreatePlayer(playerOutput);
player.SetMediaInput(this.vlcPlayerControl1.CurrentPlaying);
player.Play();
Of course, the file path exists, and the plugins and libraries are correctly places into the bin folder.
I´ve tried creating a new MediaInput the same way I did in the Play button (and not playing it before), to use it instead the this.vlcPlayerControl1.CurrentPlaying, but that´s not the problem (both ways it fails when I call the player.Play()).
Anybody could help me with this? Is there any easier way to record using just the DZ VLC component?
Thanks in advance.
Dani.
P.S. Any other possibility or idea to get this thing working (even not using DZ library) will be really apreciated.