silverlight自适应流,服务器端编码?

发布于 2024-09-16 18:28:10 字数 80 浏览 5 评论 0原文

有人使用微软表达式编码器 SDK 对视频进行服务器端编码,为 silverlight 自适应流媒体做好准备吗?

您对此有什么经验?

has anyone used microsoft expression encoder SDK to do server side encoding of videos to preapare it for silverlight adaptive streaming?

What is your experience with it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

数理化全能战士 2024-09-23 18:28:10

我制作了一个 Windows 服务,用于对电影文件进行编码,以便在上传后动态创建自适应流文件。对我来说,缺点是我想将自适应流文件存储在数据库中。实现此目的的唯一选择是创建您自己的 WIN32 文件 API 或某种可以返回文件流的 WebDav 系统。您无法创建自己的 SmoothStreamHandler 扩展来以其他方式获取文件流(例如从数据库或其他方式)。

请注意,它会占用您系统中的所有 CPU,因此不要在您的网络服务器上运行它,而是为其准备一个单独的服务器。此外,服务器不需要有太多内存,因为它没有 64 位版本,因此不能使用更多 3.2GB 内存。最好只有 CPU 能力和一些快速磁盘。

还有支持 Silverlight 自适应流式处理的硬件解决方案,例如 Elemental Server

SDK本身相当容易使用:

示例:

private void ProcessFile(string filename, string outputFolder)
{
    try
    {
        MediaItem mediaItem;

        AdvancedVC1VideoProfile videoProfile = new AdvancedVC1VideoProfile();
        videoProfile.SmoothStreaming = true;
        videoProfile.AdaptiveGop = false;
        videoProfile.Streams.RemoveAt(0);

        try
        {
            mediaItem = new MediaItem(filename);

            // Add streams
            videoProfile.Streams.Add(new ConstantBitrate(1450), new Size(848, 480));
            videoProfile.Streams.Add(new ConstantBitrate(1050), new Size(592, 336));
            videoProfile.Streams.Add(new ConstantBitrate(600), new Size(424, 240));

            mediaItem.OutputFormat.VideoProfile = videoProfile;
        }
        catch (InvalidMediaFileException ex)
        {
            Console.WriteLine(ex.Message);
            return;
        }

        using (Job job = new Job())
        {
            job.MediaItems.Add(mediaItem);
            job.OutputDirectory = outputFolder;
            job.CreateSubfolder = false;

            job.EncodeProgress += (object sender, EncodeProgressEventArgs e) =>
            {
                // Trace progress..
            };

            job.Encode();

        }
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.Message);
        return;
    }
}

I made a windows service for encoding movie files to create Adaptive Streaming files on the fly once uploaded. The downside for me was that I wanted to store the adapative stream files inside a database. The only option to achieve this was to create your own WIN32 File API or some sort of WebDav system which can return the filestreams. You can't create your own extention of SmoothStreamHandler to get your filestream other ways (like from database or whatever).

Beware that it eats up all CPU's you have in your system, so dont run this on your webserver but have a seperate server for it. Also the server doesn't have to have much memory as it doesn't have a 64-bit version so it cant use more as 3,2gb. Just CPU power and some fast disks would be best.

There are also hardware solutions which support Silverlight Adaptive Streaming, like Elemental Server.

The SDK itself is rather easy to use:

Sample:

private void ProcessFile(string filename, string outputFolder)
{
    try
    {
        MediaItem mediaItem;

        AdvancedVC1VideoProfile videoProfile = new AdvancedVC1VideoProfile();
        videoProfile.SmoothStreaming = true;
        videoProfile.AdaptiveGop = false;
        videoProfile.Streams.RemoveAt(0);

        try
        {
            mediaItem = new MediaItem(filename);

            // Add streams
            videoProfile.Streams.Add(new ConstantBitrate(1450), new Size(848, 480));
            videoProfile.Streams.Add(new ConstantBitrate(1050), new Size(592, 336));
            videoProfile.Streams.Add(new ConstantBitrate(600), new Size(424, 240));

            mediaItem.OutputFormat.VideoProfile = videoProfile;
        }
        catch (InvalidMediaFileException ex)
        {
            Console.WriteLine(ex.Message);
            return;
        }

        using (Job job = new Job())
        {
            job.MediaItems.Add(mediaItem);
            job.OutputDirectory = outputFolder;
            job.CreateSubfolder = false;

            job.EncodeProgress += (object sender, EncodeProgressEventArgs e) =>
            {
                // Trace progress..
            };

            job.Encode();

        }
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.Message);
        return;
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文