Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

video streaming - 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.

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 !

question from:https://stackoverflow.com/questions/65938765/gstreamer-pipeline-issues-for-android-using-rtp-and-h264

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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"/>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...