相关疑难解决方法(0)

ProcessStartInfo挂在"WaitForExit"上?为什么?

我有以下代码:

info = new System.Diagnostics.ProcessStartInfo("TheProgram.exe", String.Join(" ", args));
info.CreateNoWindow = true;
info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(info);
p.WaitForExit();
Console.WriteLine(p.StandardOutput.ReadToEnd()); //need the StandardOutput contents
Run Code Online (Sandbox Code Playgroud)

我知道我开始的进程的输出大约是7MB.在Windows控制台中运行它可以正常工作.不幸的是,这会在WaitForExit上无限期挂起.另请注意,对于较小的输出(例如3KB),此代码不会挂起.

ProcessStartInfo中的内部StandardOutput是否可能无法缓冲7MB?如果是这样,我该怎么做呢?如果没有,我做错了什么?

c# processstartinfo

179
推荐指数
8
解决办法
11万
查看次数

如何在.Net中获取视频缩略图?

我正在寻找一个从输入视频中检索单个帧的函数,所以我可以将它用作缩略图.

这些方面的东西应该有效:

// filename examples: "test.avi", "test.dvr-ms"
// position is from 0 to 100 percent (0.0 to 1.0)
// returns a bitmap
byte[] GetVideoThumbnail(string filename, float position)
{
}
Run Code Online (Sandbox Code Playgroud)

有没有人知道如何在.Net 3.0中这样做?

正确的解决方案将是此功能的"最佳"实现.避免选择空白帧的奖励点.

.net c# video-processing

26
推荐指数
3
解决办法
3万
查看次数

C#从MP4流中提取位图

最近,我在互联网上搜索了很多不错的C#库以从MP4视频中提取位图,但发现与该代码相似但与MP4类似的东西:

        VideoStream stream = aviManager.GetVideoStream(@"C:\Users\User\Desktop\video.mp4");
        //the video.mp4 is usually .avi or .mpeg
        for (int n = 0; n < stream.CountFrames; n++)
        {
            Bitmap bmp = new Bitmap(stream.GetBitmap(Position));
            bmp.Save(@"C:\Users\Nehoray\Desktop\Something.png");
            bmp.Dispose;
        }
Run Code Online (Sandbox Code Playgroud)

谁能给我一个像这样的简单代码的库,仅用于MP4?:)

c# dll mp4 bitmap stream

5
推荐指数
1
解决办法
8852
查看次数

How to get FFProbe to run using dotnet core as an Azure Function in Docker?

I am trying to get video details (length, height, width, and content type) from a video based on a URL. By using the nuget package https://www.nuget.org/packages/NReco.VideoInfo.LT I was able to create an Azure Function running locally pointing to my local install of FFProbe rather easily. However, the trick is now making it compatible with an Azure Function and, to the best of my knowledge, the easiest way to do that is by providing a Docker image that contains everything needed …

ubuntu azure docker .net-core azure-functions

3
推荐指数
1
解决办法
589
查看次数

BitmapImage和Bitmap

很抱歉问这样的问题,但我找不到一个好的答案:/

BitmapImage和Bitmap有什么区别?

我想使用TIFF图像与我必须工作的任何一个.我发现了一些适用于BitmapImage的教程和另一个适用于Bitmap的教程.

c# wpf bitmap bitmapimage

2
推荐指数
1
解决办法
1万
查看次数