|
1 | | -============================================ |
2 | | -``nxcamera`` NxCamera video test application |
3 | | -============================================ |
| 1 | +============================================= |
| 2 | +``nxcamera`` Camera/Video Stream Test Command |
| 3 | +============================================= |
| 4 | + |
| 5 | +Introduction |
| 6 | +============ |
| 7 | + |
| 8 | +``nxcamera`` is a command-line utility for testing camera devices and video |
| 9 | +stream capture in NuttX. It is built on top of the NuttX video subsystem |
| 10 | +(using a V4L2-style interface) and is typically used to: |
| 11 | + |
| 12 | +- Enumerate and open video device nodes such as ``/dev/video0`` and |
| 13 | + ``/dev/video1`` |
| 14 | +- Configure capture parameters including resolution and pixel format |
| 15 | +- Capture video frames for validation, debugging, or simple data dumping, |
| 16 | + depending on platform support and build configuration |
| 17 | + |
| 18 | +Usage |
| 19 | +===== |
| 20 | + |
| 21 | +``nxcamera`` is an interactive command-line program. Start it from NSH, then |
| 22 | +enter commands at the ``nxcamera>`` prompt: |
| 23 | + |
| 24 | +.. code-block:: console |
| 25 | +
|
| 26 | + nsh> nxcamera |
| 27 | + nxcamera> |
| 28 | +
|
| 29 | +Tip: Execute NSH Commands (Hidden) |
| 30 | +================================== |
| 31 | + |
| 32 | +At the ``nxcamera>`` prompt you can run an NSH command by prefixing it with |
| 33 | +``!``. This is useful for quickly checking system state or invoking other |
| 34 | +utilities without exiting ``nxcamera``. |
| 35 | + |
| 36 | +.. code-block:: console |
| 37 | +
|
| 38 | + nxcamera> !ls /dev |
| 39 | + /dev: |
| 40 | + console |
| 41 | + fb0 |
| 42 | + gpio0 |
| 43 | + gpio1 |
| 44 | + gpio2 |
| 45 | + gpio3 |
| 46 | + loop |
| 47 | + null |
| 48 | + oneshot |
| 49 | + ram0 |
| 50 | + ram1 |
| 51 | + ram2 |
| 52 | + video0 |
| 53 | + video1 |
| 54 | + zero |
| 55 | + nxcamera> !poweroff |
| 56 | + bash> |
| 57 | +
|
| 58 | +A typical workflow at the prompt is: |
| 59 | + |
| 60 | +- ``input /dev/video0`` to set the input video node. |
| 61 | +- ``output /dev/fb0`` to set the output node, for example a framebuffer. |
| 62 | +- ``stream 640 480 30 NV12`` to start streaming with ``width height fps |
| 63 | + format``. |
| 64 | +- ``stop`` to stop streaming. |
| 65 | + |
| 66 | +You may just copy-paste the commands below to get started: |
| 67 | + |
| 68 | +.. code-block:: console |
| 69 | +
|
| 70 | + nxcamera |
| 71 | + input /dev/video0 |
| 72 | + output /dev/fb0 |
| 73 | + stream 640 480 30 YUYV # or NV12 on macOS |
| 74 | +
|
| 75 | +Pixel Format |
| 76 | +============ |
| 77 | + |
| 78 | +For the ``stream`` command, the pixel format depends on the platform. On the |
| 79 | +macOS ``sim`` platform you may use ``NV12``, while on Linux systems ``YUYV`` |
| 80 | +is more commonly used. |
| 81 | + |
| 82 | +Examples |
| 83 | +======== |
| 84 | + |
| 85 | +1. Start ``nxcamera`` and configure a typical interactive capture session: |
| 86 | + |
| 87 | +.. code-block:: console |
| 88 | +
|
| 89 | + nsh> nxcamera |
| 90 | + nxcamera> input /dev/video0 |
| 91 | + nxcamera> output /dev/fb0 |
| 92 | + nxcamera> stream 640 480 30 NV12 |
| 93 | + nxcamera> stop |
| 94 | +
|
| 95 | +.. figure:: nxcamera_macos_sim.png |
| 96 | + :alt: nxcamera running on the macOS SIM platform |
| 97 | + :align: center |
| 98 | + |
| 99 | + ``nxcamera`` using the macOS AVFoundation backend on the SIM platform. |
| 100 | + |
| 101 | +Features and Updates |
| 102 | +==================== |
| 103 | + |
| 104 | +- Multiple camera instances are supported, allowing several cameras to be |
| 105 | + exposed as different device nodes such as ``/dev/video0`` and |
| 106 | + ``/dev/video1``. This makes it easier to select and validate different |
| 107 | + video input sources on the same system. |
| 108 | +- On the ``sim`` platform, support has been added for the macOS |
| 109 | + AVFoundation backend. This enables camera capture and functional |
| 110 | + verification on macOS hosts, subject to build configuration and host |
| 111 | + permission settings. |
0 commit comments