Warm tip: This article is reproduced from serverfault.com, please click

GStreamer pipeline issues for Android using RTP and h264

发布于 2021-01-28 14:08:32

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.

Brief summary: my server uses GStreamer to manage video stream and sends to my Android device the video stream through RTP. The video is encoded with h264. The stream reception is successful on Windows but not on Android, and that's my problem.

Pipeline used on Windows powershell to receive the video stream (it works) :

.\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) :

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
  • 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. Maybe this error has a higher priority ?
  • fpsdisplaysink: same as 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.

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 !

Questioner
Mickael P
Viewed
0
Mickael P 2021-01-28 23:23:11

I found my mistake and it was easy to fix it: my pipeline is correct, I forgot to put the Internet permission so I just add this line to the AndroidManifest.xml file :

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