简体   繁体   English

在C#应用程序上实时直播带Raspberry PI摄像机

[英]Streaming live wih Raspberry PI Camera on a C# Application

I'm trying to use a raspberry pi to guide a car from a C# Application from a computer. 我正在尝试使用树莓派从计算机的C#应用​​程序引导汽车。 The raspberry and computer are booth connected to a router. 覆盆子和计算机在展位上连接到路由器。 What I want is to receive live streaming from raspberry camera to computer so I can control the car. 我想要的是接收从树莓派相机到计算机的实时流媒体,以便我可以控制汽车。 I've seen how to broadcast on browser, but I want to receive the live streaming directly into my C# Application. 我已经看过如何在浏览器上进行广播,但是我想直接将实时流接收到我的C#应用​​程序中。 Is there any way to do this? 有什么办法吗?

I'm making some assumptions here since there's not much detail in the question, but, if you want to stream from Raspberry Pi, it's as easy as using ffmpeg. 我在这里做一些假设,因为问题没有太多细节,但是,如果您想从Raspberry Pi流式传输,则与使用ffmpeg一样容易。 There's a thousand command line parameters, but something like this will do the trick; 有上千个命令行参数,但是可以做到这一点。

ffmpeg -y -loglevel warning -f dshow -i video="screen-capture-recorder" -vf crop=690:388:136:0 -r 30 -s 962x388 -threads 2 -vcodec libx264 -vpre baseline -vpre my_ffpreset -f flv rtmp:///live/myStream.sdp

See here for more docs: https://trac.ffmpeg.org/wiki/StreamingGuide 请参阅此处以获取更多文档: https : //trac.ffmpeg.org/wiki/StreamingGuide

On the C# side, you just need to receive the video stream. 在C#端,您只需要接收视频流。 There's quite a few options for RTMP and/or RTSP, here's one: https://code.google.com/p/rtmp-mediaplayer/ but there are many others. RTMP和/或RTSP有很多选择,这里是一个: https : //code.google.com/p/rtmp-mediaplayer/,但还有很多其他选择。

Depending on what exactly you're doing with the video (overlays? vision?) you'll want to pick the right format, bitrate, and container to make processing simpler. 根据您对视频所做的确切操作(叠加?视觉?),您将需要选择正确的格式,比特率和容器,以简化处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM