0

In the apirefference it says that the source cannot be a InMemoryRandomAccessStream or any other writeable stream. But i need to transcode a InMemoryRandomAccessStream. I tried converting the Stream but it didnt work:

InMemoryRandomAccessStream untranscodedVideo = GetStream();
Stream source = untranscodedVideo.AsStreamForRead();
await transcoder.PrepareStreamTranscodeAsync(source.AsRandomAccessStream(),destinatiom,profile);


InMemoryRandomAccessStream untranscodedVideo = GetStream();
IOutputStream source = untranscodedVideo.GetOutputStreamAt(0);
await transcoder.PrepareStreamTranscodeAsync(source,destinatin,profile);
SinOfficial
  • 536
  • 5
  • 15

1 Answers1

0

But i need to transcode a InMemoryRandomAccessStream. I tried converting the Stream but it didnt work.

The source parameter of PrepareStreamTranscodeAsync is IRandomAccessStream. For this request, you could use CloneStream method to converter InMemoryRandomAccessStream to IRandomAccessStream.

IRandomAccessStream irSteam = stream.CloneStream();
Nico Zhu
  • 32,367
  • 2
  • 15
  • 36