简体   繁体   English

使用 RTP 和 h264 的 Android 的 GStreamer 管道问题

[英]GStreamer pipeline issues for Android using RTP and h264

I'm working on an Android app using GStreamer and I have some trouble with my pipeline to receive the video stream. I'm starting with GStreamer, that's why I'm using the Tutorial 3 for Android and I try to modify as few code as possible because I don't master it.我正在使用 GStreamer 开发一个 Android 应用程序,我的管道在接收视频 stream 时遇到了一些问题。我从 GStreamer 开始,这就是为什么我使用Tutorial 3 for Android并尝试修改尽可能少的代码尽可能因为我不掌握它。

Brief summary: my server uses GStreamer to manage video stream and sends to my Android device the video stream through RTP.小结:我的服务器使用GStreamer来管理视频stream,并通过RTP将视频stream发送到我的Android设备。 The video is encoded with h264.视频是用h264编码的。 The stream reception is successful on Windows but not on Android, and that's my problem. stream 在 Windows 上接收成功,但在 Android 上接收不到,这是我的问题。

Pipeline used on Windows powershell to receive the video stream (it works):用于 Windows powershell 的管道接收视频 stream(有效):

.\gst-launch-1.0.exe -v udpsrc port=5000 ! "application/x-rtp,clock-rate=(int)90000,payload=(int)96" !  rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=true

Pipeline used on Android app (it doesn't work): Android 应用程序上使用的管道(不起作用):

udpsrc port=5000 caps="application/x-rtp,clock-rate=90000,payload=96" !  rtph264depay ! avdec_h264 ! glimagesink

I tried with many video sink and I came across errors:我尝试了很多视频接收器,但遇到了错误:

  • glimagesink: Error received from element udpsrc0: could not open resource for reading is displayed on device screen and when I search in Info logs I see ... gst_udpsrc_open:<udpsrc0> error: no socket error: Unable to create socket: Permission denied glimagesink: Error received from element udpsrc0: could not open resource for reading显示在设备屏幕上,当我在信息日志中搜索时,我看到... gst_udpsrc_open:<udpsrc0> error: no socket error: Unable to create socket: Permission denied
  • autovideosink: I see the same error as before in Info logs but the on screen error message is not displayed and I have an error in Error logs: ... /tutorial-3.c:202:app_function Could not retrieve video sink . autovideosink:我在信息日志中看到与以前相同的错误,但未显示屏幕上的错误消息,错误日志中出现错误: ... /tutorial-3.c:202:app_function Could not retrieve video sink Maybe this error has a higher priority?也许这个错误有更高的优先级?
  • fpsdisplaysink: same as autovideosink. fpsdisplaysink:与 autovideosink 相同。

But all these video sinks work with the default pipeline ( videotestsrc ! warptv ! videoconvert ! autovideosink ) that's why I don't really understand where the error comes from.但是所有这些视频接收器都使用默认管道( videotestsrc ! warptv ! videoconvert ! autovideosink ),这就是为什么我真的不明白错误的来源。

If someone has an idea on how to detect the origin of the problem or how to fix it, I'm interested.如果有人对如何检测问题的根源或如何解决问题有想法,我很感兴趣。 Don't hesistate to ask me if I'm not clear.如果我不清楚,请不要犹豫问我。 Thanks !谢谢 !

I found my mistake and it was easy to fix it: my pipeline is correct, I forgot to put the Inte.net permission so I just add this line to the AndroidManifest.xml file:我发现了我的错误并且很容易修复它:我的管道是正确的,我忘记了 Inte.net 权限所以我只是将这一行添加到 AndroidManifest.xml 文件中:

<uses-permission android:name="android.permission.INTERNET"/>

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

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