Deepstream 6.0 graphviz 그래프 생성하기
NVIDIA Xavier NX devkit 에서 Deepstream 6.0 의 샘플 어플리케이션의 graphviz 를 생성한다. graphviz 를 이용하면 복잡한 gstreamer pipeline 입출력 관계를 분석하는데 도움이 된다.
Deepstream 6.0 샘플 어플리케이션 실행하기
NVIDIA Xavier NX devkit 에서 Deepstream 6.0 설치는 아래 포스팅을 참고한다.
2022.07.10 - [임베디드 컴퓨팅/nVidia Jetson] - [Jetson] JetPack4.6 Deepstream 6.0 설치하기
[Jetson] JetPack4.6 Deepstream 6.0 설치하기
JetPack4.6 에서 Deepstream 6.0 설치하기 NVIDIA Xavier NX devkit 에 apt-get 명령으로 Deepstream 6.0 설치하고 샘플 어플리케이션을 실행한다. Deepstream 6.0 설치하기 테스트 환경 NVIDIA Xavier NX devkit..
makepluscode.tistory.com
deepstream-test1 빌드하고 실행하기
Deepstream 6.0 SDK 와 함께 설치된 sample application 은 아래와 같이 빌드하고 실행할 수 있다.
$ cd /opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-test1
$ sudo CUDA_VER=10.2 make
$ ./deepstream-test1-app ../../../../samples/streams/sample_720p.h264
deepstream-test1 은 caffemodel 로 생성된 Car, Bicycle, Person, Roadsign 4가지 객체를 검출하는 샘플 어플리케이션 이다. deepstream 으로 제작 되었고, gstreamer pipeline 으로 구현되었다. deepstream_test1_app.c 를 분석하면 gstreamer pipeline 의 구조를 파악할 수 있지만, gstreamer 에서 제공하는 graphviz dot 을 이용한 시각화를 테스트 해본다.
deepstream-test1 graphviz dot 생성 코드 넣기
deepstream_test1_app.c 에서 gst pipeline 이 모두 정의되고, playing 하기 전에 GST_DEBUG_BIN_TO_DOT_FILE 를 통해 graphviz dot 파일을 생성하는 코드를 넣는다.
$ git diff deepstream_test1_app.c
diff --git a/apps/sample_apps/deepstream-test1/deepstream_test1_app.c b/apps/sample_apps/deepstream-test1/deepstream_test1_app.c
old mode 100644
new mode 100755
index ebe48b0..edd19cc
--- a/apps/sample_apps/deepstream-test1/deepstream_test1_app.c
+++ b/apps/sample_apps/deepstream-test1/deepstream_test1_app.c
@@ -311,6 +311,8 @@ main (int argc, char *argv[])
osd_sink_pad_buffer_probe, NULL, NULL);
:...skipping...
diff --git a/apps/sample_apps/deepstream-test1/deepstream_test1_app.c b/apps/sample_apps/deepstream-test1/deepstream_test1_app.c
old mode 100644
new mode 100755
index ebe48b0..edd19cc
--- a/apps/sample_apps/deepstream-test1/deepstream_test1_app.c
+++ b/apps/sample_apps/deepstream-test1/deepstream_test1_app.c
@@ -311,6 +311,8 @@ main (int argc, char *argv[])
osd_sink_pad_buffer_probe, NULL, NULL);
gst_object_unref (osd_sink_pad);
+ GST_DEBUG_BIN_TO_DOT_FILE(pipeline, GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");
+
/* Set the pipeline to "playing" state */
g_print ("Now playing: %s\n", argv[1]);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
sample application 은 아래와 같이 빌드하고 실행한다.
$ cd /opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-test1
$ sudo CUDA_VER=10.2 make
$ GST_DEBUG_DUMP_DOT_DIR=/home/nvidia ./deepstream-test1-app ../../../../samples/streams/sample_720p.h264
GST_DEBUG_DUMP_DOT_DIR 환경변수를 /home/nvidia 로 지정했기 때문에, /home/nvidia 위치에 pipeline.dot 이라는 파일이 생성 되었다.
이 dot 파일은 다음의 명령으로 png 파일로 변환할 수 있다.
dot -Tpng /home/nvidia/pipeline.dot > pipeline.png
png 파일로 변환하면 다음과 같은 png 형식의 그림으로 생성된다.
또는, Online graphviz 도구를 사용해서 dot 파일을 시각화 하고 svg 로 저장할 수 있다.
graphviz 를 이용하면 복잡한 gstreamer pipeline 입출력 관계를 분석하는데 도움이 된다.
참고자료
https://thiblahute.github.io/GStreamer-doc/tutorials/basic/debugging-tools.html?gi-language=c
Basic tutorial 11: Debugging tools
Goal Sometimes things won’t go as expected and the error messages retrieved from the bus (if any) just don’t provide enough information. Luckily, GStreamer ships with massive amounts of debug information, which usually hint what the problem might be. T
thiblahute.github.io
'NVIDIA Jeston > Deepstream' 카테고리의 다른 글
NVIDIA Jeston deepstream RTSP 수신 (0) | 2022.08.03 |
---|---|
UDP sink 를 이용한 Deepstream RTSP 출력 (0) | 2022.07.21 |
딥스트림 입력 소스를 V4L2 카메라로 변경하는 방법 (0) | 2022.07.17 |
Deepstream Test1 객체 검출결과 RTSP 전송 (0) | 2022.07.17 |
Deepstream 를 이용하여 유동인구를 분석해보자! (0) | 2022.07.15 |
Deepstream 오브젝트 트래커 예제 실행하기 (0) | 2022.07.13 |
Deepstream 6.0 Yolov2 Yolov3 예제 실행하기 (0) | 2022.07.11 |
Deepstream 처음 설치하고 실행하기 (1) | 2022.07.10 |