gstreamer总结

学习资料

中文资料:https://blog.csdn.net/u013554213/article/details/79676129

官方资料:https://gstreamer.freedesktop.org/documentation/index.html?gi-language=c

命令行工具             

gst-inspect-1.0 :打印有关该插件或元素的信息     

gst-launch-1.0 :构建和运行基本GStreamer管道的工具     

gst-discoverer-1.0 :查看媒体信息

常用命令 

--rtsp取流播放
gst-launch-1.0 rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! nveglglessink

--合成
gst-launch-1.0 compositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1920 sink_0::height=1080 sink_1::xpos=1380 sink_1::ypos=540 sink_1::width=540 sink_1::height=540  ! \
ximagesink rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! timeoverlay ! queue2 ! comp. \
rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! timeoverlay ! queue2 ! comp. 

gst-launch-1.0 compositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1920 sink_0::height=1080 sink_1::xpos=1380 sink_1::ypos=540 sink_1::width=540 sink_1::height=540  ! \
nveglglessink rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! comp. \
rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! comp. 

--合成,带硬件加速
gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=540 sink_0::height=540 sink_1::xpos=1380 sink_1::ypos=540 sink_1::width=540 sink_1::height=540  ! \
nvoverlaysink rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! comp. \
rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! comp.


gst-launch-1.0 nvcompositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=540 sink_0::height=540 \
sink_1::xpos=1380 sink_1::ypos=540 sink_1::width=540 sink_1::height=540 \
sink_2::xpos=600 sink_2::ypos=400 sink_2::width=400 sink_2::height=400 ! \
nvoverlaysink rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! comp. \
rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec ! comp. \
filesrc location=test.mp4 ! qtdemux ! h264parse ! omxh264dec ! comp.

--tee
gst-launch-1.0 filesrc location=song.ogg ! decodebin ! tee name=t ! queue ! audioconvert ! audioresample ! autoaudiosink t. ! queue ! audioconvert ! goom ! videoconvert ! autovideosink

--播放
gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! h264parse ! omxh264dec ! nveglglessink

gst-launch-1.0 filesrc location=file.mp4 ! decodebin ! autovideosink

--save rtsp stream
gst-launch-1.0 rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! qtmux ! filesink location=rstpfile.mp4 -e

--play and save rtsp stream
gst-launch-1.0 rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! tee name=t ! queue ! h264parse ! qtmux ! filesink location=rstpfile.mp4 t. ! queue ! h264parse ! omxh264dec ! nveglglessink -e

--推流
gst-launch-1.0 filesrc location=test.mp4 ! qtdemux !  h264parse ! flvmux ! rtmpsink location='rtmp://192.168.17.122:7020/hls/test.mp4'
gst-launch-1.0 rtspsrc location="rtsp://192.168.17.122:7020/hls" ! rtph264depay ! h264parse ! omxh264dec ! nveglglessink

--nvvidconv
gst-launch-1.0 filesrc location=test.mp4 ! \
qtdemux ! h264parse ! omxh264dec ! nvvidconv ! \
'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, \
format=(string)NV12' ! nvegltransform ! nveglglessink -e

gst-launch-1.0 videotestsrc num-buffers=300 ! \
'video/x-raw, width=(int)1280, height=(int)720, \
format=(string)RGBA, framerate=(fraction)30/1' ! nvvidconv ! \
'video/x-raw(memory:NVMM), format=(string)I420' ! nvegltransform ! nveglglessink -e

--compositor,tee,nvvidconv
gst-launch-1.0 compositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1920 sink_0::height=1080 \
sink_1::xpos=1380 sink_1::ypos=540 sink_1::width=540 sink_1::height=540   \
sink_2::xpos=1380 sink_2::ypos=0   sink_2::width=540 sink_2::height=540 ! \
tee name=t ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420' ! omxh264enc ! qtmux !  filesink location=tee480.mp4   \
t. ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420' ! omxh264enc ! qtmux ! filesink location=tee720.mp4 \
t. ! queue ! omxh264enc ! qtmux ! filesink location=tee1080.mp4 \
rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec  ! comp. \
rtspsrc location="rtsp://admin:[email protected]:554" ! rtph264depay ! h264parse ! omxh264dec  ! comp. \
filesrc location=a.mp4 ! qtdemux ! h264parse ! omxh264dec ! comp. -e

--指定日志级别
gst-debug-level

你可能感兴趣的:(音视频)