Android : Streaming on RTP from MAC to Android device

gdevel24 web.nitin at gmail.com
Mon Oct 31 14:20:44 UTC 2016


What I am trying to do:
I want to stream from my MAC Pro (either camera feed or from a file) over
RTP.
Receive and render this on my Android mobile using the GStreamer tutorial-3

Setup:
Both my MAC pro and Android device are on same network.
GStreamer Android binaries : gstreamer-1.0-android-arm-1.8.2
Tutorial 3 of the Gstreamer
NDK versions : r13 (I did try using NDKr9, but got build issues)

++++++++++++++

Application.mk
APP_ABI := armeabi-v7a
APP_PLATFORM := android-23

++++++++++++++

Android.mk
LOCAL_MODULE    := tutorial-3
LOCAL_SRC_FILES := tutorial-3.c
LOCAL_SHARED_LIBRARIES := gstreamer_android
GSTREAMER_SDK_ROOT_ANDROID  := /Users/.../gstreamer-1.0-android-arm-1.8.2
LOCAL_LDLIBS := -llog -landroid
include $(BUILD_SHARED_LIBRARY)

ifndef GSTREAMER_SDK_ROOT
ifndef GSTREAMER_SDK_ROOT_ANDROID
$(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
endif
GSTREAMER_SDK_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
endif
GSTREAMER_NDK_BUILD_PATH  :=
$(GSTREAMER_SDK_ROOT)/share/gst-android/ndk-build
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE)
$(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS)
$(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
$(GSTREAMER_PLUGINS_CODECS_RESTRICTED) $(GSTREAMER_PLUGINS_EFFECTS)
GSTREAMER_EXTRA_DEPS      := gstreamer-video-1.0
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk

++++++++
Changed xoverlay to videooverlay in tutorial-3.c
Removed interfaces-0.1 from dependencies

++++++++
Pipeline in tutorial-3.c

data->pipeline = gst_parse_launch("udpsrc port=5000
caps=\"application/x-rtp, media=video, clock-rate=90000, encoding-name=H264,
payload=96\" ! rtph264depay ! decodebin ! queue ! videoconvert ! glimagesink
sync=false",&error);

+++++++

Command on my MAC (ip address below is of my Android phone)
ffmpeg -f avfoundation -framerate 30 -i "0" -target pal-vcd -f rtp
rtp://10.0.0.5:5000/

This starts streaming video from my MAC camera

+++++++
Launch Tutorial-3 Android App, No video seen : logs below:

10-30 23:51:59.219 19299 19334 I Gst initialized. Restoring state,
playing:false
10-30 23:51:59.219 19299 19334 D GStreamer+tutorial-3: 0:00:01.694709635
0xb8b16e60 jni/tutorial-3.c:267:gst_native_pause Setting state to PAUSED
10-30 23:51:59.224 19299 19334 D GStreamer+tutorial-3: 0:00:01.698975417
0xb8b16e60 jni/tutorial-3.c:88:set_ui_message Setting message to: State
changed to READY
10-30 23:51:59.225 19299 19334 D GStreamer+tutorial-3: 0:00:01.699825313
0xb8b16e60 jni/tutorial-3.c:88:set_ui_message Setting message to: State
changed to PAUSED

10-30 23:52:04.142 19299 19299 D GStreamer+tutorial-3: 0:00:06.617419008
0xb87b8620 jni/tutorial-3.c:259:gst_native_play Setting state to PLAYING
10-30 23:52:04.145 19299 19347 W GStreamer+rtph264depay: 0:00:06.620095414
0xb8b51af0 gstrtph264depay.c:1205:gst_rtp_h264_depay_process:<rtph264depay0>
warning: Undefined packet type
10-30 23:52:04.148 19299 19347 W GStreamer+rtph264depay: 0:00:06.623093903
0xb8b51af0 gstrtph264depay.c:1205:gst_rtp_h264_depay_process:<rtph264depay0>
warning: Undefined packet type
10-30 23:52:04.148 19299 19347 W GStreamer+rtph264depay: 0:00:06.623494528
0xb8b51af0 gstrtph264depay.c:1205:gst_rtp_h264_depay_process:<rtph264depay0>
warning: Undefined packet type
10-30 23:52:04.149 19299 19347 W GStreamer+rtph264depay: 0:00:06.623871039
0xb8b51af0 gstrtph264depay.c:1205:gst_rtp_h264_depay_process:<rtph264depay0>
warning: Undefined packet type
10-30 23:52:04.149 19299 19347 W GStreamer+rtph264depay: 0:00:06.624239789
0xb8b51af0 gstrtph264depay.c:1205:gst_rtp_h264_depay_process:<rtph264depay0>
warning: Undefined packet type
...
...
...continues to log this error

++++++++

Also tried streaming from MAC using this command (ip address below is of my
Android phone)
gst-launch-1.0 -v filesrc location=/Users/.../test.mp4 ! h264parse !
rtph264pay ! udpsink host=10.0.0.5 port=5000

I did not see any errors on logs but, result on mobile is same (black
screen)




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Android-Streaming-on-RTP-from-MAC-to-Android-device-tp4680352.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list