使用GStreamer将视频从Raspberry Pi流式传输到Android

时间:2015-11-10 18:36:32

标签: android raspberry-pi gstreamer java-gstreamer

Raspberry使用该命令

raspivid -t 0 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=192.168.0.249 port=5000

我应该在Android设备上创建哪些管道来接收视频?

data->pipeline = gst_parse_launch("???", &error);

我在本教程中使用了一些更改:http://docs.gstreamer.com/display/GstSDK/Android+tutorial+4%3A+A+basic+media+player

IP地址可以硬编码,因此我删除了代码:

void gst_native_set_uri (JNIEnv* env, jobject thiz, jstring uri) {
/*
 CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);
 if (!data || !data->pipeline) return;
  const jbyte *char_uri = (*env)->GetStringUTFChars (env, uri, NULL);
GST_DEBUG ("Setting URI to %s", char_uri);
if (data->target_state >= GST_STATE_READY)
  gst_element_set_state (data->pipeline, GST_STATE_READY);
g_object_set(data->pipeline, "uri", char_uri, NULL);
(*env)->ReleaseStringUTFChars (env, uri, char_uri);
data->duration = GST_CLOCK_TIME_NONE;
data->is_live = (gst_element_set_state (data->pipeline, data-   >target_state) == GST_STATE_CHANGE_NO_PREROLL);
*/
}

0 个答案:

没有答案