I am using Gstreamer to stream a video file to shmsink and then out to network with udpsink but only does so if the caps-specified format when reading from shmsrc is BGRA.
Here are my pipelines: sudo gst-launch-1.0 filesrc location=/home/me/files/Snowmix-0.5.1/test/big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! decodebin ! shmsink socket-path=/tmp/feed1-control-pipe shm-size=10000000 wait-for-connection=0 This pipeline reads the file specified and outputs it to a shared memory sink. sudo GST_DEBUG=mpegtsmux:5 gst-launch-1.0 shmsrc socket-path=/tmp/feed1-control-pipe do-timestamp=true is-live=true ! 'video/x-raw, format=I420, max-input-size=200000, width=320, height=720, framerate=25/1' ! videoconvert ! x264enc ! mpegtsmux ! udpsink host=192.168.78.10 port=4012 sync=true This pipeline read from the shared memory source and attempts to output via UDP. In the above pipeline we can see that I have specified the format of the video to be I420 which is indeed the encoding of the video file. However, it seems that there is zero interaction at the mpegtsmux plugin which should reformat the stream as an mpeg transport stream. Changing the format from I420 to BGRA even though the file itself is encoded as I420 then allows us to see interaction at the mpegtsmux plugin. The video is output and can be played back on VLC but the formatting is clearly wrong and plays oddly. Note: The pipeline above specifies a resolution of width=320 and height=720 because increasing it to the normal width=1280 and height=720 with BGRA causes the following error: WARNING: from element /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: Internal GStreamer error: code not implemented. Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer. Additional debug info: gstvideofilter.c(292): gst_video_filter_transform (): /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: invalid video buffer received Using the normal resolution with I420 does not produce the above error but again does not pass the stream past the mpegtsmux plugin in the pipeline. Why is it that streams identified as I420 when reading from the shmsrc do not pass through my pipeline successfully? Is there a compatibility issue with x264enc or videoconvert and I420? Is my pipeline missing something? |
Hi fearle.... You need to get your buffer sizes correct and you may want some queues. And you need to get the udp packet size rirght.This works for me. gst-launch-1.0 filesrc location=./big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 ! decodebin ! shmsink socket-path=/tmp/feed1-control-pipe shm-size=100000000 wait-for-connection=1 GST_DEBUG=mpegtsmux:5 gst-launch-1.0 -v \ shmsrc socket-path=/tmp/feed1-control-pipe do-timestamp=true is-live=true !\ 'video/x-raw,format=I420,width=1280,height=720,framerate=25/1' !\ identity silent=0 ! queue !\ videoconvert ! x264enc !\ h264parse ! queue ! mpegtsmux !\ queue ! chopmydata min-size=1316 max-size=1316 !\ udpsink host=127.0.0.1 port=4012 sync=true There are probably more you can do. Regards Peter On Thu, Jan 12, 2017 at 5:54 PM, fearlessszk <[hidden email]> wrote: I am using Gstreamer to stream a video file to shmsink and then out to _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
This post was updated on .
Hi Peter,
Thanks for your reply. I have tried the pipelines you mentioned but there still seems to be nothing happening at the mpegtsmux plugin. Are these number of changes usually required for a caps format change? Currently even when using BGRA, nothing seems to be being re-encoded at mpegtsmux from the debug logs. I'm using the Gstreamer version installed via apt-get on Ubuntu which I believe is version 1.8.2. When you say it works for you, are you able to see constant logging from mpegtsmux and also playback the stream on VLC? Regards, fearlessszk |
Free forum by Nabble | Edit this page |