Because the video watermark function is used in the project, the program efficiency is comparatively low.
Finally decided to upload the video to seven cattle, and then call the API to the specified video watermark function, the implementation of the specific
//Initialize Ak,sk stringSaccess_key ="seven kn account corresponding to AK"; stringSsecret_key ="seven kn account corresponding to the SK"; stringNamekey = DateTime.Now.ToString ("HHMMSS")+". mp4"; byte[] B = System.Text.Encoding.Default.GetBytes ("Watermark:"+ Namekey);//Place watermark video into watermark storage spaceString Saveasurl = convert.tobase64string (b);//save to-file under target space stringFoPs ="avthumb/mp4/wmtext/ymlhbw==/wmfontcolor/cmvk/wmfontsize/30/wmgravitytext/southeast|saveas/"+ Saveasurl;//Execute the command, part of the character Base64 stringPipeline ="Watermark_line"; stringNotifyurl ="http://www.test.com/demo/ui/ResultNotifyQiniuWM.aspx";//URL of the successful callback stringBucket ="ZNMLR";//Target Space stringKey ="Hello.mp4";//file nameMac Mac =NewMac (Saccess_key, Ssecret_key); Pfop px=NewPfop (MAC); Pfopresult result= PX.PFOP (bucket, key, FoPs, pipeline, Notifyurl,true); if(result.) Persistentid = =NULL) { stringSS =result. Response; } Console.WriteLine (Jsonconvert.serializeobject (Result)); Console.ReadLine ();
Use this feature to refer to Qiniu.dll and Newtonsoft.json (9.0.0 version)
Add watermark to video with seven KN interface