Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/source/components/nodes/script.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@ In the script node you can interface with GPIOs of the VPU using module GPIO. Cu
GPIO.PullDownUp: GPIO.PULL_NONE, GPIO.PULL_DOWN, GPIO.PULL_UP
GPIO.Edge: GPIO.RISING, GPIO.FALLING, GPIO.LEVEL_HIGH, GPIO.LEVEL_LOW

Here's **an example** of toggling GPIO pin 40 inside Script node from the host (via :ref:`XLinkIn`). On `OAK-SoM-Pro <https://docs.luxonis.com/projects/hardware/en/latest/pages/BW2099.html>`__,
GPIO 40 drives FSYNC signal for both 4-lane cameras, and we have used the code below for this exact reason.

.. code-block:: python

import GPIO
MX_PIN = 40

ret = GPIO.setup(MX_PIN, GPIO.OUT, GPIO.PULL_DOWN)
toggleVal = True

while True:
data = node.io['in'].get() # Wait for a message from the host computer

node.warn('GPIO toggle: ' + str(toggleVal))
toggleVal = not toggleVal
ret = GPIO.write(MX_PIN, toggleVal) # Toggle the GPIO

Using DepthAI :ref:`Messages <components_messages>`
###################################################

Expand Down
13 changes: 12 additions & 1 deletion docs/source/includes/container-encoding.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Encoded bitstream (either MJPEG, H264, or H265) from the device can also be **saved directly into .mp4 container**
with no computational overhead on the host computer. See `demo here <https://github.com/luxonis/depthai-experiments/tree/master/gen2-container-encoding>`__
for more information.
for more information.

**Matroska**

Besides ``ffmpeg`` and ``.mp4`` video container (which is patent encumbered), you could also use the ``mkvmerge``
(see `MKVToolNix <https://mkvtoolnix.download/doc/mkvmerge.html>`__ for GUI usage) and ``.mkv`` video container
to mux encoded stream into video file that is supported by all major video players
(eg. `VLC <https://www.videolan.org/vlc/>`__)

.. code-block::

mkvmerge -o vid.mkv video.h265