在 C# 中剪切并附加在帧开头的图像
所以我又来了,不知道该怎么办。 我有两个线程。 一种将图像转换为 24rgb 位图后填充队列的方法。 第二读取这些图像并将其流式传输到视频设备。 除此之外,我有一个图形对象,队列维护图像的位图。我正在使用两个流。 在类的析构函数中,我处理了所有数据并中止线程。 我在输出处获得的视频仍然被剪辑,并且一些应该位于帧末尾的图像数据出现在帧的开头。 我的问题是我已经处理了流、清除了队列、处理了图形对象、中止了线程。我可能做错了什么?
So here I am again, unsure what to do..
I have two threads.
One that fills the queue with images after converting them to 24rgb bitmap.
2nd to read those images and stream them to a video device.
Other than this i have a graphics object, the queue maintains bitmap of images. I am using two streams.
In the destructor of the class i dispose all of the data and abort threads.
Still the video that i get at the output is clipped and a bit of image data that should be at the end of frame, comes at the start of frame.
My question is i have disposed streams, cleared queue,disposed graphics object, aborted threads. What possible am i doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找出了问题所在,而是为了从流中收集字节,请尝试这个。
流方法的问题在于它也会以某种方式获取垃圾数据。
I figured out what was wrong, instead for gathering bytes from stream, try this.
The problem with the stream method is that it somehow gets the garbage data too.