rtp server unmodified video stream

putrasto putrasto at oita-apc.co.jp
Wed Jan 31 08:11:41 UTC 2018


i tried to port the rtp server script to c++. 
The script keeps video stream as is but modify audio stream using
audiomixer.
I plan to add or remove extra audio stream to the pipeline.

The script is working fine and i can playback on receiver side.

The problem is the c++ version only works if only process video or audio
stream (cannot both).
Also if i replace the audio stream with audiotestsrc, it can stream both
video (vp8 from webm file) and audio from audiotestsrc.
Also if i replace the video stream with videotestsrc, it can stream both
video from videotestsrc and audio (opus from webm file)

Any hints how to port below script to c++ that can stream both video stream
(unmodified vp8) and audio (modified by audiomixer) from a webm file ?


btw my c++ source code is very standard (below is only relavant parts)
...
//setup all elements
m_pipeline = gst_pipeline_new("server");
m_loop = g_main_loop_new(NULL, false);
m_rtpbin = gst_element_factory_make("rtpbin", NULL);
gst_bin_add(GST_BIN(m_pipeline), rtpbin);
g_signal_connect(rtpbin, "pad-added", G_CALLBACK(on_pad_rtpbin_added),
this);
m_filesrc = gst_element_factory_make("filesrc", NULL);
g_object_set(G_OBJECT(m_filesrc), "location", location, NULL);
m_matroskademux = gst_element_factory_make("matroskademux", NULL);
g_signal_connect(m_matroskademux, "pad-added",
G_CALLBACK(&Server::on_pad_matroskademux1_added), this);
m_opusdec = gst_element_factory_make("opusdec", NULL);
gst_bin_add_many(GST_BIN(m_pipeline), m_filesrc, m_matroskademux, m_opusdec,
NULL);
... creation and linking for the rest elements
gst_bus_add_watch(GST_ELEMENT_BUS(m_pipeline), &Server::bus_call, this);
gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
g_main_loop_run(m_loop);
....

server-matroska.sh
#!/bin/sh
#
# A simple RTP server 
#

SRC=localhost
DEST=localhost

gst-launch-1.0 -v rtpbin name=rtpbin \
           filesrc location=USER002.webm ! matroskademux name=demux
demux.video_0 ! rtpvp8pay ! rtpbin.send_rtp_sink_0          \
                     rtpbin.send_rtp_src_0 ! udpsink host=$DEST port=5000                                
\
                     rtpbin.send_rtcp_src_0 ! udpsink host=$DEST port=5001
sync=false async=false         \
                     udpsrc address=$SRC  port=5005 !
rtpbin.recv_rtcp_sink_0                                \
           demux.audio_0 ! opusdec ! audiomixer ! opusenc ! rtpopuspay !
rtpbin.send_rtp_sink_1  \
	             rtpbin.send_rtp_src_1 ! udpsink host=$DEST port=5002                                
\
	             rtpbin.send_rtcp_src_1 ! udpsink host=$DEST port=5003
sync=false async=false         \
                     udpsrc address=$SRC port=5007 ! rtpbin.recv_rtcp_sink_1  



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list