How use libvlc_media_player_record

This forum is about all development around libVLC.
inspiracionv
New Cone
New Cone
Posts: 6
Joined: 19 Sep 2013 19:48

How use libvlc_media_player_record

Postby inspiracionv » 19 Sep 2013 19:53

Hi all,

I am developing a software to capture video with directshow and i need to record what the user look on the screen when he want (record button).

To search in internet i looked this : libvlc_media_player_record

But i don't look this in the doxygen.

What is the best way to record video on fly?
I looked in VLC GUI it's possible to do this, but i don't find how ?

If you can help me to find the good way.

Thanks

thuanvh
New Cone
New Cone
Posts: 7
Joined: 16 Jul 2013 11:31

Re: How use libvlc_media_player_record

Postby thuanvh » 26 Sep 2013 09:11

Use sout option to add a new output to file.
Search libvlc sout option record in google.

Regards

inspiracionv
New Cone
New Cone
Posts: 6
Joined: 19 Sep 2013 19:48

Re: How use libvlc_media_player_record

Postby inspiracionv » 15 Oct 2013 18:02

Thks for answer

I was looking bvlc sout option record in google, but i didn't find what i search.

At this moment i use :

Code: Select all

:sout=#stream_out_duplicate{dst=display,dst=std{access=file,mux=avi,dst="+file+"}"
but for this i need to stop the player, restart for record and stop again for stop the record.

I would like to record without stop the player, i read a lot of documentation about libvlc and i don't find the way to record on fly.

Best regards.

inspiracionv
New Cone
New Cone
Posts: 6
Joined: 19 Sep 2013 19:48

Re: How use libvlc_media_player_record

Postby inspiracionv » 23 Oct 2013 20:46

One questions,

With libvlc sdk it's possible to record on fly or not ?

Because i looked something like this :

Code: Select all

var_GetBool( p_input_thread, "record" );
But i don´t find how obtain

Code: Select all

input_thread_t *p_input_thread;
Pls Someone can say me if where i am looking for is totally bad.

Thanks

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How use libvlc_media_player_record

Postby Jean-Baptiste Kempf » 05 Nov 2013 20:56

I don't think we have an API for that yet.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

inspiracionv
New Cone
New Cone
Posts: 6
Joined: 19 Sep 2013 19:48

Re: How use libvlc_media_player_record

Postby inspiracionv » 06 Nov 2013 19:00

To read more and more doumentation, i I concluded that the API libvlc don´t have this.

For the moment i use this options

Code: Select all

"sout=#duplicate{dst=display,select=video,dst='transcode{audio-sync,vcodec=theo,vb=1800,scale=1,acodec=vorb,ab=328,channels=2,samplerate=44100}:std{access=file,mux=ogg,dst="+img+"}'}"
But with this i need to restart the player and i loose the possibility to take snapshot during the record

Thanks for the time passed for answer.

es@work
New Cone
New Cone
Posts: 2
Joined: 06 Mar 2015 00:14
Operating System: Windows

Re: How use libvlc_media_player_record

Postby es@work » 31 Jul 2015 21:47

Hi,
Has any work been done on this at the API level since the last response?

I'm also interested in a better method than stopping the player, changing the sout arg and restarting the player. Right now I capture the time/position when the request was made and use that time/position to restart the player. This leads to a 1 second gap between stopping and starting, on the positive side the video starts essentially where it stopped. This gap is not acceptable, but I haven't found a better solution yet, hence my interest in the API.

I'm also open to suggestions as to how to better implement this if API's aren't still available. I saw source code for libvlc_media_player_record_[start|stop] but nothing in the Doxygen pages. Any chance the libvlc Doxygen pages can be updated or maybe display the date it and version it was created from?

Thanks for your assistance!

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: How use libvlc_media_player_record

Postby sherington » 31 Jul 2015 23:26

I wrote a *flawed* patch for this ages ago that did actually work for my own use-case but was not satisfactory to include in LibVLC. I don't remember the reasons, it's on the mailing list somewhere, but I remember at least the reasons were fair enough.

Nothing else has been done since by me or anyone else on this as far as I know. There's certainly nothing in the LibVLC API right now for this. There's nothing 'missing' from the Doxygen, it was never part of LibVLC.

es@work
New Cone
New Cone
Posts: 2
Joined: 06 Mar 2015 00:14
Operating System: Windows

Re: How use libvlc_media_player_record

Postby es@work » 03 Aug 2015 20:34

I'm new to libVLC, so hopefully since you have some experience in this area you might be wiling to share some insight. As stated in my previous post I'm trying to start/stop video recording on the fly.

At this time, I can display video either from another vlc player steaming a file from my PC to the network via rtsp or by directly playing the file on my PC. I'm able to record either one in almost all attempts but once in a while something refuses to cooperate. When I connect to network cameras, steaming via rtsp, I can see the video but cannot record it. If I'm lucky, the recording file is created but only 1k is written to it and the display goes blank until I stop recording.

The args I use to create the instance are:
"-I",
"dummy",
"--ignore-config",
"--sout-display"
when playing a file I add the following to the instance creation:
"--vout-filter=deinterlace",
"--deinterlace-mode=blend"
when connecting to an IP c amera I add to the instance creation:
"--rtsp-tcp"
The args for playing a file and connecting to an IP camera are mutually exclusive.

When I want to record on the fly I use the libvlc_media_add_option call to add the following sout after creating a new instance:
":sout=#duplicate{dst=display,dst=std{access=file,mux=mp4,dst=C:\Test_Panel.mp4}}"

When I start/stop recording I kill the media player and start a new one after grabbing the time at stop request and using that time and appropriate args when creating the new player. The time setting has no effect on video cameras that I can tell but that's ok.

My point about Doxygen is the lack of a reference as to how current it is. One could assume that it's current, however I did read somewhere that keeping it updated was a task that was done when time was available. I may have read an older comment or something in another vlc related blog which may not be relevant anymore, but it did raise a question in my mind as to how current it is.

Thanks in advance for any advice or pointers you provide.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests