Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problem in adding text >64k in wmv file?

problem in adding text >64k in wmv file?

Scheduled Pinned Locked Moved C#
helpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hemant kulkarni
    wrote on last edited by
    #1

    Hi, I have a wmv file in which I wnat to add a text data as attribute. The data is >64k. I have written following code but it gives "The parameter is incorrect." error. try { // Create a WMEncoder object. WMEncoder Encoder = new WMEncoder(); IWMMetadataEditor metadataEditor = null; try { //create encoder object Qlikkit.WMFSDKWrapper.Functions.WMCreateEditor(out metadataEditor); } catch(Exception ex) { string str = ex.Message; int mydata = 0; } // open wmv file try { metadataEditor.Open("d:\\3333.wmv"); } catch(System.Runtime.InteropServices.COMException ex) { string mystr = ex.Message; string mystr2 = ex.StackTrace; int jj=0; } // get the IWMHeaderInfo3 interface IWMHeaderInfo3 headerInfo = metadataEditor as IWMHeaderInfo3; // get attribute count ushort Outindex = 0; headerInfo.GetAttributeCount(0,out Outindex); IWMEncDisplayInfo displayInfo = Encoder.DisplayInfo; readMetadataStream(); String mydaya22 = "data" ; System.Text.StringBuilder mydata33 = new System.Text.StringBuilder(mydaya22); Qlikkit.WMFSDKWrapper.WMT_ATTR_DATATYPE attrDataType2 = new Qlikkit.WMFSDKWrapper.WMT_ATTR_DATATYPE();//Qlikkit.WMFSDKWrapper.WMT_ATTR_DATATYPE.WMT_TYPE_STRING; attrDataType2 = Qlikkit.WMFSDKWrapper.WMT_ATTR_DATATYPE.WMT_TYPE_STRING; try { // add attribute headerInfo.AddAttribute(0, "Author", out Outindex, attrDataType2, 0, //myDataptr, mydata33, (uint)metadataSIze ); } catch(Exception ex2) { // TODO: Handle exceptions. string str = ex2.Message; } Also My defination of IWMHeaderInfo3.AddAttribute is void AddAttribute( [In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.LPWStr)] string pszName, [Out] out ushort pwIndex, [In] WMT_ATTR_DATATYPE Type, [In] ushort wLangIndex, //IntPtr pValue, [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder data, [In] uint dwLength); is it correct? Regards, Hemant.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups