gst-launch
测试模拟数据
gst-launch-1.0 -v -m videotestsrc ! autovideosink
测rtsp
gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test ! rtph264depay ! h264parse ! nvv4l2decoder ! nvoverlaysink
tee
图像一边播放,一边编码存储
gst-launch-1.0 -e v4l2src ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! tee name=srctee srctee. ! queue ! xvimagesink srctee. ! queue ! videoconvert ! video/x-raw,format=I420 ! x264enc tune=zerolatency ! mp4mux ! filesink location=v.mp4
音频一边重采样,一边显示波形
gst-launch-1.0 filesrc location=song.ogg ! decodebin ! tee name=t ! queue ! audioconvert ! audioresample ! autoaudiosink t. ! queue ! audioconvert ! goom ! videoconvert ! autovideosink
gst-inspect
检查所有264编解码。
gst-inspect-1.0 |grep 264
gst-play
播放v.mp4文件
gst-play-1.0 v.mp4
存pipeline
export GST_DEBUG_DUMP_DOT_DIR=/home/nvidia
static gint num = 0; //必须要添加GST_DEBUG_DUMP_DOT_DIR环境变量。
gchar* dump_dot= g_strdup_printf("%d-pipeline", num++);
GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN (appCtx[0]->pipeline.pipeline), GST_DEBUG_GRAPH_SHOW_ALL, dump_dot);
dot 0-pipeline.dot -T png -o pic.png
jetson 显示
gst-launch-1.0 -e nvstreammux name=mux batch-size=2 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary.txt batch-size=2 ! nvstreamdemux name=demux filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! queue ! mux.sink_0 filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder ! queue ! mux.sink_1 demux.src_0 ! queue ! nvvideoconvert ! nvdsosd ! nvegltransform ! nveglglessink demux.src_1 ! queue ! nvvideoconvert ! nvdsosd ! nvegltransform ! nveglglessink
jetson nvv4l2h264enc
gst-launch-1.0 -e nvstreammux name=mux batch-size=2 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary.txt batch-size=2 ! nvstreamdemux name=demux filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! queue ! mux.sink_0 filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 ! h264parse ! nvv4l2decoder ! queue ! mux.sink_1 demux.src_0 ! "video/x-raw(memory:NVMM), format=NV12" ! queue ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! nvdsosd ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=a.mp4 demux.src_1 ! queue ! "video/x-raw(memory:NVMM), format=NV12" ! queue ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! nvdsosd ! nvvideoconvert ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=b.mp4