MJPEG에서 MP4, AVI 또는 MKV 형식으로 비디오 스트리밍을 변환해야합니다. ffmpeg 또는 vlc로 할 수 있습니까? UWP Win10 앱을 개발 중이며이 패키지가 많지 않습니다.UWP의 비디오 트랜스 코딩
편집 : 내 코드
VLCPreview.Source = "http://Admin:[email protected]:6021/cgi-bin/cmd/encoder?GET_STREAM";
/cmd/encoder?GET_STREAM
try
{
HttpClientHandler aHandler = new HttpClientHandler();
aHandler.Credentials = new NetworkCredential("Admin", "123456");
aHandler.ClientCertificateOptions = ClientCertificateOption.Automatic;
HttpClient aClient = new HttpClient(aHandler);
aClient.DefaultRequestHeaders.ExpectContinue = false;
//url get stream o web.Source
HttpResponseMessage response = await aClient.GetAsync("http://192.168.0.21:6021/cgi-bin/cmd/encoder?GET_STREAM", HttpCompletionOption.ResponseHeadersRead);//urlLinkToOnlineStream
Stream stream = await response.Content.ReadAsStreamAsync();
IInputStream inputStream = stream.AsInputStream();
ulong totalBytesRead = 0;
while (true)
{
// Read from the web.
IBuffer buffer = new Windows.Storage.Streams.Buffer(4096);
buffer = await inputStream.ReadAsync(buffer, buffer.Capacity, InputStreamOptions.None);
if (buffer.Length == 0)
{
break;
}
totalBytesRead += buffer.Length;
await fileStream.WriteAsync(buffer);
Debug.WriteLine("TotalBytesRead: {0:f}", totalBytesRead);
if (StopRec == true) { break;}
}
transcode(destinationFile, sampleFileVidTranscoded);
inputStream.Dispose();
fileStream.Dispose();
확실히 ffmpeg를 사용할 수 있지만 질문을 더 잘 작성해야합니다. –