uri からストリームを受け取るパイプラインを 1 つ作成し、textoverlay を 1 つ追加して、新しいストリームを作成しようとしています。
私がこれを試すとき:
str ="videotestsrc !"
"textoverlay text=\"It Works!!!!\" color=4 valign=top halign=right !"
"video/x-raw-yuv,width=640,height=480,framerate=10/1 ! "
"x264enc ! queue ! rtph264pay name=pay0 pt=96 !"
それは完全に機能しますが、uriから試してみると:
str = "uridecodebin uri=http://otp1.rtp.pt:80/liverepeater/smil:rtp1.smil/playlist.m3u8 !"
"textoverlay text=\"It Works!!!!\" color=4 valign=top halign=right !"
"video/x-raw-yuv,width=640,height=480,framerate=10/1 ! "
"x264enc ! queue ! rtph264pay name=pay0 pt=96 !"
それは動作しません..
なぜそれが機能しないのか誰かが知っていますか?
私の完全なコード:
#include <gst/rtsp-server/rtsp-server.h>
#include <gst/gst.h>
static gboolean timeout (GstRTSPServer * server, gboolean ignored){
GstRTSPSessionPool *pool;
pool = gst_rtsp_server_get_session_pool (server);
gst_rtsp_session_pool_cleanup (pool);
g_object_unref (pool);
return TRUE;
}
int main (int argc, char *argv[]){
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMediaMapping *mapping;
GstRTSPMediaFactory *factory;
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
server = gst_rtsp_server_new ();
mapping = gst_rtsp_server_get_media_mapping (server);
factory = gst_rtsp_media_factory_new ();
gchar *str= "( "
"uridecodebin uri=http://otp1.rtp.pt:80/liverepeater/smil:rtp1.smil/playlist.m3u8 !"
"textoverlay text=\"It Works!!!!\" color=4 valign=top halign=right !"
"video/x-raw-yuv,width=640,height=480,framerate=10/1 ! "
"x264enc ! queue ! rtph264pay name=pay0 pt=96 !"
")";
gst_rtsp_media_factory_set_launch (factory, str);
gst_rtsp_media_mapping_add_factory (mapping, "/test", factory);
g_object_unref (mapping);
if (gst_rtsp_server_attach (server, NULL) == 0)
goto failed;
g_timeout_add_seconds (2, (GSourceFunc) timeout, server);
g_main_loop_run (loop);
return 0;
failed:
{
g_print ("failed to attach the server\n");
return -1;
}
}
よろしくアレックス