L4T Multimedia API Reference

32.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
multimedia_api/ll_samples/docs/README.md
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of NVIDIA CORPORATION nor the names of its
13  * contributors may be used to endorse or promote products derived
14  * from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 @page mmapi_build Building and Running
30 @{
31 
32 You can run the samples on Jetson without rebuilding them. However, if you
33 modify those samples, you must rebuild them before running them.
34 
35 For information on building the samples on a host Linux PC (x86),
36 see @ref cross_platform_support.
37 
38 
39 Build and run the samples by following the procedures in this document:
40  <!-- Note to writers: The sample Markdown files all reference the first
41  3 steps below. If you change/renumber these steps, you may also need to
42  updated the sample MDs. -->
43 
44 1. [Export environment variables.](#step1)
45 2. [Use Jetpack to install these programs:](#step2)
46  - NVIDIA<sup>&reg;</sup> CUDA<sup>&reg;</sup>
47  - Opencv
48  - cuDNN
49  - NVIDIA<sup>&reg;</sup> TensorRT<sup>&trade;</sup>, previously known as GIE
50 3. [Create symbolic links.](#step3)
51 4. [Optionally, set up cross-compiler support.](#step4)
52 5. [Build and run the samples.](#step5)
53 
54 
55 <a name="step1">
56 ## Step 1. Export environment variables ##
57 
58 * Export the XDisplay with the following command:
59 
60  $ export DISPLAY=:0
61 
62 <a name="step2">
63 ## Step 2: Use Jetpack to install CUDA/OpenCV/cuDNN/TensorRT ##
64 
65 If you have already installed these libraries, you can skip the following steps.
66 
67 1. Download Jetpack from the following website:
68 
69  https://developer.nvidia.com/embedded/downloads
70 
71 2. Run the installation script from the host machine with the
72  following commands:
73 
74  $ chmod +x ./JetPack-L4T-<version>-linux-x64.run
75  $ ./JetPack-L4T-<version>-linux-x64.run
76 
77 3. Select Development Environment.
78 
79 4. Select "custom" and click "clear action".
80 
81 5. Select "CUDA Toolkit", "OpenCV","cuDNN Package" and
82  "TensorRT", and then install.
83 
84 6. For installation details, see the `_installer` folder.
85 
86 <a name="step3">
87 ## Step 3: Create symbolic links ##
88 
89 * Create symbolic links with the following commands:
90 
91  $ cd /usr/lib/aarch64-linux-gnu
92  $ sudo ln -sf libv4l2.so.0 libv4l2.so
93 
94 <a name="step4">
95 ## Step 4: Set up cross-compiler support (Optional) ##
96 * If you want to cross-compile the samples on a host Linux PC (x86),
97  see @ref cross_platform_support.
98 
99 <a name="step5">
100 ## Step 5: Build and run the samples ##
101  * Build and run, as described for each sample.
102  | Directory Location Relative to ll_samples/samples | Description |
103  |---------------------------------------------------|-------------|
104  | @ref l4t_mm_00_video_decode | Decodes H.264, H.265, VP8, VP9, MPEG4, and MPEG2 video from a local file and then shares the YUV buffer with egl renderer. | <!-- l4t_mm_00_video_decode.md -->
105  | @ref l4t_mm_01_video_encode | Encodes YUV bitstream from local file and then write elementary H.264/H.265 into file. | <!-- l4t_mm_01_video_encode.md -->
106  | @ref l4t_mm_video_decode_cuda | Decodes H.264/H.265 video from a local file and then shares the YUV buffer with CUDA to draw a black box in the left corner. | <!-- l4t_mm_video_decode_cuda.md -->
107  | @ref l4t_mm_video_cuda_enc_group | Use CUDA to draw a black box in the YUV buffer and then feeds it to video encoder to generate an H.264/H.265 video file. | <!-- l4t_mm_video_cuda_enc_guide.md -->
108  | @ref l4t_mm_vid_decode_trt | Uses simple TensorRT calls to save the bounding box info to a file. | <!-- l4t_mm_video_dec_tensorrt.md -->
109  | @ref l4t_mm_jpeg_encode | Uses `libjpeg-8b` APIs to encode JPEG images from software-allocated buffers. | <!-- l4t_mm_jpeg_encode.md -->
110  | @ref l4t_mm_jpeg_decode | Uses `libjpeg-8b` APIs to decode a JPEG image from software-allocated buffers. | <!-- l4t_mm_jpeg_decode.md -->
111  | @ref nvvid_scal_col_group | Uses `V4L2` APIs to do video format conversion and video scaling. | <!-- l4t_mm_vid_scal_col_fmt_conv.md -->
112  | @ref l4t_mm_08_video_decode_drm | Uses the NVIDIA<sup>&reg;</sup> Tegra<sup>&reg;</sup> Direct Rendering Manager (DRM) to render video stream or UI. | <!-- l4t_mm_08_video_decode_drm.md -->
113  | @ref l4t_mm_jpeg_capture_group | Simultaneously uses Libargus API to preview camera stream and libjpeg-8b APIs to encode JPEG images. | <!-- l4t_mm_camera_jpeg_capture.md -->
114  | @ref l4t_mm_camera_recording | Gets the real-time camera stream from the Libargus API and feeds it into the video encoder to generate H.264/H.265 video files. | <!-- l4t_mm_camera_recording.md -->
115  | @ref l4t_mm_v4l2_cam_cuda_group | Captures images from a V4L2 camera and shares the stream with CUDA engines to draw a black box in the upper left corner. | <!-- l4t_mm_v4l2_cam_cuda.md -->
116  | @ref nvvid_13_multi_camera_group | Captures multiple cameras and composites them to one frame.|
117  | @ref l4t_mm_14_multivideo_decode | Decodes multiple H.264, H.265, VP8, VP9, MPEG4, and MPEG2 videos from local files and writes YUV buffer into corresponding files. | <!-- l4t_mm_14_multivideo_decode.md -->
118  | @ref nvvid_backend_group | Performs intelligent video analytics on four concurrent video streams going through a decoding process using the on chip decoders, video scaling using on chip scalar, and GPU compute. | <!-- l4t_mm_backend.md -->
119  | @ref l4t_mm_camcap_tensorrt_multichannel_group | Performs independent processing on four different resolutions of video capture coming directly from camera. | <!-- l4t_mm_camcap_tensorrt_and_multi_enc.md -->
120  | @ref l4t_mm_v4l2cuda_group | Uses V4L2 image capturing with CUDA format conversion. | <!-- l4t_mm_v4l2cuda.md -->
121 
122 
123 <br>
124  | Tool Name | Description | Directory Location |
125  |-------------|-------------|--------------------|
126  | @ref l4t_mm_caffe_to_tensorRT_group | TBD | tools/ConvertCaffeToTrtModel | <!-- l4t_mm_caffe_to_tensorrt_guide.md -->
127 
128 
129 <br>
130 @if view_outside_MMAPI_reference
131 For details on each sample's structure and the APIs they use, see the
132 "Sample Applications" chapter of <em>L4T Multimedia API
133 Reference</em>. You can get this reference from the NVIDIA Embedded
134 Download Center at:
135 
136  <a href="https://developer.nvidia.com/embedded/downloads" target="_blank">
137 @else
138 For details on each sample's structure and the APIs they use, see
139 @ref l4t_mm_test_group in this reference.
140 @endif
141 
142 
143 @}