Skip to content

Commit 66a268c

Browse files
authored
Merge pull request #666 from luxonis/docs
Added matroska option to VideoEncoder example (altnerative to ffmpeg)
2 parents f5d13f3 + 6001e78 commit 66a268c

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

docs/source/components/nodes/script.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,24 @@ In the script node you can interface with GPIOs of the VPU using module GPIO. Cu
120120
GPIO.PullDownUp: GPIO.PULL_NONE, GPIO.PULL_DOWN, GPIO.PULL_UP
121121
GPIO.Edge: GPIO.RISING, GPIO.FALLING, GPIO.LEVEL_HIGH, GPIO.LEVEL_LOW
122122
123+
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>`__,
124+
GPIO 40 drives FSYNC signal for both 4-lane cameras, and we have used the code below for this exact reason.
125+
126+
.. code-block:: python
127+
128+
import GPIO
129+
MX_PIN = 40
130+
131+
ret = GPIO.setup(MX_PIN, GPIO.OUT, GPIO.PULL_DOWN)
132+
toggleVal = True
133+
134+
while True:
135+
data = node.io['in'].get() # Wait for a message from the host computer
136+
137+
node.warn('GPIO toggle: ' + str(toggleVal))
138+
toggleVal = not toggleVal
139+
ret = GPIO.write(MX_PIN, toggleVal) # Toggle the GPIO
140+
123141
Using DepthAI :ref:`Messages <components_messages>`
124142
###################################################
125143

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
Encoded bitstream (either MJPEG, H264, or H265) from the device can also be **saved directly into .mp4 container**
22
with no computational overhead on the host computer. See `demo here <https://github.com/luxonis/depthai-experiments/tree/master/gen2-container-encoding>`__
3-
for more information.
3+
for more information.
4+
5+
**Matroska**
6+
7+
Besides ``ffmpeg`` and ``.mp4`` video container (which is patent encumbered), you could also use the ``mkvmerge``
8+
(see `MKVToolNix <https://mkvtoolnix.download/doc/mkvmerge.html>`__ for GUI usage) and ``.mkv`` video container
9+
to mux encoded stream into video file that is supported by all major video players
10+
(eg. `VLC <https://www.videolan.org/vlc/>`__)
11+
12+
.. code-block::
13+
14+
mkvmerge -o vid.mkv video.h265

0 commit comments

Comments
 (0)