Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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
Posted
Updated 3-Dec-14 4:28am
v2

Perhaps this may be of help:

AVI File Structure[^]
 
Share this answer
 
Comments
fabbi008 3-Dec-14 8:43am    
Yeah, i saw the sheet already and worked with it.
The Header structure is verified by two hex-editors and worked out with the pdf.
But thanks for your try
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900