Closed don-pironet-hatch closed 8 months ago
Hi. This seems to be the average MediaTransoder API usage for our library. We have some limited support for that, basically you can use this method
Together with the Mediastreamsource object we expose from the FfmpegMediaSource. This limits you to the WinRT output formats and not the full range of formats supported by FFmpeg. I think this will also skip subtitles if there's any.
Unfortunately we currently don't have a dedicated transcoder API and I have no ETA when that would be available. There are some technical and legal issues that stand out. We are mainly a decoder library.
Thank you for your help. The problem with that approach is that I can't use that exposed MediaStreamSource. The TranscodeAsync throws an exception because I can't have more than one listener on that generator.
We are also displaying the video via an Mediaplayer.
_decoder = await FFmpegMediaSource.CreateFromUriAsync(RtspUrl, configuration);
_mediaPlaybackItem = _decoder.CreateMediaPlaybackItem();
_mediaPlayer = new MediaPlayer();
_mediaPlayer.Source = _mediaPlaybackItem;
var source = _decoder.GetMediaStreamSource();
var filename = GetVideoFileName();
var storageFolder = await StorageFolder.GetFolderFromPathAsync(path);
var destinationFile =
await storageFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
var destination = await destinationFile.OpenAsync(FileAccessMode.ReadWrite);
try
{
var transcode = await _mediaTranscoder.PrepareMediaStreamSourceTranscodeAsync(source, destination, MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto));
await transcode.TranscodeAsync();
}
catch (Exception exception)
{
//
}
I'd have 2 suggestions here:
The frame grabber is not designed to provide such high performance to be able to accurately reconstruct a stream. That's not what its purpose is.
Our lib does not support simultaneous playback and recording/transcoding. I also don't think that the frame server mode will help you, since it only gives you video frames, but no audio, and there is no sync mechanism as well.
So your only option would be to create two connections, one for playback and one for recoding. That's not optimal and it could cause bandwidth problems on slower connections. But I don't know of any other way.
Closing this, since the scenario is just not supported by our lib.
Hi,
I'm currently using the library to play a live RTSP stream. I see there's a frame grabber, but is there also a way to write an RTSP stream to a file?
What I tried now is the following:
Once the user decide to stop recording
The problem is on point 2 and also on some devices with less good hardware because of all the file access it doesn't work.
Is there another way?