function WriteAVITags(File_Name: OleVariant; Write_Mode: CWrite_Mode; AVI_Info: OleVariant): HResult; safecall;
Important Notes
Current version of DLL (2.0.0.x) includes old implementation of this method. That's why Write_Mode parameter will be ignored. The routine just replaces INFO tags in particular AVI file with the tags from AVI_Info. Moreover current realization of the method has 2Gb file size limitation.
Description
The WriteAVITags method writes information to the external file File_Name (some technical info, RIFF INFO tags, MovieId tags and IDivX tags). The file mustn't be in exclusive use by the another programme. Empty tags will be ignored on writing down.
Use Write_Mode parameter to indicate what WriteAVITags should process:
WM_Lite_Mode
|
write INFO tags only
|
WM_Ignore_Errors
|
try to process AVI file in spite of errors (may destroy file structure)
|
WM_Write_MovieID
|
write MovieID tags
|
WM_Write_IDivX
|
write IDivX tags
|
WM_Sync_Tags
|
syncronize tags content between different formats; the priority is RIFF INFO > MovieID > IDivX
|
WM_Delete_Unused_Tags
|
delete all the tags from AVI before writing tags
|
WM_Compress_Junk
|
try to write tags in place of JUNK chunks
|
WM_Compress_OpenDML
|
try to write tags in place of unused space in indx chunks
|
WM_Change_FourCC
|
rewrite FourCCs of video stream (both handler and codec)
|
WM_Change_FrameRate
|
rewrite frame rate of video stream (scale and rate)
|
WM_Change_TwoCC
|
rewrite TwoCCs of audio stream(s)
|
WM_Change_Language
|
rewrite language property of audio stream(s)
|
The information to write down should be provided in AVI_Info variable. Use NewTagsContainer and SetInfo methods to compile desired information into AVI_Info.
WriteAVITags returns error code that could be decoded by use of DecodeErrorCode function. On success WriteAVITags returns zero.
Comments
WriteAVITags replaces all the information holded in INFO section of the AVI file by the new tags, so use ReadAVITags before to get an information that could be erased. WriteAVITags doesn't erase any unknown RIFF chunks. JUNK chunks are squished to remain more space for INFO tags. WriteAVITags doesn't rewrites whole AVI file, instead of this WriteAVITags tries to use the space of deleted JUNK chunks in the header of AVI. If it fails (the space in the header still not enought), WriteAVITags writes INFO section to the end of file.
This technique allows to minimize the tags write time, so the process takes less then a second even for big files (about 700 MB).