예제 #1
0
파일: FFmpeg.cs 프로젝트: wpmyj/UcAsp.VMS
        public static int RecordVideo(NVRHostHiKv hikv, int channelindex, long packageukid)
        {
            string msg      = string.Empty;
            string filepath = packageukid.ToString();

            if (filepath.Length > 8)
            {
                filepath = filepath.Substring(0, 8);
            }
            if (!Directory.Exists(Path + "\\" + filepath + "\\"))
            {
                Directory.CreateDirectory(Path + "\\" + filepath + "\\");
            }

            int id = RunProcess(@"-i rtsp://" + hikv.DVRUserName + ":" + hikv.DVRPassword + "@" + hikv.DVRIPAddress + "/h264/ch" + channelindex + @"/main/av_stream  -vcodec copy " + Path + "\\" + filepath + "\\" + packageukid + ".mp4  ", out msg, false);


            return(id);
        }
예제 #2
0
파일: FFmpeg.cs 프로젝트: wpmyj/UcAsp.VMS
        public static bool RecordImage(NVRHostHiKv hikv, int channelindex, string filename)
        {
            string msg = string.Empty;

            if (File.Exists(filename))
            {
                File.Delete(filename);
            }

            int id = RunProcess(@"-i rtsp://" + hikv.DVRUserName + ":" + hikv.DVRPassword + "@" + hikv.DVRIPAddress + "/h264/ch" + channelindex + @"/main/av_stream  -f image2 -ss 5 -vframes 1 -s 1920*1080 " + filename + " ", out msg, true);

            ColseProcess(id);
            if (File.Exists(filename))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }