adrg / libvlc-go

Handcrafted Go bindings for libVLC and high-level media player interface
https://pkg.go.dev/github.com/adrg/libvlc-go/v3
MIT License
437 stars 50 forks source link

Recording Desktop screen to a file #23

Closed winwisely99 closed 4 years ago

winwisely99 commented 4 years ago

We need a way to record a video of the screen.

The use case is UAT testers, and VLC looks like a good one since it works cross platform.

Here is our issue if your curious: https://github.com/winwisely99/dev/issues/31

SO first up - any API to set this up. Manual way is documented here: https://www.makeuseof.com/tag/record-screen-using-vlc/

adrg commented 4 years ago

@winwisely99 Recording capabilities would be a very nice addition to the package. I will look into it when I get a bit of time. It would make sense to be able to record and save (or broadcast) video streams. The screen would be a special type of video stream.

I think VLC does this through a plugin but I need to check in order to be sure.

adrg commented 4 years ago

@winwisely99 I created a screen recording example: https://github.com/adrg/libvlc-go/tree/master/v3/examples/gtk2_screen_recorder

I added some GUI to the example using go-gtk for ease of use. However, you can extract only the recording part and integrate it in your application, which starts at line 170 in the example.

The libVLC screen module needs to be installed in order to have screen recording capabilities. On Debian based distributions, you can install the vlc-plugin-access-extra package.

sudo apt-get install vlc-plugin-access-extra

See https://github.com/adrg/libvlc-go/wiki for installation instructions for Windows.

EDIT: Also added a GTK 3 screen recording example which can be found at https://github.com/adrg/libvlc-go/tree/master/v3/examples/gtk3_screen_recorder

adrg commented 4 years ago

Closing this issue as it has been addressed. Please reopen if there are any issues with the provided solution.