내 카메라에서 스트림을 렌더링은 작업자 스레드를 사용하여System.AccessViolationException : 당신이 볼 수있는 .NET 런타임 오류 C# 작업자 스레드 내 창문의 형태로 PictureBox를이
Application: nMCR.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at <Module>.av_read_frame(libffmpeg.AVFormatContext*, libffmpeg.AVPacket*)
at Accord.Video.FFMPEG.VideoFileReader.readVideoFrame(Int32, System.Drawing.Imaging.BitmapData)
at Accord.Video.FFMPEG.VideoFileReader.ReadVideoFrame()
at nMCR.form.MainForm.updateui()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
내 버튼 코드 :
때문에 내 양식 .IN 메모리 사용의 프레임은 내가 몇 시간 동안 버튼을 클릭하면 video.But의 판을 감지하는pictureRTSP.BackgroundImage
을 사용하는 버튼이 난이 오류가
BitmapImage bmImage = null;
if (IsRTSP)
{
//FinalImage = new Bitmap(_snapshotHandler.TakeSnapshot().ToImage());
FinalImage = new Bitmap(pictureRTSP.BackgroundImage);
//Bitmap img = (Bitmap)Image.FromStream(FinalImage);
bmImage = new BitmapImage();
using (MemoryStream memStream2 = new MemoryStream())
{
FinalImage.Save(memStream2, System.Drawing.Imaging.ImageFormat.Png);
memStream2.Position = 0;
bmImage.BeginInit();
bmImage.CacheOption = BitmapCacheOption.OnLoad;
bmImage.UriSource = null;
bmImage.StreamSource = memStream2;
bmImage.EndInit();
}
@Fildor 단지 참조 내 오류 .I이 원하는을 내가 왜이 오류가 발생하는지 알고 싶습니까? –
@Fildor 내가 세부 사항을 알려주시겠습니까? –
@Fildor 네 정확히 .i 어떤 줄에서 오류가 발생했는지 보여주는 그림을 게시하십시오. –