RTSP串流品質檢測

ffmpeg RTSP串流品質檢測

1
ffmpeg -i rtsp://<伺服器IP>:<埠>/<路徑> -t 30 output.mp4

手動新增路由表

Windows

1
route -p add 10.179.101.0 mask 255.255.255.0 10.179.10.254 metric 10

Ubuntu

1
sudo ip route add 10.179.2.0/24 via 10.179.20.254 dev enp75s0f1

Hexo使用筆記

啟動server

1
hexo server

新增文章

1
hexo new [layout] "文章名稱"

layout 可以是post, page 或 draft

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

函式庫的rpath

查詢硬碟空間

1
du -sh ./*

有時候硬碟空間可能因為資料夾沒有mount,所以雖然占用硬碟空間但是du無法顯示出來,可以使用下面的指令來查看:

1
shopt -s dotglob && sudo mount / /mnt -o bind && du -sh /mnt/* && umount /mnt

參考:
https://www.reddit.com/r/linuxquestions/comments/1ed61ri/root_directory_full_despite_du_adding_up_to_55_of/

https://www.onejar99.com/linux-command-du/

函式庫的rpath

linker設定rpath的選項範例如下

1
gcc -Wl,-rpath=/opt/nvidia/deepstream/deepstream-6.4/lib test.cpp

RPATH有一個特殊識別符號$ORIGIN,表示執行檔的所在目錄

1
gcc -Wl,-rpath='$ORIGIN/../lib' test.cpp

查看函式庫的rpath

1
readelf -d libnvds_rest_server.so |head -20

或是

1
objdump -x libnvds_rest_server.so |grep 'R.*PATH'

CMake使用兩個變數來控制RPATH:INSTALL_RPATH和BUILD_RPATH,install步驟的rpath是INSTALL_RPATH

1
2
SET_TARGET_PROPERTIES(nvds_rest_server
PROPERTIES INSTALL_RPATH "/opt/nvidia/deepstream/deepstream-6.4/lib")

cmake的另一個設定RPATH的方法
https://discourse.cmake.org/t/library-rpath-resolution/887/7
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH “${ORIGIN}”)

參考:
https://www.cnblogs.com/chanyuantiandao/p/16553199.html

Gstreamer使用筆記

關閉程式前發送EOS事件給pipeline的方法

1
2
3
4
5
6
7
// 發送EOS訊號讓filesink可以正常結束
gst_element_send_event(appCtx[i]->pipeline.pipeline, gst_event_new_eos());
msg = gst_bus_timed_pop_filtered(GST_ELEMENT_BUS (appCtx[i]->pipeline.pipeline),
GST_CLOCK_TIME_NONE,
(GstMessageType) (GST_MESSAGE_ERROR | GST_MESSAGE_EOS));//gst_bus_timed_pop_filtered 是synchronously取得訊號,如果沒有訊號會一直等待並把執行續卡住
gst_element_set_state (appCtx[i]->pipeline.pipeline, GST_STATE_NULL);
g_main_loop_quit (main_loop);

https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html#gst_element_get_state

https://gstreamer-devel.narkive.com/g1omJFAj/gst-devel-graceful-exit-shutdown-of-a-pipeline#post3

https://stackoverflow.com/questions/38170733/gstreamer-not-flushing-to-the-filesink

範例

https://gitlab.freedesktop.org/freedesktop/snippets/-/snippets/1760

https://gist.github.com/CaptainOnly/f88cbb6ac5fdeae80200fbb3f7be695c