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/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
below is the log from c++
logs.zip <http://gstreamer-devel.966125.n4.nabble.com/file/t378158/logs.zip> -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
i am not sure if this is the correct way but i can solve it if i use separate
matroskademux for audio and video. so i have two matroskademux for one webm file. i expect i will have problems with synchronization using this structure. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
It is highly recommended to decouple the various src_ pads of the demuxer by
using a queue element in each branch, e.g. I think that should get your pipeline going. Furthermore, putting sync=false on udpsink will probably result in your pipeline processing the content as fast as possible which might not be what you want. In that case, set sync=true. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
it works!
now i only need one matroskademux for one webm file. also for your hints about udpsik sync=true definitely i have to set that. thank you Arjen have a nice day -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |