# HTTP Streaming Example for ameba-rtos-pro2/Delay Time (Official FreeRTOS SDK)

**URL:** <https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283>\
**Category:** SDK\
**Tags:** evb-amb82, rtl8735b\
**Created:** [July 30, 2025, 9:58am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283 "2025-07-30T09:58:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [July 30, 2025, 9:58am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/1 "2025-07-30T09:58:12Z")

</div>

Hello, I’m starting to migrate my project from the Arduino IDE to the official FreeRTOS. Although I can’t find an example in the HTTP server streaming image, I need a delay of less than 100 ms in my project, and the RTSP example isn’t compatible due to the protocol delay.

I’ve tried the official SDK’s RTSP before, but the delay is now a problem!

Attached is the image above the project folder.

Best regards.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/4/40d6b4290e9cebb22e3ad0166535b9582f987875.png)

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [August 8, 2025, 9:06am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/2 "2025-08-08T09:06:09Z")

</div>

Hi @TeschRenan ,

Currently streaming via HTTP server is not supported yet in the FreeRTOS SDK. In Arduino SDK, HTTPDisplayJPEGContinuous example captures JPEG images and streams them to a browser over HTTP. It uses Motion JPEG (MJPEG) encoding to transmit the image continuously.

For RTSP streaming, reducing the caching time in VLC to 0 ms can significantly lower latency. Based on my tests, the lowest achievable latency with this setting is approximately 500 ms. To further reduce the delay, lowering the video resolution can be done as well, as higher resolutions require more processing and transmission time.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/f/f4824127c48867dd30b23ca154bced056754226f.png)

However, video streaming performance can be affected by various factors such as Wi-Fi strength and environmental conditions, etc.

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [August 21, 2025, 1:38am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/3 "2025-08-21T01:38:02Z")

</div>

Hi Pammy, how are you?  
Thanks for the replies. I’ll try after testing, but I can’t play the RTSP example right now.  
Can you help me with this?  
Example: I set up the “mmfv2\_video\_example” example in cmake and then changed the SSID and password in main.h in the inc folder!

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/c/c1f5f2b0fbda4b10b5f5ad665cb89bae8b8a59e4.png)

The build works and I burn the CI, however the Wifi is not connecting, can I see the result? I think I was fiddling with some things, but now I can’t find the problem.

I can’t find the STA\_MODE\_SSID var in the code, I don’t know which value the code uses because Wifi init is very simple and doesn’t use this var either.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/6/610831f91bae9d7d82788a7c4c4bdb699ad3b621.png)

I’ll try to test another example when I’m waiting for the answer.

Thank you.

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [August 21, 2025, 5:53am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/4 "2025-08-21T05:53:56Z")

</div>

Hi @TeschRenan ,

After flashing the image to AMB82 Mini board, you can use AT command to connect to WiFi. You need not modify main.h.

