gst-discoverer-1.0:查看媒体文件的编码,帧率等信息
gst-inspect-1.0:找出可用的GStreamer元素及其功能
gst-launch-1.0:从命令行构建和运行GStreamer管道
gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
gst-device-monitor-1.0:
gst-play-1.0:
gst-typefind-1.0:
用法实例:
gst-play-1.0 /userdata/media/1080p_30fps_h265.mp4
gst-launch-1.0 filesrc location=/userdata/media/1080p_30fps_h265.mp4 ! qtdemux ! queue ! h265parse ! mppvideodec ! waylandsink
//qtmux:
//qtdemux:解复用器或解封装插件,在播放封装音视频的时候,一般都会需要先进行解封装,然后在解码、播放或者显示。
//queue:增加一个线程处理数据
//h265parse:h265解析
//mppvideodec:视频硬解码
//waylandsink:Wayland的GStreamer视频接收器
gst-launch-1.0 filesrc location=/userdata/media/test.mp3 ! id3demux ! mpegaudioparse ! mpg123audiodec ! alsasink
//id3demux:Demux ID3v1 and ID3v2 tags from a file
//mpegaudioparse:音频解析
//mpg123audiodec:音频解码
//alsasink:把音频使用ALSA传递给声卡
gst-launch-1.0 filesrc location=/userdata/media/1080p_30fps_h265.mp4 ! qtdemux name=dec
dec. ! queue ! h265parse ! mppvideodec ! waylandsink
dec. ! queue ! decodebin ! alsasink
//qtdemux:解复用器或解封装插件,在播放封装音视频的时候,一般都会需要先进行解封装,然后在解码、播放或者显示。
//qtdemux name=dec :qtdemux元素实例获得分配给它的名称dec,dec.引用qtdemux特定实例
//queue:增加一个线程处理数据
//h265parse:h265解析
//mppvideodec:视频硬解码
//waylandsink:Wayland的GStreamer视频接收器
//decodebin:自动检测文件的类型并在后台构造一些GStreamer元素来解码
//alsasink:把音频使用ALSA传递给声卡
//硬件H264 H265编码
gst-launch-1.0 mp4mux name=mux ! filesink location=test.mp4 videotestsrc num-buffers=600 ! video/x-raw,framerate=60/1,width=1920,height=1080 ! mpph264enc ! h264parse ! mux.video_0 -e
gst-launch-1.0 mp4mux name=mux ! filesink location=test.mp4 videotestsrc num-buffers=600 ! video/x-raw,framerate=60/1,width=1920,height=1080 ! mpph265enc ! h265parse ! mux.video_0 -e
//-e表示当用户按下Ctrl+C时发送EOS,以避免输出损坏。
//H264 H265解码
gst-launch-1.0 filesrc location=/userdata/media/1080p_60fps_h264.mp4 ! qtdemux ! h264parse ! mppvideodec ! waylandsink
gst-launch-1.0 filesrc location=/userdata/media/1080p_60fps_h264.mp4 ! qtdemux name=demux
demux.video_0 ! queue ! h264parse ! mppvideodec ! waylandsink
demux.audio_0 ! queue ! aacparse ! faad ! alsasink
//USB摄像头预览和拍照
gst-launch-1.0 v4l2src device=/dev/video9 ! videoconvert ! waylandsink
gst-launch-1.0 v4l2src device=/dev/video9 num-buffers=1 ! videoconvert ! video/x-raw,format=NV12,width=640,height=480 ! mppjpegenc ! filesink location=pic.jpg
//OV13850摄像头预览和拍照 录制与播放H264视频
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=NV12, width=640, height=480, framerate=30/1 ! waylandsink
gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,format=NV12,width=640,height=480 ! mppjpegenc ! filesink location=pic.jpg
gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=100 ! video/x-raw,format=NV12, width=640,height=480 ! tee name=t ! queue ! mpph264enc ! queue ! h264parse ! qtmux ! filesink location=13850_h264.mp4 t. ! queue ! waylandsink
gst-launch-1.0 filesrc location=13850_h264.mp4 ! qtdemux ! queue ! h264parse ! mppvideodec ! waylandsink
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)