• DeepStream Version : 5.1
• JetPack Version (valid for Jetson only) : jetson
• TensorRT Version : 4.5
Hi, I meet several issues about ”deepstream-transfer-learning-app“
can’t print information on terminal, tried “g_print, std::cout, printf”, none of them works
can’ t change on screen display. I changed “diaplay_meta” in “after_pgie_image_meta_save()” and “overlay_graphics()” , but nothing changed on screen
so, how to solve them?
Amycao:
can’t print information on terminal, tried “g_print, std::cout, printf”, none of them works
–>please use g_print in gstreamer based app.
I use them in “deepstream_transfer_learning_app_main.cpp”. besides ‘g_print’, ‘std::cout’ and ‘printf’ not work too. can you check the reason?
for example, in “deepstream_transfer_learning_app_main.cpp → overlay_graphics( )”, I change offset, font_color, and test_bg_clr, but not work on screen.
besides, I change these in “deepstream-app/deepstream_app_main.c → overlay_graphics( )” still not work.
display_meta->text_params[0].y_offset = 200;
display_meta->text_params[0].x_offset = 200;
display_meta->text_params[0].font_params.font_color = (NvOSD_ColorParams) {
0, 1, 0, 0.6};
display_meta->text_params[0].font_params.font_size =
appCtx->config.osd_config.text_size * 1.5;
char serif[] = "Serif";
display_meta->text_params[0].font_params.font_name = serif;
display_meta->text_params[0].set_bg_clr = 1;
display_meta->text_params[0].text_bg_clr = (NvOSD_ColorParams) {
0, 0, 0, 0.2};
I even replace ‘overlay_graphics( )’ by the following, but “source:rtsp:…” is still displayed on screen.
static gboolean
overlay_graphics(AppCtx *appCtx, GstBuffer *buf,
NvDsBatchMeta *batch_meta, guint index) {
return TRUE;
}
mchi
September 26, 2021, 9:16am
5
Please share your build, run steps and how to view the log output.
The issue should be caused by your operation steps, so please detail them.
I copy the deepstream5.1/source folder to /home/XXX/
Makefile is
CUDA_VER?=10.2
ifeq ($(CUDA_VER),)
$(error "CUDA_VER is not set")
endif
CXX=g++
APP:= deepstream-transfer-learning-app
TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
NVDS_VERSION:=5.1
LIB_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
APP_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/bin/
ifeq ($(TARGET_DEVICE),aarch64)
CFLAGS:= -DPLATFORM_TEGRA
endif
SRCS:= deepstream_transfer_learning_app_main.cpp image_meta_consumer.cpp image_meta_producer.cpp capture_time_rules.cpp
SRCS+= ../deepstream-app/deepstream_app.c ../deepstream-app/deepstream_app_config_parser.c
SRCS+= $(wildcard ../../apps-common/src/*.c)
INCS:= $(wildcard *.h)
PKGS:= gstreamer-1.0 gstreamer-video-1.0 x11 json-glib-1.0
OBJS:= $(patsubst %.c,%.o, $(patsubst %.cpp,%.o, $(SRCS)))
CFLAGS+= -I../../apps-common/includes \
-I../../../includes \
-I../deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 \
-I /usr/local/cuda-$(CUDA_VER)/include
LIBS:= -L/usr/local/cuda-$(CUDA_VER)/lib64/ -lcudart
LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta -lnvds_msgbroker -lnvds_batch_jpegenc -lnvdsgst_helper -lnvdsgst_smartrecord -lnvds_utils -lm \
-lcuda -lgstrtspserver-1.0 -lpthread -ldl -Wl,-rpath,$(LIB_INSTALL_DIR)
CFLAGS+= $(shell pkg-config --cflags $(PKGS))
LIBS+= $(shell pkg-config --libs $(PKGS))
all: $(APP)
%.o: %.c $(INCS) Makefile
$(CC) -c -o $@ $(CFLAGS) $<
%.o: %.cpp $(INCS) Makefile
$(CXX) -c -o $@ $(CFLAGS) $<
$(APP): $(OBJS) Makefile
$(CXX) -o $(APP) $(OBJS) $(LIBS)
install: $(APP)
cp -rv $(APP) $(APP_INSTALL_DIR)
clean:
rm -rf $(OBJS) $(APP)
waht I do is:
cd sources/apps/sample_apps/deepstream-transfer-learning-app
make
cd configs
mkdir output
deepstream-transfer-learning-app -c ds_transfer_learning_app_example.txt
by the way, I alose tried these steps in: “/opt/nvidia/deepstream/deepstream-5.1”. but it not works too
can you tell me which part is wrong?
mchi
September 26, 2021, 12:49pm
7
can you please make sure it works without this copy?
to simply test, I just add this in main()
int main(int argc, char *argv[]) {
GOptionContext *ctx = nullptr;
GOptionGroup *group = nullptr;
GError *error = nullptr;
guint i;
std::cout<<"======="<< std::endl;
std::cout<<"======="<< std::endl;
g_print("-------\n");
g_print("-------\n");
... ... ...
... ... ...
but I didn’t see these printed
maybe I find the problem
I “make clean” everyone where I build “deepstream-transfer-learning-app”. then I change app name in Makefile:
APP:= deepstream-tf-test
after that, I do these:
make
cd configs
deepstream-tf-test -c ds_transfer_learning_app_example.txt
it shows this:
deepstream-tf-test: command not found
then I tried
deepstream-transfer-learning-app -c ds_transfer_learning_app_example.txt
it still works!
so, can you tell me:
1 how to remove “deepstream-transfer-learning-app” clearly ?
2. why “APP:= deepstream-tf-test” does not work ?
mchi
September 26, 2021, 1:21pm
11
XiangjiBU:
it shows this:
deepstream-tf-test: command not found
then I tried
deepstream-transfer-learning-app -c ds_transfer_learning_app_example.txt
after you change to “APP:= deepstream-tf-test”, why is there still deepstream-transfer-learning?
that’s what I want to know
this seems not matter what I changd in “deepstream_transfer_learning_app_main.cpp". when I run “deepstream-transfer-learning-app …”, it uses some app else, but doesn’t use what I make
so, can you tell me:
1 how to remove “deepstream-transfer-learning-app” clearly ?
2. why “APP:= deepstream-tf-test” does not work ?
g++ -c -o deepstream_transfer_learning_app_main.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include deepstream_transfer_learning_app_main.cpp
g++ -c -o image_meta_consumer.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include image_meta_consumer.cpp
g++ -c -o image_meta_producer.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include image_meta_producer.cpp
g++ -c -o capture_time_rules.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include capture_time_rules.cpp
cc -c -o …/deepstream-app/deepstream_app.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/deepstream-app/deepstream_app.c
cc -c -o …/deepstream-app/deepstream_app_config_parser.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/deepstream-app/deepstream_app_config_parser.c
cc -c -o …/…/apps-common/src/deepstream_tracker_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_tracker_bin.c
cc -c -o …/…/apps-common/src/deepstream_primary_gie_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_primary_gie_bin.c
cc -c -o …/…/apps-common/src/deepstream_source_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_source_bin.c
cc -c -o …/…/apps-common/src/deepstream_audio_classifier_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_audio_classifier_bin.c
cc -c -o …/…/apps-common/src/deepstream_c2d_msg.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_c2d_msg.c
cc -c -o …/…/apps-common/src/deepstream_config_file_parser.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_config_file_parser.c
cc -c -o …/…/apps-common/src/deepstream_common.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_common.c
cc -c -o …/…/apps-common/src/deepstream_sink_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_sink_bin.c
cc -c -o …/…/apps-common/src/deepstream_perf.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_perf.c
cc -c -o …/…/apps-common/src/deepstream_dewarper_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_dewarper_bin.c
cc -c -o …/…/apps-common/src/deepstream_dsexample.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_dsexample.c
cc -c -o …/…/apps-common/src/deepstream_secondary_gie_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_secondary_gie_bin.c
cc -c -o …/…/apps-common/src/deepstream_dsanalytics.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_dsanalytics.c
cc -c -o …/…/apps-common/src/deepstream_tiled_display_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_tiled_display_bin.c
cc -c -o …/…/apps-common/src/deepstream_c2d_msg_util.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_c2d_msg_util.c
cc -c -o …/…/apps-common/src/deepstream_osd_bin.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_osd_bin.c
cc -c -o …/…/apps-common/src/deepstream_streammux.o -DPLATFORM_TEGRA -I…/…/apps-common/includes -I…/…/…/includes -I…/deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5 -I /usr/local/cuda-10.2/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include …/…/apps-common/src/deepstream_streammux.c
g++ -o deepstream-tf-test deepstream_transfer_learning_app_main.o image_meta_consumer.o image_meta_producer.o capture_time_rules.o …/deepstream-app/deepstream_app.o …/deepstream-app/deepstream_app_config_parser.o …/…/apps-common/src/deepstream_tracker_bin.o …/…/apps-common/src/deepstream_primary_gie_bin.o …/…/apps-common/src/deepstream_source_bin.o …/…/apps-common/src/deepstream_audio_classifier_bin.o …/…/apps-common/src/deepstream_c2d_msg.o …/…/apps-common/src/deepstream_config_file_parser.o …/…/apps-common/src/deepstream_common.o …/…/apps-common/src/deepstream_sink_bin.o …/…/apps-common/src/deepstream_perf.o …/…/apps-common/src/deepstream_dewarper_bin.o …/…/apps-common/src/deepstream_dsexample.o …/…/apps-common/src/deepstream_secondary_gie_bin.o …/…/apps-common/src/deepstream_dsanalytics.o …/…/apps-common/src/deepstream_tiled_display_bin.o …/…/apps-common/src/deepstream_c2d_msg_util.o …/…/apps-common/src/deepstream_osd_bin.o …/…/apps-common/src/deepstream_streammux.o -L/usr/local/cuda-10.2/lib64/ -lcudart -L/opt/nvidia/deepstream/deepstream-5.1/lib/ -lnvdsgst_meta -lnvds_meta -lnvds_msgbroker -lnvds_batch_jpegenc -lnvdsgst_helper -lnvdsgst_smartrecord -lnvds_utils -lm -lcuda -lgstrtspserver-1.0 -lpthread -ldl -Wl,-rpath,/opt/nvidia/deepstream/deepstream-5.1/lib/ -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lX11 -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
mchi
September 26, 2021, 2:05pm
17
you need to run make install to copy deepstream-tf-test to $(APP_INSTALL_DIR) .
Please try to read the Makefile