Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 806e863

Browse files
authored
Merge pull request #8 from intel-iot-devkit/upload_svet_2020.2.0
upload code for svet linux 2020.2.0 with following features 1) Support using VPP instead of SFC for scaling and color format conversion in decoding session. 2) Support H265 RTSP stream as input. 3) Support new inference options “-infer::interval” and “-infer::max_detect”. 4) Support disabling composition by adding new sink session type “-fake_sink”. 5) Upgrade the MediaSDK to version 2020.1.1 and OpenVINO to version 2020.3. 6) Support pure multiple decoding performance testing.
2 parents 9ad3f66 + fd73057 commit 806e863

File tree

56 files changed

+985
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+985
-295
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Sample par files can be found in par_files directory. Verfied on i7-8559U. Perfo
1414
The sample application depends on [Intel® Media SDK](https://github.com/Intel-Media-SDK/), [Intel® OpenVINO™](https://software.intel.com/en-us/openvino-toolkit) and [FFmpeg](https://www.ffmpeg.org/)
1515

1616
# FAQ
17-
See doc/FAQ.md
17+
See [FAQ](./doc/FAQ.md)
1818

1919
# Table of contents
2020

@@ -33,27 +33,27 @@ The sample application is licensed under MIT license. See [LICENSE](./LICENSE) f
3333
See [CONTRIBUTING](./doc/CONTRIBUTING.md) for details. Thank you!
3434

3535
# Documentation
36-
See [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.1.0.pdf)
36+
See [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.2.0.pdf)
3737

3838
# System requirements
3939

4040
**Operating System:**
4141
* Ubuntu 18.04.02
4242

4343
**Software:**
44-
* [MediaSDK 19.4.0](https://github.com/Intel-Media-SDK/MediaSDK/releases/tag/intel-mediasdk-19.4.0)
45-
* [OpenVINO™ 2019 R3](https://software.intel.com/en-us/openvino-toolkit)
44+
* [MediaSDK 20.1.1](https://github.com/Intel-Media-SDK/MediaSDK/releases/tag/intel-mediasdk-20.1.1)
45+
* [OpenVINO™ 2020.3](https://software.intel.com/en-us/openvino-toolkit)
4646

4747
**Hardware:**
48-
* Intel® platforms supported by the MediaSDK 19.4.0 and OpenVINO 2019 R3.
48+
* Intel® platforms supported by the MediaSDK 20.1.1 and OpenVINO 2020.3.
4949
* For Media SDK, the major platform dependency comes from the back-end media driver. https://github.com/intel/media-driver
5050
* For OpenVINO™, see details from here: https://software.intel.com/en-us/openvino-toolkit/documentation/system-requirements
5151

5252
# How to build
5353

5454
Run build_and_install.sh to install dependent software packages and build sample application video_e2e_sample.
5555

56-
Please refer to ”Installation Guide“ in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.1.0.pdf) for details.
56+
Please refer to ”Installation Guide“ in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.2.0.pdf) for details.
5757

5858
## Build steps
5959

@@ -68,7 +68,7 @@ cd cva_sample
6868
```
6969
This script will install the dependent software packages by running command "apt install". So it will ask for sudo password. Then it will download libva, libva-util, media-driver and MediaSDK source code and install these libraries. It might take 10 to 20 minutes depending on the network bandwidth.
7070

71-
After the script finishing, the sample application video_e2e_sample can be found under ./bin. Please refer to "Run sample application" in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.1.0.pdf) for details.
71+
After the script finishing, the sample application video_e2e_sample can be found under ./bin. Please refer to "Run sample application" in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.2.0.pdf) for details.
7272

7373
# Known limitations
7474

build_and_install.sh

+15-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ then echo "Please make sure openvino has been installed and enviroment variables
88
exit -1;
99
fi
1010

11-
./msdk_pre_install.py
11+
./msdk_pre_install_internal.py
1212

1313
git_projects="MediaSDK media-driver libva"
1414
for i in $git_projects;
@@ -22,9 +22,8 @@ do
2222
done
2323

2424
cd "MediaSDK"
25-
git reset --hard
26-
patch -p1 < ../patches/0001-MSDK-Enable-AVC-decode-SFC-RGB4.patch
27-
patch -p1 < ../patches/0002-sample_common-Add-support-to-multiple-displays.patch
25+
patch -N --no-backup-if-mismatch -p1 < ../patches/0001-MSDK-Enable-AVC-decode-SFC-RGB4.patch
26+
patch -N --no-backup-if-mismatch -p1 < ../patches/0002-sample_common-Add-support-to-multiple-displays.patch
2827

2928
if [ $? != 0 ]; then
3029
echo "Apply patch failed!"
@@ -33,7 +32,7 @@ fi
3332
cd ../
3433
cp -rf video_e2e_sample MediaSDK/samples/
3534

36-
./msdk_pre_install.py -b cfl
35+
./msdk_pre_install_internal.py -b cfl
3736

3837
if [[ -f MediaSDK/build/__bin/release/video_e2e_sample ]];
3938
then
@@ -63,6 +62,17 @@ then
6362
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/intel/mediasdk/lib"' >> ~/.bashrc
6463
fi
6564

65+
if [[ -d $cl_cache_dir ]];
66+
then
67+
echo "cl_cache is enabled. \$cl_cache_dir : $cl_cache_dir"
68+
else
69+
echo "Add enabling cl_cache commands to ~\.bashrc"
70+
set -x
71+
mkdir -p ~/cl_cache
72+
export cl_cache_dir=~/cl_cache
73+
echo "mkdir -p ~/cl_cache" >> ~/.bashrc
74+
echo "export cl_cache_dir=~/cl_cache" >> ~/.bashrc
75+
fi
6676
echo "Sample application building has completed!"
6777
echo "Please use ./bin/video_e2e_sample for testing"
6878
fi

doc/CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
We welcome community contributions to SVET sample application. Thank you for your time!
1+
We welcome community contributions to the concurrent video analytic sample application. Thank you for your time!
22

33
Please note that review and merge might take some time at this point.
44

5-
SVET sample application is licensed under MIT license. By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.
5+
The sample application is licensed under MIT license. By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.
66

77
Steps:
88
- In the commit message, explain what bug is fixed or what new feature is added in details.
@@ -19,7 +19,7 @@ Software Requirements: Ubuntu 18.04, MediaSDK 19.4.0 and OpenVINO 2019 R3
1919

2020
## How to test your changes
2121

22-
### 1. Build the SVET sample applicaton
22+
### 1. Build the sample applicaton
2323

2424
```sh
2525
./build_and_install.sh
@@ -51,7 +51,7 @@ n16_1080p_rtsp_simu.pa
5151
n4_1080p_rtsp_simu_dp.par
5252
n16_1080p_rtsp_simu_dump.par
5353

54-
Multiple display tests:
54+
Multiple display test:
5555
```sh
5656
./bin/video_e2e_sample -par par_file/n16_1080p_1080p_dp_noinfer.par -par par_file/n16_1080p_1080p_dp.par
5757
```

doc/FAQ.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@
44
See chapter 2.4 in doc/svet_sample_application_user_guide_2020.1.0.pdf
55
Running the SVET sample applicton with option "-?" can show the usage of options.
66

7-
## Why does the system need to be switched to text mode before running the sample application
8-
The sample application uses libDRM to render the video directly to display, so it needs to act as master of the DRM display, which isn't allowed when X server is running.
7+
## Why does the system need to be switched to text console mode before running the sample application
8+
The sample application uses libDRM to render the video directly to display, so it needs to act as master of the DRM display, which isn't allowed when X client is running. If there is any VNC session, please also close it. Because VNC session also starts X client.
99
If the par file doesn't include display session, there is no need to switch to text mode.
1010

1111
## Why it needs "su -p" to switch to root user before running the sample application
1212
To become DRM master, it needs root privileges. With option "-p", it will preserve environment variables, like LIBVA_DRIVERS_PATH, LIBVA_DRIVER_NAME and LD_LIBRARY_PATH. If without "-p", these environment variables will be reset and the sample application will run into problems.
1313

14+
## Is it possible to use X11 instead of DRM display?
15+
If user doesn't want to switch to text console mode or switch to root for using DRM display, user can replace "-rdrm-DisplayPort" with "-rx11" in the par file. However, the X11 rendering isn't as effcient as DRM rendering. According to our 16-channel face detection 1080p test on CFL , the time cost of each frame increased by around 6ms. Example [par file](./par_file/inference/n16_face_detection_1080p_x11.par) using X11 as rendering method.
16+
17+
## Is there any limitation of the order of decoding, encoding and dislay sessions in par file
18+
Yes. The decoding dessions must be descripted firstly. If there is display dession, it must be the last line in par file.
19+
1420
## The loading time of 16-channel face detection demo is too long
15-
Please enable cl_cache by running command "export cl_cache_dir=/tmp/cl_cache" and "mkdir -p /tmp/cl_cache". Then after the first running of 16-channel face detection demo, the compiled OpenCL kernles are cached and the model loading time of next runnings of 16-channel face detection demo will only take about 10 seconds.
21+
Please make sure cl_cache is enabled by command "echo $cl_cache_dir". If this environment isn't set, please enable cl_cache by running command "export cl_cache_dir=/tmp/cl_cache" and "mkdir -p /tmp/cl_cache". Then after the first running of 16-channel face detection demo, the compiled OpenCL kernles are cached and the model loading time of next runnings of 16-channel face detection demo will only take about 10 seconds.
1622
More details about cl_cache can be found at https://github.com/intel/compute-runtime/blob/master/opencl/doc/FAQ.md
1723

1824
## Can sources number for "-vpp_comp_only" or "-vpp_comp" be different from number of decoding sessions?
@@ -21,15 +27,22 @@ No. The sources number for "-vpp_comp_only" or "-vpp_comp" must be equal to the
2127
## How to limit the fps of whole pipeline to 30?
2228
Add "-fps 30" to every decoding session.
2329

30+
## "-fps 30" doesn't work with "-fake_sink"
31+
Fake sink session doesn't support "-fps 30". Please add "-fps 30" to every decoding session instead.
32+
33+
Add "-fps 30" to every decoding session.
2434
## How to limit the frame number of input to 1000?
25-
Add "-n 1000" to every decoding dessions. However this option won't work if both "-vpp_comp_only" and "-vpp_comp" are set.
35+
Add "-n 1000" to every decoding dessions. But please not add "-n" to encode, display and fake sink session. These sink sessions will automatically stop when the source session stops. Note, this option won't work if both "-vpp_comp_only" and "-vpp_comp" are set.
2636

2737
## Where can I find tutorials for inference engine?
2838
Please refer to https://docs.openvinotoolkit.org/latest/_docs_IE_DG_Deep_Learning_Inference_Engine_DevGuide.html
2939

40+
## Why HDDL card usage ratio is low for face detection inference?
41+
It can be caused by the decoded frames aren't fed to inference engine efficiently. The default inference interval of face detection is 6. You try to set the inference interval to a lower valuer when using HDDL as inference target device. For example, with 3 HDDL L2 card, adding "-infer::inverval 1" to 16-channel face detection par file can increase the HDDL usage ratio to 100%.
42+
3043
## Where can I find information for the models?
3144
Please refer to https://github.com/opencv/open_model_zoo/tree/master/models/intel. The names of models used in sample application are
3245
face-detection-retail-0004, human-pose-estimation-0001, vehicle-attributes-recognition-barrier-0039, vehicle-license-plate-detection-barrier-0106.
3346

34-
## Can I use other OpenVINO version rather than 2019 R3?
47+
## Can I use other OpenVINO version rather than 2020.3 ?
3548
Yes, but you have to modify some code due to interfaces changing. And also you need to download the IR files and copy them to ./model manually. Please refer to script/download_and_copy_models.sh for how to download the IR files.
Binary file not shown.
Binary file not shown.

msdk_pre_install.py

+16-36
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def fnParseCommandline():
127127

128128
print "Please input the sudo password to proceed\n"
129129
cmd ="sudo apt-get -y install git libssl-dev dh-autoreconf cmake libgl1-mesa-dev libpciaccess-dev build-essential curl imagemagick unzip yasm libjpeg-dev libavcodec-dev libavutil-dev libavformat-dev;"
130-
cmd+="sudo apt-get -y install libopencv-dev checkinstall pkg-config libgflags-dev"
130+
cmd+="sudo apt-get -y install checkinstall pkg-config"
131131
os.system(cmd)
132132

133133
print ""
@@ -138,41 +138,38 @@ def fnParseCommandline():
138138
# Pull all the source code
139139
print "libva"
140140
if not os.path.exists("%s/libva"%(WORKING_DIR)):
141-
cmd = "cd %s; git clone https://github.com/intel/libva.git;"%(WORKING_DIR)
142-
cmd+= "cd libva;"
143-
cmd+="git checkout 5f693d9e603e0e83928cec67c30b6ac902d7aa85;" # 04/12/18
141+
cmd = "cd %s; rm -f libva.tar.gz; wget https://github.com/intel/libva/archive/2.7.1.tar.gz -O libva.tar.gz;"%(WORKING_DIR)
142+
cmd+= "tar zxf libva.tar.gz; mv libva-2.7.1 libva"
144143
print cmd
145144
os.system(cmd);
146145

147146
print "libva-utils"
148147
if not os.path.exists("%s/libva-utils"%(WORKING_DIR)):
149-
cmd = "cd %s; git clone https://github.com/intel/libva-utils.git;"%(WORKING_DIR)
150-
cmd += "cd libva-utils;"
151-
cmd+="git checkout 8ea1eba433dcbceb0e5dcb54b8e3f984987f7a17; " # 03/20/18
148+
cmd = "cd %s;rm -f libva-utils.tar.gz;"%(WORKING_DIR)
149+
cmd += "wget https://github.com/intel/libva-utils/archive/2.7.1.tar.gz -O libva-utils.tar.gz;"
150+
cmd += "tar zxf libva-utils.tar.gz; mv libva-utils-2.7.1 libva-utils;"
152151
print cmd
153152
os.system(cmd);
154153

155154
print "media-driver"
156155
if not os.path.exists("%s/media-driver"%(WORKING_DIR)):
157-
cmd = "cd %s; git clone https://github.com/intel/media-driver.git; "%(WORKING_DIR)
158-
cmd += "cd media-driver;"
159-
cmd+= "git checkout 12b7fcded6c74377ecf57eb8258f5e3d55ca722e" # 04/16/18
156+
cmd = "cd %s; rm -f intel-media-20.1.1.tar.gz;"%(WORKING_DIR)
157+
cmd += "wget https://github.com/intel/media-driver/archive/intel-media-20.1.1.tar.gz; "
158+
cmd += "tar zxf intel-media-20.1.1.tar.gz; mv media-driver-intel-media-20.1.1 media-driver"
160159
print cmd
161160
os.system(cmd);
162161

163162
print "gmmlib"
164163
if not os.path.exists("%s/gmmlib"%(WORKING_DIR)):
165-
cmd = "cd %s; git clone https://github.com/intel/gmmlib.git; "%(WORKING_DIR)
166-
cmd += "cd gmmlib;"
167-
cmd+= "git checkout ebfcfd565031dbd7b45089d9054cd44a501f14a9" # 04/05/18
164+
cmd = "cd %s;rm -f intel-gmmlib-20.1.1.tar.gz; wget https://github.com/intel/gmmlib/archive/intel-gmmlib-20.1.1.tar.gz; "%(WORKING_DIR)
165+
cmd += "tar zxf intel-gmmlib-20.1.1.tar.gz; mv gmmlib-intel-gmmlib-20.1.1 gmmlib"
168166
print cmd
169167
os.system(cmd);
170168

171169
print "MediaSDK"
172170
if not os.path.exists("%s/MediaSDK"%(WORKING_DIR)):
173-
cmd = "cd %s; git clone https://github.com/Intel-Media-SDK/MediaSDK.git; "%(WORKING_DIR)
174-
cmd+= "cd MediaSDK;"
175-
cmd+= "git checkout f8f6646afcaec410ca037f0176814dd9d7ca4900" # 04/16/18
171+
cmd = "cd %s; rm -f intel-mediasdk-20.1.1.tar.gz; wget https://github.com/Intel-Media-SDK/MediaSDK/archive/intel-mediasdk-20.1.1.tar.gz; "%(WORKING_DIR)
172+
cmd+= "tar zxf intel-mediasdk-20.1.1.tar.gz; mv MediaSDK-intel-mediasdk-20.1.1 MediaSDK"
176173
print cmd
177174
os.system(cmd);
178175

@@ -209,9 +206,9 @@ def fnParseCommandline():
209206
print cmd
210207
os.system(cmd)
211208

212-
cmd = "mkdir -p %s/media-driver/build; "%(WORKING_DIR)
213-
cmd+= "cd %s/media-driver/build; "%(WORKING_DIR)
214-
cmd+= "cmake ../; "
209+
cmd = "mkdir -p %s/media_build; "%(WORKING_DIR)
210+
cmd+= "cd %s/media_build; "%(WORKING_DIR)
211+
cmd+= "cmake ../media-driver; "
215212
cmd+= "make -j4; sudo make install"
216213
print cmd
217214
os.system(cmd)
@@ -227,7 +224,6 @@ def fnParseCommandline():
227224
sys.exit()
228225

229226
# Build and install Media SDK library and samples
230-
# MediaSDK origin: 22dae397ae17d29b4734adb0e5a998f32a9c25b2 (022218)
231227
cmd ="cd %s/MediaSDK; "%(WORKING_DIR)
232228
cmd+="mkdir -p build; "
233229
cmd+="cd build; "
@@ -243,22 +239,6 @@ def fnParseCommandline():
243239
print "MediaSDK source code doen't exist!"
244240
sys.exit()
245241

246-
r=subprocess.check_output("grep -c \"export LIBVA_DRIVER_NAME=iHD\" ~/.bashrc", shell=True)
247-
248-
if r >= 1:
249-
sys.exit()
250-
251-
print ""
252-
print "************************************************************************"
253-
print_info("Set environment variables. ", loglevelcode.INFO)
254-
print "************************************************************************"
255-
cmd = "echo 'export MFX_HOME=/opt/intel/mediasdk' >> ~/.bashrc; "
256-
cmd+= "echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/usr/lib' >> ~/.bashrc; "
257-
cmd+= "echo 'export LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri' >> ~/.bashrc; "
258-
cmd+= "echo 'export LIBVA_DRIVER_NAME=iHD' >> ~/.bashrc"
259-
print cmd
260-
os.system(cmd)
261-
262242
cmd = "sudo echo '/usr/lib/x86_64-linux-gnu' > /etc/ld.so.conf.d/libdrm-intel.conf; "
263243
cmd+= "sudo echo '/usr/lib' >> /etc/ld.so.conf.d/libdrm-intel.conf; "
264244
cmd+= "sudo ldconfig"
File renamed without changes.

par_file/basic/n1_jpeg_enc_test.par

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-i::h264 /home/intel/Downloads/classroom.h264 -join -hw -async 4 -o::jpeg ./test_#.jpeg -w 1920 -h 1080 -ext_allocator -fps 30 -q 100 -frameskip 9
File renamed without changes.
File renamed without changes.

par_file/basic/n4_jpeg_enc_test.par

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-i::h264 /home/intel/Downloads/classroom.h264 -join -hw -async 4 -o::jpeg ./test_1_#.jpeg -w 1920 -h 1080 -ext_allocator -fps 30 -q 100 -frameskip 9
2+
-i::h264 /home/intel/Downloads/classroom.h264 -join -hw -async 4 -o::jpeg ./test_2_#.jpeg -w 720 -h 480 -ext_allocator -fps 30 -q 100 -frameskip 19
3+
-i::h264 /home/intel/Downloads/classroom.h264 -join -hw -async 4 -o::jpeg ./test_3_#.jpeg -w 960 -h 540 -ext_allocator -fps 30 -q 100 -frameskip 99
4+
-i::h264 /home/intel/Downloads/classroom.h264 -join -hw -async 4 -o::jpeg ./test_4_#.jpeg -w 480 -h 256 -ext_allocator -fps 30 -q 100 -frameskip 999

0 commit comments

Comments
 (0)