I'm trying to save a live video stream to storage in Android App using libvlc. I can do it on PC with command line and it work fine, I record the file and can view it afterwards.
But in the app the file records, it's only 151B big which is probably empty and if I try to open it I get message "Cannot play this video format"
My question is, is it possible to record to storage in Android with libvlc?
I'm fairly new to programming so any suggestions would help
const string VIDEO_URL = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov";
public MainPage()
{
InitializeComponent();
Core.Initialize();
using (var libvlc = new LibVLC())
using (var mediaPlayer = new MediaPlayer(libvlc))
{
var media = new Media(libvlc, VIDEO_URL, FromType.FromLocation);
var currentDirectory = "/storage/emulated/0/dcim/";
var destination = Path.Combine(currentDirectory, "record4.mp4");
// Define stream output options.
// In this case stream to a file with the given path and play locally the stream while streaming it.
media.AddOption(":sout=#transcode{vcodec=h264}:std{access=file,dst=" + destination + "}");
// Start recording
mediaPlayer.Play(media);
}
}