You can refer to [ameba-rtos-pro2/component/at\_cmd/atcmd\_wifi.c at main · Ameba-AIoT/ameba-rtos-pro2 · GitHub](https://github.com/Ameba-AIoT/ameba-rtos-pro2/blob/main/component/at_cmd/atcmd_wifi.c) and [ameba-rtos-pro2/component/at\_cmd/atcmd\_wifi.h at main · Ameba-AIoT/ameba-rtos-pro2 · GitHub](https://github.com/Ameba-AIoT/ameba-rtos-pro2/blob/main/component/at_cmd/atcmd_wifi.h) .

STA:

ATW0={SSID}

ATW1={Password}

ATWC ← To connect

AP:

ATW3={SSID}

ATW4={Secret Password}

ATW5={channel}

ATWA ← start AP

AT command manual: [https://raw.githubusercontent.com/ambiot/ambd\_sdk/12dab4363fd0087eb4874461f8d3f6094110595f/doc/AN0025%20Realtek%20at%20command.pdf](https://raw.githubusercontent.com/ambiot/ambd_sdk/12dab4363fd0087eb4874461f8d3f6094110595f/doc/AN0025%20Realtek%20at%20command.pdf)

Application Note: [Welcome to AmebaPro2’s Documentation! — AmebaPro2's Documentation v0.1 documentation](https://ameba-doc-rtos-pro2-sdk.readthedocs-hosted.com/en/latest/index.html)

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [August 23, 2025, 8:49pm UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/5 "2025-08-23T20:49:23Z")

</div>

Perfect Pammy, thanks for the explanation, but in my product I need to save the SSID and password in another method, from there I implemented this function to execute before wifi\_common\_init(); in video\_example\_media\_framework.c the function is this!

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/2/2216e491aea40f012e8a63918c5f3f4449b4eada.png)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/c/c917f65dffaf799bb4f414efdfdfc2dba1eb7a02.png)

And it is not working, I disabled this function and enabled it by AT command and the connection also does not work.

Initializing WIFI …[Driver]: [HALMAC]

11692M HALMAC\_MAJOR\_VER = 1

HALMAC\_PROTOTYPE\_VER = 4

HALMAC\_MINOR\_VER = 20

HALMAC\_PATCH\_VER =

[Driver]: The driver include MP

[Driver]: Ver = libwlan:2025.05.23.13.46\_b9.6\_f72abedb2cc8f958bf54e9c74d8a457beb4411b9

RFE type = 0

start\_addr=(0x4000), end\_addr=(0x8000), buffer\_size=(0x4000), smp\_number\_max=(2048)

WIFI initialized

[FAST\_CONNECT] Fast connect profile is empty, abort fast connection

init\_thread(58), Available heap 0x6955cc0

use ATW0, ATW1, ATWC to make wifi connection

wait for wifi connection…

ATW0=“Julliano”  
ATW0=“Julliano”

[ATW0]: _AT\_WLAN\_SET\_SSID_ [“Julliano”]

[MEM] After do cmd, available heap 110456160

# 

ATW1=“12345678”  
ATW1=“12345678”

[ATW1]: _AT\_WLAN\_SET\_PASSPHRASE_ [“12345678”]

[MEM] After do cmd, available heap 110456160

# 

ATWC  
ATWC

Joining BSS by SSID “Julliano”…

RFE type = 0

start\_addr=(0x4000), end\_addr=(0x8000), buffer\_size=(0x4000), smp\_number\_max=(2048)

[Driver]: set ssid [“Julliano”]

(0) Scan: 1, Auth: 0, Assoc: 0, 4way: 0, connect: 0, reason: 65533

ERROR: Can’t connect to AP

[MEM] After do cmd, available heap 110455104

# 

auto reconnect …

[Driver]: set ssid [“Julliano”]

I think that I had setting the configs correctly, but don’t, work.

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [August 23, 2025, 10:13pm UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/6 "2025-08-23T22:13:56Z")

</div>

I encountered the first problem, I can’t use “I need to use SSID and password directly”, I was testing continuously!

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [August 25, 2025, 2:18am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/7 "2025-08-25T02:18:20Z")

</div>

To use AT command. You need not include the quote (“ “).

ATW0=Julliano

ATW1=12345678

ATWC

For the method that you prefer,

In the FreeRTOS SDK, you can look for the following functions and take it for reference while you write your own function.

- int wifi\_enable\_sta\_mode(rtw\_network\_info\_t \*connect\_param, int timeout, int retry)
- int wifi\_disable\_sta\_mode(void)

> <https://github.com/Ameba-AIoT/ameba-rtos-pro2/blob/main/project/realtek_amebapro2_v0_example/scenario/ai_glass/src/wlan_scenario.c>

How to apply the function? After you created the function, you can use the function directly in your application/example code. You can take reference from [ameba-rtos-pro2/project/realtek\_amebapro2\_v0\_example/scenario/ai\_glass/src/ai\_glass\_initialize.c at 3ff32fed42453fe753eacebecf8ffdb204f696f6 · Ameba-AIoT/ameba-rtos-pro2 · GitHub](https://github.com/Ameba-AIoT/ameba-rtos-pro2/blob/3ff32fed42453fe753eacebecf8ffdb204f696f6/project/realtek_amebapro2_v0_example/scenario/ai_glass/src/ai_glass_initialize.c#L1650) to see how the function can be used.

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [August 25, 2025, 10:27am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/8 "2025-08-25T10:27:27Z")

</div>

Hi Pammy, how are you? Thanks for the explanation. The code worked so far, but I was trying to implement MJPEG from the HTTP server.  
Do you have a tips to try implementing something similar to the Arduino example?

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [August 26, 2025, 12:11am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/9 "2025-08-26T00:11:45Z")

</div>

Hello @Pammy , regarding the HTTP Stream example, can you guide me through the steps I need to implement the code in the official SDK?

Initially, I was trying to use the snapshot example and send the capture from an HTTP server.  
What do you think is a good idea?

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [August 26, 2025, 12:47am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/10 "2025-08-26T00:47:10Z")

</div>

In the cpp Class Video, captureSnapshot is used!

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/1/1b4f09088932fa422cd7eb2c2b155871ae5a8c02.png)

What’s the difference in implementing this method in the FreeRTOS SDK?

Is the performance of running code using Arduino the same as that of FreeRTOS by directly implementing this example?  
Can I get better performance with FreeRTOS?

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [August 26, 2025, 3:39am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/11 "2025-08-26T03:39:14Z")

</div>

Hi @TeschRenan

Both SDKs deliver the same performance, since the Arduino SDK is built on the FreeRTOS SDK code base. However, in FreeRTOS SDK, Streaming via HTTP is not supported.

In the Arduino SDK, the “HTTPDisplayJPEGContinuous” example works by:

1. Capturing frames one by one.
2. Compressing each frame individually as JPEG (using the MJPEG encoder).
3. Sending those frames sequentially over an HTTP connection.

On the client side, because the browser receives a continuous sequence of JPEG images, it looks like a video stream.

Since the Arduino SDK is built on the FreeRTOS SDK code base, it is possible to create a similar example in FreeRTOS SDK.

If you would like to create your own example, you can create a new example in [ameba-rtos-pro2/project/realtek\_amebapro2\_v0\_example/src/mmfv2\_video\_example at main · Ameba-AIoT/ameba-rtos-pro2 · GitHub](https://github.com/Ameba-AIoT/ameba-rtos-pro2/tree/main/project/realtek_amebapro2_v0_example/src/mmfv2_video_example) and add your function name in [ameba-rtos-pro2/project/realtek\_amebapro2\_v0\_example/src/mmfv2\_video\_example/video\_example\_media\_framework.c at main · Ameba-AIoT/ameba-rtos-pro2 · GitHub](https://github.com/Ameba-AIoT/ameba-rtos-pro2/blob/main/project/realtek_amebapro2_v0_example/src/mmfv2_video_example/video_example_media_framework.c) .

Another option that you can consider exploring: [[Sharing] Video Streaming from Ameba Pro2 to Browser via FFmpeg](https://forum.amebaiot.com/t/sharing-video-streaming-from-ameba-pro2-to-browser-via-ffmpeg/1505)

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [October 28, 2025, 10:04am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/12 "2025-10-28T10:04:22Z")

</div>

Hi @TeschRenan

Here’s a websocket viewer video for sharing. This feature is under development.

[![](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/8/84e207b24be6a8a3ee07713b2f4b9a3cde76055b.jpeg "AMB82 Mini Sneak Preview: Low Latency Video Streaming") ](https://www.youtube.com/watch?v=zD5WddERdG0)

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [October 31, 2025, 6:46am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/13 "2025-10-31T06:46:48Z")

</div>

Dear @TeschRenan,

For low-latency video streaming, please refer to the following folder for example:  
[Ameba-AIoT/ameba-rtos-pro2: media\_websocket\_viewer](https://github.com/Ameba-AIoT/ameba-rtos-pro2/tree/main/component/example/media_websocket_viewer).

You may follow the instructions in the README file to test this example. Optimization work is still in progress.

Thank you.

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [October 31, 2025, 11:29am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/14 "2025-10-31T11:29:12Z")

</div>

Hello Pammy!

Perfect, thanks to sharing this example.

Best Regards.

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [October 31, 2025, 11:31am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/15 "2025-10-31T11:31:18Z")

</div>

@Pammy in final release is need the [htdocs.bin](https://github.com/Ameba-AIoT/ameba-rtos-pro2/blob/main/component/example/media_websocket_viewer/htdocs.bin "htdocs.bin") in SD Card our this archive is possible sended to Flash memory in the future?

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [November 3, 2025, 1:52am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/16 "2025-11-03T01:52:03Z")

</div>

Hi @TeschRenan

Yes, in the future there will be alternative options to store htdocs.bin; it’s part of our ongoing optimization plan. Meanwhile, you may continue using the SD card for testing.

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [November 3, 2025, 5:55pm UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/17 "2025-11-03T17:55:53Z")

</div>

Hi, thanks for the example. I used the example and the video speed is very good, unfortunately the image quality is low. Can you help me improve the quality?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/0/0768459b681453b093f0a5909c33c560521f4a1c.jpeg)

I used the example configuration and F37 camera.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/d/d67c03773f379ebe12eb772c2040a1a05971ab48.png)

---

<div class="post-metadata">

**Author:** ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)\
**Post date:** [November 5, 2025, 5:23am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/18 "2025-11-05T05:23:42Z")

</div>

Hi @TeschRenan

Thank you for your feedback, we will look into the image quality. Do you have any preferred configuration?

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [November 5, 2025, 10:47am UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/19 "2025-11-05T10:47:16Z")

</div>

Hi Pammy, in this case the code is set to FullHD, but after starting the video the resolution is lower. I believe the Websocket decoding reduces the image quality, creating a pixelated effect.

Attached is the link to the video recording with a comparison made by my laptop camera. This one is also in FullHD, okay?

Would it be possible to provide the source code of the HTML page, as I only need the video stream from the camera for my product?

[AMB82-Video](https://1drv.ms/f/c/5d070e3f94d536d2/EuL6S72VBdlMnquEASEj0fYBdPH-U_ytZxnQ5ir_oyScMw?e=5fie9n)

Best Regards

---

<div class="post-metadata">

**Author:** ![TeschRenan](https://avatars.discourse-cdn.com/v4/letter/t/958977/32.png) [@TeschRenan](https://forum.amebaiot.com/u/TeschRenan)\
**Post date:** [November 7, 2025, 1:18pm UTC](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283/20 "2025-11-07T13:18:16Z")

</div>

Hi @Pammy, have you watched my two videos?

Do you plan to share the complete WebSocket code for use as an example, without the additional .bin file?  
Best regards.

[Next page](https://forum.amebaiot.com/t/http-streaming-example-for-ameba-rtos-pro2-delay-time-official-freertos-sdk/4283.md?page=2)
