私のカメラからのストリームをレンダリングするには、ワーカースレッドを使用しています私のフォーム.INため、メモリ使用量のフレーム私はボタンをクリックしたときに、いくつかの時間のためにvideo.Butにプレートを検出するために、pictureRTSP.BackgroundImage
を使用し、ボタンを持っている私は、このエラーを取得:System.AccessViolationException:あなたが見ることができるように.NETランタイムエラーC#のワーカースレッド私は私のWindowsフォームでの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()
マイボタンコード:
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エラーが発生した行を示す画像を投稿する –