gstreamer学习笔记

1. gstreamer 播放音频 

command: gst-launch-1.0 filesrc location=qqqg.wav ! wavparse ! alsasink

2. gstreamer 播放网络流

gst-launch-1.0 playbin uri=http://10.168.6.99:7000/R*0*

3.  build a pipeline automatically 

pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);

4.  build a pipeline manually 相当于3

GstElement *pipeline, *source, *sink;

source = gst_element_factory_make ("videotestsrc", "source");

sink = gst_element_factory_make ("autovideosink", "sink");

pipeline = gst_pipeline_new ("test-pipeline");

gst_bin_add_many (GST_BIN (pipeline), source, sink, NULL);

gst_element_link (source, sink) != TRUE);

g_object_set (source, "pattern", 0, NULL);

5. 播发音频:gst-launch-1.0 filesrc location=hama.mp4 ! qtdemux name=demuxer demuxer. ! avdec_aac ! audioconvert ! audioresample ! alsasink (audioresample可选)

6.播放mp4文件:gst-launch-1.0.exe playbin uri=file:///F:\\hama.mp4 

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

8 播放带验证的rtsp:gst-launch-1.0 playbin uri=rtsp://user:password@127.0.0.1:8554/test

posted @ 2022-04-20 13:13  MoonXu  阅读(287)  评论(0编辑  收藏  举报