【问题标题】:Thumbnail for video in asp.netasp.net 中的视频缩略图
【发布时间】:2011-10-22 14:23:15
【问题描述】:

它是从 cmd 中启动的,但是当调试时不会进入 while 条件,请问有什么想法吗?在 IIS 中浏览站点返回异常: System.ComponentModel.Win32Exception:访问被拒绝。

        string video;
        string thumb;

        video = System.Web.HttpContext.Current.Server.MapPath("Video/test.avi");
        thumb = System.Web.HttpContext.Current.Server.MapPath("Video/frame.jpg");

        Process proc = new Process
        {
            StartInfo = new ProcessStartInfo
            {
                FileName = System.Web.HttpContext.Current.Server.MapPath("Video/ffmpeg.exe"),
                Arguments = " -i " + video + " -ss 00:00:03 -vframes 1 -f image2 -vcodec mjpeg " + thumb,
                UseShellExecute = false,
                RedirectStandardOutput = true,
                CreateNoWindow = true
            }
        };

        proc.Start();
        while (!proc.StandardOutput.EndOfStream)
        {
            string line = proc.StandardOutput.ReadLine();
        }

【问题讨论】:

    标签: c# asp.net video thumbnails


    【解决方案1】:

    这是因为 IIS 进程的用户安全上下文没有运行应用程序的权限。

    【讨论】:

    • 是的,您需要确保应用程序池用户有权运行ffmpeg.exe
    • 我是 asp.net 的新手,只是使用 VS2010 中的内置服务器。关于如何使用 IIS 7 快速设置站点以及在哪里设置适当权限的任何教程?再次感谢!
    • 为了调试目的,我稍微修改了代码。但无法让它工作。
    • @Chuchelo 在你的代码中没有什么可以摆脱这个异常,你只需要正确配置你的 IIS 和相关文件夹的安全权限。
    • 您可以使用进程监视器 (technet.microsoft.com/en-us/sysinternals/bb896645) 查看您的安全上下文被拒绝访问的确切资源。预先警告 - PM 会为您提供大量数据,但学习将其过滤掉并使用它是一个值得练习的练习。
    猜你喜欢
    • 2011-09-03
    • 2011-08-11
    • 2010-12-01
    • 2023-04-05
    • 2012-05-23
    • 1970-01-01
    • 1970-01-01
    • 2013-06-15
    • 2010-12-13
    相关资源
    最近更新 更多