1.. zephyr:code-sample:: video-tcpserversink
2   :name: Video TCP server sink
3   :relevant-api: video_interface bsd_sockets
4
5   Capture video frames and send them over the network to a TCP client.
6
7Description
8***********
9
10This sample application gets frames from a video capture device and sends
11them over the network to the connected TCP client.
12
13Requirements
14************
15
16This samples requires a video capture device and network support.
17
18- :zephyr:board:`mimxrt1064_evk`
19- `MT9M114 camera module`_
20
21Wiring
22******
23
24On :zephyr:board:`mimxrt1064_evk`, The MT9M114 camera module should be plugged in the
25J35 camera connector. A USB cable should be connected from a host to the micro
26USB debug connector (J41) in order to get console output via the freelink
27interface. Ethernet cable must be connected to RJ45 connector.
28
29Building and Running
30********************
31
32For :zephyr:board:`mimxrt1064_evk`, the sample can be built with the following command.
33If a mt9m114 camera shield is missing, video software generator will be used instead.
34
35.. zephyr-app-commands::
36   :zephyr-app: samples/drivers/video/tcpserversink
37   :board: mimxrt1064_evk
38   :shield: dvp_fpc24_mt9m114
39   :goals: build
40   :compact:
41
42Sample Output
43=============
44
45.. code-block:: console
46
47    Video device detected, format: RGBP 480x272
48    TCP: Waiting for client...
49
50Then from a peer on the same network you can connect and grab frames.
51
52Example with gstreamer:
53
54.. code-block:: console
55
56    gst-launch-1.0 tcpclientsrc host=192.0.2.1 port=5000 \
57        ! videoparse format=rgb16 width=480 height=272 \
58        ! queue \
59	! videoconvert \
60        ! fpsdisplaysink sync=false
61
62For video software generator, the default resolution should be width=320 and height=160.
63
64References
65**********
66
67.. target-notes::
68
69.. _MT9M114 camera module: https://www.onsemi.com/PowerSolutions/product.do?id=MT9M114
70