与avi,mp4上的ffmpeg不一致的缩略图

时间:2013-08-21 03:18:50

标签: c# ffmpeg

当我添加新视频时,我的缩略图不一致。我有宽度和高度为640x480和1280x720的视频文件。我需要改变什么?

       public void exec(string input, string output, string parametri)
 {

        ffmpeg = new Process();

        ffmpeg.StartInfo.Arguments = " -i " + input + (parametri != null ? " " + parametri : "") + " " + output;
        ffmpeg.StartInfo.FileName = "ffmpeg.exe";
        ffmpeg.StartInfo.UseShellExecute = false;
        ffmpeg.StartInfo.RedirectStandardOutput = true;
        ffmpeg.StartInfo.RedirectStandardError = true;
        ffmpeg.StartInfo.CreateNoWindow = true;

        ffmpeg.Start();
        ffmpeg.WaitForExit();
        ffmpeg.Close();
    }

    public void GetThumbnail(string video, string jpg, string velicina)
    {
        if (velicina == null) velicina = "640x480";
        exec(video, jpg, "-s " + velicina);
    }
    private void btnBrowseThumbnail_Click(object sender, EventArgs e)
    {

        string newThumbnail = Properties.Settings.Default.folderPathUserThumbnail + "CopyFiles.jpg";
        GetThumbnail(txtFile.Text, newThumbnail, null);
        string curFile = newThumbnail;
        if (File.Exists(curFile))
            txtThumbnail.Text = newThumbnail;
    }

0 个答案:

没有答案