我是Microsoft Smooth Streaming的新手,对复合清单的制作有疑问.
遵循这里的指导.
我能够制作一个在Silverlight播放器中播放的单个剪辑元素的复合清单.
但是,当我尝试从其他视频添加更多剪辑时,播放器刚停止工作并且没有提供任何错误信息.
而我这一切都是手工完成的.当我尝试使用Expression Encoder 4 Pro创建这样的视频时,我得到了一个普通.ismc文件而不是.csm文件.
我的问题是:
制作包含来自不同视频的剪辑的复合清单的最佳方法是什么?编码这些视频时是否有任何规范要遵循?或复合清单的支持是否对视频格式有任何限制?
最后一个是:有一种简单的方法来调试它(比如验证我的.csm文件)吗?
编辑我自己的解决方案:
看起来没有人关心这个,但是因为我终于解决了这个问题,所以我在这里写下这个来节省别人的时间.
为了调试复合清单,我在Visual Studio中构建了一个简单的Silverlight应用程序,并添加了一个简单的函数来报告错误:
MainPage.xaml.cs中:
public MainPage()
{
InitializeComponent();
this.SmoothPlayer.SmoothStreamingErrorOccurred += new EventHandler<SmoothStreamingErrorEventArgs>(SmoothPlayer_SmoothStreamingErrorOccurred);
}
public void SmoothPlayer_SmoothStreamingErrorOccurred(object sender,
SmoothStreamingErrorEventArgs e)
{
MessageBox.Show("Error: " + e.ErrorCode + "; " + e.ErrorMessage);
}
Run Code Online (Sandbox Code Playgroud)
我发现这个网页很有用.
你需要使用:
<c t="", d"">
Run Code Online (Sandbox Code Playgroud)
代替
<c d="">
Run Code Online (Sandbox Code Playgroud)
你必须正确计算ClipBegin和ClipEnd价值.
下面是在python一个示例代码转换.ismc到.csm(假设下面的ISM是清单XML内容的xml.etree.ElementTree对象表示):
def ism2csm(url, ism):
if ism is None: return …Run Code Online (Sandbox Code Playgroud) Golang有一个问题困扰我.说我有两个结构:
type Dog struct {
Name string
Breed string
Age int
}
type Cat struct {
Name string
FavoriteFood string
Age int
}
Run Code Online (Sandbox Code Playgroud)
当我尝试进行排序[]*Dog和[]*Cat通过Age,我必须定义2个不同类型的结构,如:
type SortCat []*Cat
func (c SortCat) Len() int {//..}
func (c SortCat) Swap(i, j int) {//..}
func (c SortCat) Less(i, j int) bool {//..}
type SortDog []*Dog
func (c SortDog) Len() int {//..}
func (c SortDog) Swap(i, j int) {//..}
func (c SortDog) Less(i, j int) bool {//..}
Run Code Online (Sandbox Code Playgroud)
一个自然的想法是使用接口函数实现一些SortableByAge …