pedroSG94 / vlc-example-streamplayer

Example code how to play a stream with VLC
GNU General Public License v3.0
227 stars 93 forks source link

How to record streaming in player? #8

Closed kagile closed 6 years ago

kagile commented 6 years ago

I am using pedro vlc to live stream rtsp url from cp-plus ip camera. How can I record the live stream and save it to local device? Can you please guide?

pedroSG94 commented 6 years ago

Unfortunately, VLC android version doesn't support video record. Anyway you can capture only the video (I don't know how to get audio if you don't modify C++ VLC code) in a MP4 with MediaMuxer class.

To do it you need create an inputsurface from a VideoEncoder and use it to draw in VLC then capture buffer from it and use MediaMuxer to create MP4 file.

This class should help you to create a VideoEncoder with a inputsurface: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera1Base.java

The problem is that you will lose preview so you will need copy frames from inputsurface of VideoEncoder to surface of your view (Use opengl is a way to do it).

kagile commented 6 years ago

ok. Thanks for the information.

pranishres commented 3 years ago

Is there any updates in this feature ?