Jetson Linux Multimedia API Reference

32.4.3 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
multimedia_api/ll_samples/docs/l4t_mm_camera_recording.md
Go to the documentation of this file.
1 Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
2 
3 @page l4t_mm_camera_recording 10_camera_recording
4 
5 - [Overview](#overview)
6 - [Building and Running](#build_and_run)
7 - [Flow](#flow)
8 - [Key Structure and Classes](#key)
9 
10 <a name="overview">
11 - - - - - - - - - - - - -
12 ## Overview ##
13 
14 This sample demonstrates how to use libargus to set
15 up the camera class components for a capture operation.
16 An EGLStream is also created to connect to the V4L2
17 video encoder to allow for capturing encoded video
18 streams to a file.
19 
20 <a name="build_and_run">
21 - - - - - - - - - - - - -
22 ## Building and Running ##
23 
24 
25 #### Prerequisites ####
26 * You have a camera.
27 * You have followed Steps 1-3 in @ref mmapi_build.
28 * If you are building from your host Linux PC (x86), you have
29  followed Step 4 in @ref mmapi_build.
30 
31 
32 ### To build:
33 * Enter:
34 
35  $ cd $HOME/tegra_multimedia_api/samples/10_camera_recording
36  $ make
37  The sample creates the H.264 video file in the current directory.
38 
39 
40 ### To run
41 * Enter:
42 
43  $ ./camera_recording [OPTIONS]
44 
45 ### To view supported options
46 
47  $ ./camera_recording -h
48 
49 
50 <a name="flow">
51 - - - - - - - - - - - - - - -
52 ## Flow
53 The following diagram shows the flow of data through this sample.
54 
55 ![](l4t_mm_camera_recording.jpg)
56 
57 This sample demonstrates the camera producer and consumer programming model.
58 The image output is performed using the EGLStream.
59 This is an efficient and zero-copy output to various EGLStream consumers.
60 Possible consumers include:
61 
62 * OpenGL ES
63 * CUDA
64 * Direct EGL display output
65 * JPEG
66 
67 <a name="key">
68 - - - - - - - - - - - - - - -
69 ## Key Structure and Classes ##
70 
71 The following classes are used. For more information on libargus and the EGLStream, refer to
72 the libargus documentation.
73 
74 | Classes | Description |
75 | ------- | ----------- |
76 | class [NvVideoEncoder](classNvVideoEncoder.html) | The class contains all the video encode related elements and functions. |
77 
78 The \c %NvVideoEncoder class packages all the video encoding related elements and functions.
79 The key members used in the sample are as follows:
80 
81 | %NvVideoEncoder | Description |
82 | -------------- | ----------- |
83 | [output_plane](classNvV4l2Element.html#aaba251827cef1b23e7c42f776e95fee5) | V4L2 output plane. |
84 | [capture_plane](classNvV4l2Element.html#a91806d7ed13b4b2c48758e8a02f46c6d) | V4L2 capture plane. |
85 | [createVideoEncoder](classNvVideoEncoder.html#aabb707f9188805ab7f097f82b3648351) | Static function to create video encode object. |
86 | [setExtControls](classNvV4l2Element.html#aaec1f40b777bb98870f18766690d7984) | Sets the external control to the V4L2 device. |
87 | [setOutputPlaneFormat](classNvVideoDecoder.html#a7cacbe8afce830495c25514cbd7c8efe) | Sets the output plane format. |
88 | [setCapturePlaneFormat](classNvVideoDecoder.html#abc20773d70cfafed881238dfda6046ce) | Sets the capture plane format. |
89 | [isInError](classNvV4l2Element.html#aa60303288ff142ea08e53fa1dc7a72bf) | Checks if under an error state. |
90 
91 The \c %NvVideoEncoder class contains two key elements:
92 * `output_plane`
93 * `capture_plane`
94 
95 The %NvVideoEncoder object is derived from the following class type:
97 
98 The key members used in the sample are as follows:
99 
100 | %NvV4l2ElementPlane | Description |
101 | ------------------ | ----------- |
102 | [setupPlane](classNvV4l2ElementPlane.html#a89959f455e5222f686187cc826b1b345) | Sets up the plane of the V4L2 element. |
103 | [deinitPlane](classNvV4l2ElementPlane.html#af89cfe87d8f818beb0478bcf5b72574c) | Destroys the plane of the V4L2 element. |
104 | [setStreamStatus](classNvV4l2ElementPlane.html#a03164dde4d7ab41f3e92b41e13059316) | Starts/stops the stream. |
105 | [setDQThreadCallback](classNvV4l2ElementPlane.html#a37f213325e0e4857180f5b2319317d6a) | Sets the callback function of the dqueue buffer thread. |
106 | [startDQThread](classNvV4l2ElementPlane.html#a31f77f5e5ed1f320caa44a868a7cbedd) | Starts the thread of the dqueue buffer. |
107 | [stopDQThread](classNvV4l2ElementPlane.html#aa798d14493de321fa90aeab6d944ca87) | Stops the thread of the dqueue buffer. |
108 | [qBuffer](classNvV4l2ElementPlane.html#af4d52964fcfd37082f47682e457f5e95) | Queues the V4L2 buffer. |
109 | [dqBuffer](classNvV4l2ElementPlane.html#a8dfcbc666ee6f36a02abfb1170ae05cd) | Dqueue the V4L2 buffer. |
110 | [getNumBuffers](#NvV4l2ElementPlane::getNumBuffers) | Gets the number of V4L2 buffers. |
111 | [getNthBuffer](classNvV4l2ElementPlane.html#a868d438908f3d267dd4af1033133892f) | Gets the nth number V4L2 buffer. |
112 
113 
114 
115 @}
Defines a helper class for operations performed on a V4L2 Element plane.
Defines a helper class for V4L2 Video Encoder.