安裝
git clone https://github.com/RidgeRun/gst-shark/
apt install octave epstool babeltrace gtk-doc-tools
apt install graphviz libgraphviz-dev
編譯
sudo apt install python3 python3-pip ninja-build
pip3 install –user meson
sudo cp ~/.local/bin/meson /usr/bin/meson
meson builddir –prefix /usr/
ninja -C builddir
安裝
ninja install -C builddir
如果有更動gst-shark的程式碼,則需要重新編譯安裝
ninja -C builddir
ninja install -C builddir
在deepstream使用gst-shark的時候會需要修改以下程式碼並且重新編譯,以免出錯
gst_shark_tracer_hook_pad_push_pre,要檢查GST_OBJECT_PARENT的結果是不是NULL,是就return,修改如下
1 | /* My hooks */ |
使用
export GST_SHARK_LOCATION=/root/apps/iisi-ds64/iisi-ds63/my_exp/shark
export GST_DEBUG=”GST_TRACER:7”
export GST_TRACERS=”queuelevel”
執行deepstream,並且用q結束程式,確認shark底下的metadata有資料
下面是產生圖片的方式
cd gst-shark/scripts/graphics
Display the plot on the screen
./gstshark-plot /root/apps/iisi-ds64/iisi-ds63/my_exp/shark -p
Save the plot to a PDF
./gstshark-plot /root/apps/iisi-ds64/iisi-ds63/my_exp/shark -s pdf
Save the plot to a PNG
./gstshark-plot /root/apps/iisi-ds64/iisi-ds63/my_exp/shark -s png