Avi文件空属性表(在C#中关闭文件) [英] Avi File empty property Sheet (Closing Files in C#)

查看:107
本文介绍了Avi文件空属性表(在C#中关闭文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个类来写每个字节的avi文件字节。它工作正常,Media Player和Virtual Dub可以播放和处理视频。问题是,Windows属性表中的视频详细信息是完全空的,没有高度,宽度等。我将标头与hexeditor中的完整功能文件进行比较。没有布局差异。

猜猜有什么问题?

或者有人知道Windows属性表是如何工作的吗?



< b> NEW AWARENESS

我用VirtualDub修复了文件,一切正常。然后我在我的代码中构建相同的字节,我不再工作了(视频播放,但在Windows资源管理器中没有属性):

我的结论是,它与关闭文件或类似的东西有关这个!b / b
这是我打开和关闭文件的代码:

I wrote a class to write an avi file byte per byte. It works fine, Media Player and Virtual Dub can play and handle the video. The problem is, the video details in the Windows property sheet are completely empty, no heigth, width, etc.. I compare the header to a fully functional file in a hexeditor. There are no layout differences.
Any guess what is wrong?
Or do someone know how the Windows property Sheet works?

NEW AWARENESS
I repaired the file with VirtualDub and everything works fine. Then i built the same bytes in my code and i did not work anymore (Video plays, but no properties in Windows explorer):
My conclusion is, it has to do with closing the file or something like this!

Here is my code for open and close the file:

FileInfo fi = new FileInfo("test.avi");
FileStream aviFile = fi.Create();
BinaryWriter writer = new BinaryWriter(aviFile);
//writer.Write(Encoding.UTF8.GetBytes("example"));
//writer writes a lot of bytes
writer.Close();
aviFile.Close();





还有另一种可能性写入文件吗?或者我会错过什么?



谢谢



Is there another possibility to write in a file? Or do i miss something?

Thanks

推荐答案

也许这可能有所帮助:



AVI文件结构 [ ^ ]
Perhaps this may be of help:

AVI File Structure[^]


I我在我的程序中复制virtualDub结构时犯了一个错误。有一个填充垃圾块,里面有一些文字。我觉得没关系。错了!知道有自定义文本,一切正常。
I made a mistake when i copy the virtualDub structure in my programm. There was a padding Junk-Chunk with some Text in it. I thought it doesn't matter. The was wrong! Know there stands a custom text and everything works fine.


这篇关于Avi文件空属性表(在C#中关闭文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