/// <summary>
            /// Shows how to read, update and remove XMP metadata in AVI format
            /// Feature is supported in version 17.06 or greater
            /// </summary>
            public static void DealWithXmpMetaData()
            {
                //ExStart:DealWithXmpMetaData
                // initialize AviFormat
                using (AviFormat aviFormat = new AviFormat(Common.MapSourceFilePath(filePath)))
                {
                    // get XMP
                    var xmpMetadata = aviFormat.GetXmpData();

                    // create XMP if absent
                    if (xmpMetadata == null)
                    {
                        xmpMetadata = new XmpPacketWrapper();
                    }

                    // setup properties
                    xmpMetadata.Schemes.DublinCore.Format    = "avi";
                    xmpMetadata.Schemes.XmpBasic.CreateDate  = DateTime.UtcNow;
                    xmpMetadata.Schemes.XmpBasic.CreatorTool = "GroupDocs.Metadata";

                    // update xmp
                    aviFormat.SetXmpData(xmpMetadata);

                    // and commit changes
                    aviFormat.Save();
                }
                //ExEnd:DealWithXmpMetaData
            }
Exemple #2
0
            public static void CleanMetadata()
            {
                //ExStart:CleanMetadata
                // initialize AviFormat
                AviFormat aviFormat = new AviFormat(Common.MapSourceFilePath(filePath));

                // removes all metadata
                aviFormat.CleanMetadata();

                // commit changes
                aviFormat.Save();
                //ExEnd:DealWithXmpMetaData
            }