//--tune animation --crf 23 public static String createBat(GVideo.VideoItem v, String options, String output) { String pathFile=v.getPath(); String pathName = " \"" + output + pathFile.Substring(pathFile.LastIndexOf('\\'), pathFile.LastIndexOf('.') - pathFile.LastIndexOf('\\')); bool isAvs = pathFile.EndsWith(".avs"); bool isBat = pathFile.EndsWith(".bat"); string vo = pathName + (isAvs ? "" : "_v") + ".mp4\" "; string ao = pathName + "_a.m4a\" "; string avo = pathName + "_enc.mp4\" "; string vi = " \"" + pathFile + "\" "; if (File.Exists(Global.batPh)) { File.Delete(Global.batPh); } if (isBat) { File.Copy(pathFile, Global.batPh, true); } else { StringBuilder sBuilder = new StringBuilder(); sBuilder.AppendLine("x264 " + " --level 4.1 " + options + " " + (v.Width<1280 ? "" : "--vf resize:1280,720,,both,,spline") + " -o " + vo + vi); if (!isAvs) { sBuilder.AppendLine("ffmpeg -i " + vi + " -f wav - | neroaacenc -q 0.30 -if - -ignorelength -of " + ao); sBuilder.AppendLine("ffmpeg -i " + vo + " -i " + ao + " -vcodec copy -acodec copy " + avo); sBuilder.AppendLine("del " + vo); sBuilder.AppendLine("del " + ao); } using (StreamWriter sw = new StreamWriter(Global.batPh, false, Encoding.Default)) { sw.Write(sBuilder.ToString()); } } String outFile = avo.Substring(2); outFile = outFile.Remove(outFile.LastIndexOf('\"')); return outFile; }
public List <GVideo> GetEntities() { var entities = new List <GVideo>(); using (var rdr = SqlHelper.ExecuteReader(this._databaseConnectionString, CommandType.Text, SqlCommands_Cfg.Sql_Gvideo_Repository_GetEntities)) { while (rdr.Read()) { var entity = new GVideo(); entity.Id = SqlTypeConverter.DBNullInt32Handler(rdr["ID"]); entity.Enabled = SqlTypeConverter.DBNullBooleanHandler(rdr["Enabled"]); entity.Name = SqlTypeConverter.DBNullStringHandler(rdr["Name"]); entity.Type = SqlTypeConverter.DBNullInt32Handler(rdr["Type"]); entity.Ip = SqlTypeConverter.DBNullStringHandler(rdr["IP"]); entity.Port = SqlTypeConverter.DBNullInt32Handler(rdr["Port"]); entity.Uid = SqlTypeConverter.DBNullStringHandler(rdr["Uid"]); entity.Pwd = SqlTypeConverter.DBNullStringHandler(rdr["Pwd"]); entity.AuxSet = SqlTypeConverter.DBNullStringHandler(rdr["AuxSet"]); entity.ImgPort = SqlTypeConverter.DBNullInt32Handler(rdr["ImgPort"]); entity.PortId = SqlTypeConverter.DBNullInt32Handler(rdr["PortId"]); entities.Add(entity); } } return(entities); }