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/l4t_mm_14_multivideo_decode.md
Go to the documentation of this file.
1 Copyright (c) 2014-2019, NVIDIA CORPORATION. All rights reserved.
2 
3 @page l4t_mm_14_multivideo_decode 14_multivideo_decode
4 @{
5 
6  - [Overview](#overview)
7  - [Building and Running](#build_and_run)
8  - [Flow](#flow)
9  - [Key Structure and Classes](#key)
10 
11 - - - - - - - - - - - - - - -
12 <a name="overview">
13 ## Overview ##
14 
15 The multivideo_decode sample demonstrates decoding of multiple video streams
16 in parallel. It provides options to "file write" (optional) or "video render"
17 decoded data. Currently the application can decode a maximum of 128 streams
18 in parallel.
19 
20 Video rendering is currently disabled. You must specify the
21 `–-disable-rendering` command line option to avoid using this feature.
22 
23 The command line option `-o` is optional. Use it if the user wants to dump
24 the output file.
25 
26 Supported video formats are:
27 * H.264
28 * H.265
29 * VP8
30 * VP9
31 * MPEG4
32 * MPEG2
33 
34 
35 <a name="build_and_run">
36 - - - - - - - - - - - - - - -
37 ## Building and Running ##
38 
39 ### Prerequisites
40 * You have followed steps 1-3 in @ref mmapi_build.
41 * If you are building from your host Linux PC (x86), you have followed
42  step 4 in @ref mmapi_build.
43 
44 ### To build
45 * Enter:
46 
47  $ cd $HOME/multimedia_api/samples/14_multivideo_decode
48  $ make
49 
50 ### To run
51 * Enter:
52 
53  $ ./multivideo_decode num_files <number_of_files> <file_name1> <in-format1> -o <out_filename1> <file_name2> <in-format2> -o <out_filename2> --disable-rendering [options]
54 
55 ### To view supported options
56 Enter:
57 
58  $ ./multivideo_decode --help
59 
60 ### Example
61 
62  $ ./multivideo_decode ../../data/Video/sample_outdoor_car_1080p_10fps.h264 H264 ../../data/Video/sample_outdoor_car_1080p_10fps.h264 H264 –-disable-rendering
63 
64 
65 <a name="flow">
66 - - - - - - - - - - - - - - -
67 ## Flow
68 The following diagram shows the flow through this sample.
69 
70 ![ ](l4t_mm_14_multivideo_decode.png)
71 
72 * The @b Output @b Plane receives input in bitstream format and delivers it
73  to the @b Decoder for decoding.
74 * Decoded frames are transferred to the @b Capture @b Plane in YUV format.
75 * The application transfers the decoded YUV frames to @b EglRenderer
76  for rendering.
77 * For the @b Output @b Plane the application supports MMAP and USRPTR
78  memory types. For the Capture Plane it supports MMAP and DMABUF memory types.
79 * The application can also dump files from the Capture Plane.
80 
81 
82 <a name="key">
83 - - - - - - - - - - - - - - -
84 ## Key Structure and Classes ##
85 
86 The sample uses the following key structures and classes.
87 
88 | Element | Description |
89 | ---------------- | ----------- |
90 | [NvVideoDecoder](classNvVideoDecoder.html) | Contains all video decoding-related elements and functions. |
91 | dec_capture_loop | A pointer to the thread handler for the decoding capture loop. |
92 
93 The [NvVideoDecoder](classNvVideoDecoder.html) class packages all
94 video decoding-related elements and functions. Key members used in the sample
95 are:
96 
97 | Member | Description |
98 | ---------------- | ----------- |
99 | [output_plane](classNvV4l2Element.html#aaba251827cef1b23e7c42f776e95fee5) | Specifies the V4L2 output plane. |
100 | [capture_plane](classNvV4l2Element.html#a91806d7ed13b4b2c48758e8a02f46c6d) | Specifies the V4L2 capture plane. |
101 | [createVideoDecoder](classNvVideoDecoder.html#a7d4e17585bb745c9c3023173aeb1528a) | Static function to create video decode object. |
102 | [subscribeEvent](classNvV4l2Element.html#a7fd9f21268d5fdc979065b1b04b93220) | Subscribe event. |
103 | [setOutputPlaneFormat](l4t_mm_video_cuda_enc_group.html#NvVideoConverter::setOutputPlaneFormat) | Set output plane format. |
104 | [setCapturePlaneFormat](classNvElement.html#a3ecd42c9dda2cec9506cf2ea8fa021fe) | Set capture plane format. |
105 | [dqEvent](classNvV4l2Element.html#a9a8b5337356f82d04f5fbd7cce6e51e3) | Dqueue the event which reports by the V4L2 device. |
106 | [isInError](classNvElement.html#a3ecd42c9dda2cec9506cf2ea8fa021fe) | Checks if under error state. |
107 
108 Class %NvVideoDecoder contains two key elements: `output_plane`
109 and `capture_plane`. These objects are derived from class type
110 [NvV4l2ElementPlane](group__l4t_mm__nvv4lelementplane__group.html).
111 The sample uses the following key members:
112 
113 | Element | Description |
114 | ---------------- | ----------- |
115 | [setupPlane](classNvV4l2ElementPlane.html#a89959f455e5222f686187cc826b1b345) | Sets up the plane of V4L2 element. |
116 | [deinitPlane](classNvV4l2ElementPlane.html#af89cfe87d8f818beb0478bcf5b72574c) | Destroys the plane of the V4L2 element. |
117 | [setStreamStatus](classNvV4l2ElementPlane.html#a03164dde4d7ab41f3e92b41e13059316) | Starts/stops the stream. |
118 | [setDQThreadCallback](classNvV4l2ElementPlane.html#a37f213325e0e4857180f5b2319317d6a) | Sets the callback function of the dqueue buffer thread. |
119 | [startDQThread](classNvV4l2ElementPlane.html#a31f77f5e5ed1f320caa44a868a7cbedd) | Starts the thread of the dqueue buffer. |
120 | [stopDQThread](classNvV4l2ElementPlane.html#aa798d14493de321fa90aeab6d944ca87) | Stops the thread of the dqueue buffer. |
121 | [qBuffer](classNvV4l2ElementPlane.html#af4d52964fcfd37082f47682e457f5e95) | Queues the V4L2 buffer. |
122 | [dqBuffer](classNvV4l2ElementPlane.html#a8dfcbc666ee6f36a02abfb1170ae05cd) | Dequeues the V4L2 buffer. |
123 | [getNumBuffers](classNvV4l2ElementPlane.html#ac5cd394a7e0a4afd69395759aeac8787) | Gets the number of V4L2 buffers. |
124 
125 @}
Defines a helper class for V4L2 Video Decoder.
Defines a helper class for operations performed on a V4L2 Element plane.
int setOutputPlaneFormat(uint32_t pixfmt, uint32_t width, uint32_t height, enum v4l2_nv_buffer_layout type)
Sets the format on the converter output plane.