---
# System prepended metadata

title: 'Streaming test (RTSP, MJPG)'

---

# Streaming test (RTSP, MJPG)
### Test streaming server on PC
* server and environment
```
0. hardware specs:
    cpu:
        Architecture:        x86_64
        CPU op-mode(s):      32-bit, 64-bit
        Byte Order:          Little Endian
        CPU(s):              12
        On-line CPU(s) list: 0-11
        Thread(s) per core:  2
        Core(s) per socket:  6
        Socket(s):           1
        NUMA node(s):        1
        Vendor ID:           GenuineIntel
        CPU family:          6
        Model:               158
        Model name:          Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
        Stepping:            10
        CPU MHz:             3212.542
        CPU max MHz:         4300.0000
        CPU min MHz:         800.0000
        BogoMIPS:            6384.00
        Virtualization:      VT-x
        L1d cache:           32K
        L1i cache:           32K
        L2 cache:            256K
        L3 cache:            12288K
        NUMA node0 CPU(s):   0-11
    mem:
        Memory block size:       128M
        Total online memory:      32G
        Total offline memory:      0B
    gpu:
        Nvidia 1080Ti

1. use jagereye_ng.io.streaming StreamReaderThread 30fps, 6 frames buffer,
    which keep fetch newest frame from video source. StreamReader gstreamger is default pipeline setting.
2. streaming server with 1 client connection  
ps:rtsp server cpu usage grows when multiple client connection establish.
3. server test on 10.10.0.39
4. ipcam 10.10.0.89
5. rtsp server 4 threads
```
* decode video streaming + encode streaming performance
    |            |mjpeg      |rtsp|
    |-|-|-|
    |cpu         |55*-80%    |75*-115%|
    |memory      |1%         |1%|
    *cpu lower bound is both mjpeg rtsp streamReader connect to same source at the same time


* encode simple image streaming performance
    |           |mjpeg      |rtsp|
    |-|-|-|
    |cpu         |55-70%     |60-80%|
    |memory      |0.3%       |0.4%|

#### client media player (on pc)
* connect to rtsp server (30 fps 1080p h.264) performance
    |           |nx         |   vlc|
    |-|-|-|
    |cpu         |15-25%     |   3-5%|
    |gpu mem        |  89mb          |   98mb    |
    |memory      |1.5%       |   0.6%|
    |latency     |0.5-1s     |   1-1.5s|
    |fps         |28-29      |   30|
    |frame drop  |sometimes  |   often|
    |bandwidth   |1.5-2.5Mbps|NA|

    *fps: real fps is lower than the number
* connect to mjpeg server (30 fps 1080p) performance
    |            |nx         |   vlc|
    |-|-|-|
    |cpu         |45-60%     |   7-12%|
    |gpu mem       | 74mb           |  12m     |
    |memory      |1.8%       |   0.7%|
    |latency     |0.5-1s     |   0.5-1s|
    |fps         |*30        |   NA|
    |frame drop  |sometimes  |   often|
    |bandwidth   |~75Mbps|NA|

    *fps: real fps is lower than the number

--------------------------------------------
## Test streaming server on tx2
* server and environment
```
    0. hardware specs:
        cpu:
            Architecture:         aarch64
            Byte Order:           Little Endian
            CPU(s):               6
            On-line CPU(s) list:  0,3-5
            Off-line CPU(s) list: 1,2
            Thread(s) per core:   1
            Core(s) per socket:   4
            Socket(s):            1
            Vendor ID:            ARM
            Model:                3
            Model name:           Cortex-A57
            Stepping:             r1p3
            CPU max MHz:          2035.2000
            CPU min MHz:          345.6000
            BogoMIPS:             62.50
            L1d cache:            32K
            L1i cache:            48K
            L2 cache:             2048K
            Flags:                fp asimd evtstrm aes pmull sha1 sha2 crc32
        mem:
            Memory block size:         1G
            Total online memory:       8G
            Total offline memory:      0B
        gpu:
            Nvidia 256 cuda core
    1. use jagereye_ng.io.streaming StreamReaderThread 30fps, 6 frames buffer,
        which keep fetch newest frame from video source. StreamReader gstreamger is use gpu decode.
    2. streaming server with 1 client connection  
    ps:rtsp server cpu usage grows when multiple client connection establish.
    3. server test on 10.10.0.69
    4. ipcam 10.10.0.188
    5. rtsp server 4 threads
```

* decode video streaming + encode streaming performance
    |            |mjpeg      |   rtsp|
    |-|-|-|
    |cpu         |80-90%     |   38-180%|
    |memory      |2.3%       |   1.9-3.9%|
    |gpu         |*0%        |   *0%|

    *gpu 0% might not be sampled while decode 1080p video

* encode simple image streaming performance
    |            |mjpeg      |   rtsp|
    |-|-|-|
    |cpu         |50-55%     |   ~130%|
    |memory      |0.9%       |   1.6%|
    |gpu         |0%         |   0%|

### client media player (on pc)

* connect to rtsp server (30 fps 1080p h.264) performance
    |           |nx         |   vlc|
    |-|-|-|
    |cpu         |37%        |   6.9%|
    |gpu mem       |78mb            |    98mb   |
    |memory      |1.4%       |   0.6%|
    |latency     |0.5-1s     |   NA (too lag to measure, maybe 0-1s)|
    |fps         |20         |   *30|
    |frame drop  |sometimes  |   frequently|
    |bandwidth   |1.5Mbps|NA|

    *fps: real fps is lower than the number

* connect to mjpeg server (30 fps 1080p) performance
    |           |nx         |   vlc|
    |-|-|-|
    |cpu         |65-72%     |   41-59%|
    |gpu mem       | 43mb           |  13m     |
    |memory      |1.4%       |   0.8%|
    |latency     |<0.5s      |   <0.5s|
    |fps         |29.29      |   NA|
    |frame drop  |seldom     |   seldom|
    |bandwidth   |~75Mbps|NA|

    *fps: real fps is lower than the number

---------------------------------------------
### client media player (on PC)

* doing nothing resource usage
    |            |nx         |  vlc|
    | - | - | -|
    |cpu         |5-9%       |   0%|
    |gpu        |   40m         |   0m    |
    |memory      |1.4%       |   0.5%|

* connect to ipcam 10.10.0.89 (30 fps 1080p h.264) performance
    |            |nx         |  vlc|
    | - | - | -|
    |cpu         |40-50%     |   5-10%|
    |gpu        |   47m         |   98m    |
    |memory      |1.7%       |   0.4%|
    |latency     |0.1-0.5s   |   0.1-0.5s|
    |frame drop  |sometimes  |   seldom|
    |bandwidth   |5 Mbps|NA|

---------------------------------------------
## NX recording
file ext: mkv
codec: same as streaming input format (H.264 MPEG-4 AVC, MJPG)