How do do you record in VLC1.1.4 C# ?

This forum is about all development around libVLC.
hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 17 Dec 2010 18:11

did anyone got VLC1.1.4 ro record a UDP H.264 stream in a C# app ?

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 17 Dec 2010 19:22

i have the following string options

Code: Select all

string[] args = new string[] { "-I", "dummy", "--ignore-config", @"--plugin-path=C:\bin\Debug\plugins"}; instance = new VlcInstance(args); public VlcInstance(string[] args) { instance = LibVlc.libvlc_new(args.Length, args); if (instance == IntPtr.Zero) throw new VlcException(); }

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 17 Dec 2010 22:14

FOUND IT !!!

adding this line ( --sout=file/ps:go.mpg ) to the option string

Code: Select all

string[] args = new string[] {"-I", "dummy", "--ignore-config",@"--plugin-path=C:\Users\bin\Debug\plugins", --sout=file/ps:go.mpg };
i can record but i can no longer see the stream live on my display ! I wonder why !!!! i think i need to add "duplicate" somewhere in the option string. any ideas !!!!!

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 27 Dec 2010 23:14

DOES ANYONE KNOW HOW TO START RECORDING IN THE MIDDILE OF THE STREAM ? I WANT THE EXCAT FEATURE AS THE ONE IN THE INSTALBLE PLAYER ???

Zingaro2002
Blank Cone
Blank Cone
Posts: 47
Joined: 30 May 2006 09:58

Re: How do do you record in VLC1.1.4 C# ?

Postby Zingaro2002 » 29 Dec 2010 10:35

DOES ANYONE KNOW HOW TO START RECORDING IN THE MIDDILE OF THE STREAM ? I WANT THE EXCAT FEATURE AS THE ONE IN THE INSTALBLE PLAYER ???
As far as I know libVLC doesn't give us the possibility to start recording after the stream is started (though the player has a red-circled button that does it!!!). By now (afaik) you can only start streaming and recording together at the same time (with --sout option).

I also have looked so many times to add this feature (START RECORDING IN THE MIDDILE OF THE STREAM) to my client based on libVLC, if you know how to do it (or you can prove that I'm wrong) please tell me.

Maybe to functions like
StartRecord(path_fileName, transcoding_options, ecc)
and
StopRecord()
will save us a lot of time...

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: How do do you record in VLC1.1.4 C# ?

Postby Sébastien Escudier » 29 Dec 2010 14:55

I had to hack vlc source code to do this.

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 29 Dec 2010 16:30

Thank you for the reply. I found many code samples but none of them implemenetd a recording feature. In my opinion , this feature should have been added to the new 1.1.5 release just like the way you suggested or you would expect VLC to take commands whilte it is running so once you click the recording button you send the recording commanding (--sout) to VLC to start recording ...is this possible ? ...anyways I can record and display the feed Simultaneously but I would like to have a "record" button. I have one more feature to implement , which is event handling that i cannot get to work with 1.1.4.

I have never hacked anything in my life so hacking VLC sounds like an impossible task to me :) is it a simple hack ? and is it stable ?

Thank you - Sam E

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: How do do you record in VLC1.1.4 C# ?

Postby Sébastien Escudier » 29 Dec 2010 17:40

I did this hack when the record button did not exists in vlc.
I don't think my hack is compatible with latests versions of vlc, and it is not very simple.

This should be implemented in libvlc, maybe the same way it is done in vlc with the record button, but I didn't look at it.

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 29 Dec 2010 19:48

I see.. well , thank you all for the feedback.

tcalef
New Cone
New Cone
Posts: 1
Joined: 07 Jan 2011 23:00

Re: How do do you record in VLC1.1.4 C# ?

Postby tcalef » 07 Jan 2011 23:03

Did you get this working? I'm having troubles recording at all. Could you post the entire code snippet that you have?
mine is shown to below

Code: Select all

this.vlcPlugin.playlist.add(@"rtsp://10.1.55.101:8554/test", cameraName, streamOptions); this.vlcPlugin.playlist.playItem(0);
and i use the following options

Code: Select all

:sout=#duplicate{dst=file{dst=C:\testLABEYE3.mp4},dst=display} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
Thanks!

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 08 Jan 2011 03:24

i will post it on Monday .what you got looks different than what I have . with my code , U HAVE TO START RECORDING WHEN YOU START RECEIVING the stream . I could not implement the recording button as the one in VLC player.

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: How do do you record in VLC1.1.4 C# ?

Postby hussam_2000 » 08 Jan 2011 09:04

This is what i used . i got it from this website:

http://csharpmagics.blogspot.com/

Code: Select all

string[] options = { ":sout=#duplicate{dst=display,dst=std{access=file,mux=asf,dst=\"F:\\My-Output-Video-Filename.asf\"}}" };
BUT YOU MUST play with "mux=ast" and "My-Output-Video-Filename.asf" extension. depending on what you are decoding , you might have to use mpg or ts . it is a matter of trial and error.

there is something in the Deve Support were it explains which extensions work depending on the incoming streams. you will find it. it is a list of extension available when you record

good luck :)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests