在 WPF 中访问电视调谐器流/源
我的团队构建了一个与 Media Center 集成的 WPF (C#) 应用程序,以在仪表板的中心显示视频。本质上,该应用程序开始通过 Media Center 录制电视频道,等待 10 秒,然后开始播放正在录制的文件。自应用程序推出以来的一年中,我们创建了大约 50 个帮助台票证,其中 45 个专门用于媒体中心集成和设置。
我们确定需要对实现和架构进行重大更改,以删除媒体中心应用程序,并尝试直接显示来自电视调谐器的提要,就像网络摄像头一样。不幸的是,这里的团队中没有人以前做过这件事,我们也找不到任何资源或样本。
我正在寻找可以从电视调谐器获取流并在 Windows 窗体或 WPF 应用程序中显示它的工作代码示例。我什至愿意购买第三方组件或软件。哎呀,我什至愿意付钱给知道如何做到这一点的人来做到这一点!
你能指出我正确的方向吗?
视频代码
<MediaKit:MediaUriElement x:Name="MediaContainer" Volume="1"
Stretch="Uniform" HorizontalAlignment="Center"
UnloadedBehavior="Manual" LoadedBehavior="Play"
Height="820.00020739959" Width="1393.843"/>
录制视频的代码
DeletePreviousRecordings();
MediaCenterControl mcc = new MediaCenterControl();
mcc.StopAllRecordings();
DateTime recordingStartTime;
DateTime endTime = DateTime.Now.Subtract(TimeSpan.FromDays(1));
int loopCount = 0;
do
{
if (loopCount++ >= 5)
{
// TODO: Show error
break;
}
recordingStartTime = DateTime.Now;
RecordingEndTime = recordingStartTime.AddMinutes(RecordDuration);
} //loop count was added below so it knew not to throw until five shots have been missed @ scheduling.
while ((endTime = mcc.RecordMedia(recordingStartTime, Settings1.Default.RecordChannel, RecordDuration, loopCount)) < DateTime.Now);
if (endTime > DateTime.Now)
RecordingEndTime = endTime;
}
My team built a WPF (C#) Application that integrates with Media Center to show a video in the center of a dashboard. Essentially, the application begins recording a TV channel via Media Center, waits 10 seconds and begins playing back the file as it is being recorded. In the year since the application has launched, we have had roughly 50 help desk tickets created, 45 of which are specifically for the Media Center integration and setup.
We have determined that we need to make a major change in the implementation and architecture to remove the Media Center application all together and try to show the feed from the TV tuner directly, like you would a web cam. Unfortunately, nobody on the team here has done this before nor can we find any resources or samples of this being done.
I'm looking for working code samples that can take the stream from the TV tuner and show it in Windows Form or WPF application. I'd even be willing to buy 3rd party components out there or software. Heck, I'd even be willing to pay someone that knows how to do this to do just that!
Can you please point me in the right direction?
CODE FOR VIDEO
<MediaKit:MediaUriElement x:Name="MediaContainer" Volume="1"
Stretch="Uniform" HorizontalAlignment="Center"
UnloadedBehavior="Manual" LoadedBehavior="Play"
Height="820.00020739959" Width="1393.843"/>
CODE FOR RECORDING VIDEO
DeletePreviousRecordings();
MediaCenterControl mcc = new MediaCenterControl();
mcc.StopAllRecordings();
DateTime recordingStartTime;
DateTime endTime = DateTime.Now.Subtract(TimeSpan.FromDays(1));
int loopCount = 0;
do
{
if (loopCount++ >= 5)
{
// TODO: Show error
break;
}
recordingStartTime = DateTime.Now;
RecordingEndTime = recordingStartTime.AddMinutes(RecordDuration);
} //loop count was added below so it knew not to throw until five shots have been missed @ scheduling.
while ((endTime = mcc.RecordMedia(recordingStartTime, Settings1.Default.RecordChannel, RecordDuration, loopCount)) < DateTime.Now);
if (endTime > DateTime.Now)
RecordingEndTime = endTime;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这绝对可以完成,但您必须将范围缩小到一个电视调谐器。实际上,我使用 WinTV-HVR-1950 进行了这项工作。我花了一段时间,但你必须认真使用 hauppage 驱动程序才能获取信号并将其发送到应用程序。我必须查找该代码,但我想我可能有你的解决方案。
This can definitely be done but you would have to narrow down to one tv tuner. I actually have this working using the WinTV-HVR-1950. It took me a while but you have to get down and dirty with the hauppage drivers to get the signal and send it to the application. I'll have to look up that code but I think I may have your solution.