diff --git a/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image01.png b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image01.png new file mode 100644 index 0000000..e7b2507 Binary files /dev/null and b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image01.png differ diff --git a/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image02.png b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image02.png new file mode 100644 index 0000000..005f785 Binary files /dev/null and b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image02.png differ diff --git a/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image03.png b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image03.png new file mode 100644 index 0000000..bf2b2ed Binary files /dev/null and b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image03.png differ diff --git a/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image04.png b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image04.png new file mode 100644 index 0000000..00f14eb Binary files /dev/null and b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image04.png differ diff --git a/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image05.png b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image05.png new file mode 100644 index 0000000..e120170 Binary files /dev/null and b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image05.png differ diff --git a/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image06.png b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image06.png new file mode 100644 index 0000000..aa17607 Binary files /dev/null and b/source/_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image06.png differ diff --git a/source/amebapro2/API_Documents/Multimedia/Class Demuxer.rst b/source/amebapro2/API_Documents/Multimedia/Class Demuxer.rst new file mode 100644 index 0000000..baa41f6 --- /dev/null +++ b/source/amebapro2/API_Documents/Multimedia/Class Demuxer.rst @@ -0,0 +1,174 @@ +Class Demuxer +============= + +.. contents:: + :local: + :depth: 2 + +**Demuxer Class** +------------------ + +**Description** +~~~~~~~~~~~~~~~ + +A class used to handle MP4 file processing and extract audio and video streams from an MP4 file. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + class Demuxer + +**Members** +~~~~~~~~~~~ + ++---------------------------+------------------------------------------+ +| **Public Constructors** | ++===========================+==========================================+ +| Demuxer::Demuxer | Constructs a Demuxer object. | ++---------------------------+------------------------------------------+ +| **Public Methods** | ++---------------------------+------------------------------------------+ +| Demuxer::begin | Begin initializes and starts the demuxer | +| | for processing an MP4 file. | ++---------------------------+------------------------------------------+ +| Demuxer::pause | Pause the RTSP streaming. | ++---------------------------+------------------------------------------+ +| Demuxer::resume | Resume the RTSP streaming. | ++---------------------------+------------------------------------------+ +| Demuxer::end | Stop demuxer. | ++---------------------------+------------------------------------------+ + +**Demuxer::begin** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Begin initializes and starts the demuxer for processing an MP4 file. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void begin(const char* MP4FileName, uint32_t loopMode, uint32_t startTime = 0); + +**Parameters** +~~~~~~~~~~~~~~ + +MP4FileName: The name of the MP4 file to be processed. + +loopMode: Determines whether the file should play in a loop. (Valid value: 0 (No looping) & 1 (looping)) + +startTime: The starting position (in milliseconds) from which playback begins. (Default: 0ms) + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `DemuxerRTSP `_ + +.. note :: "Demuxer.h" must be included to use the class function. + +**Demuxer::pause** +------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Pause the RTSP streaming. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void pause(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `DemuxerRTSP `_ + +.. note :: "Demuxer.h" must be included to use the class function. + +**Demuxer::resume** +-------------------- + +**Description** +~~~~~~~~~~~~~~~ + +Resume the RTSP streaming. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void pause(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +Example: `DemuxerRTSP `_ + +.. note :: "Demuxer.h" must be included to use the class function. + +**Demuxer::end** +----------------- + +**Description** +~~~~~~~~~~~~~~~ + +Stop demuxer. + +**Syntax** +~~~~~~~~~~ + +.. code-block:: c++ + + void end(void); + +**Parameters** +~~~~~~~~~~~~~~ + +NA + +**Returns** +~~~~~~~~~~~ + +NA + +**Example Code** +~~~~~~~~~~~~~~~~ + +NA + +.. note :: "RTP.h" must be included to use the class function. + diff --git a/source/amebapro2/API_Documents/Multimedia/Class VideoStreamOverlay.rst b/source/amebapro2/API_Documents/Multimedia/Class VideoStreamOverlay.rst index f784f73..789eec0 100644 --- a/source/amebapro2/API_Documents/Multimedia/Class VideoStreamOverlay.rst +++ b/source/amebapro2/API_Documents/Multimedia/Class VideoStreamOverlay.rst @@ -905,7 +905,7 @@ This function returns the calculated resized width. **Example Code** ~~~~~~~~~~~~~~~~ -Example: TBD +Example: `VideoOSDImage `_ .. note :: "VideoStreamOverlay.h" must be included to use the class function. @@ -941,7 +941,7 @@ This function returns the calculated resized height. **Example Code** ~~~~~~~~~~~~~~~~ -Example: TBD +Example: `VideoOSDImage `_ .. note :: "VideoStreamOverlay.h" must be included to use the class function. @@ -977,7 +977,7 @@ This function returns the calculated heapsize as an unsigned int. **Example Code** ~~~~~~~~~~~~~~~~ -Example: TBD +Example: `VideoOSDImage `_ .. note :: "VideoStreamOverlay.h" must be included to use the class function. @@ -1033,7 +1033,7 @@ NA **Example Code** ~~~~~~~~~~~~~~~~ -Example: TBD +Example: `VideoOSDImage `_ .. note :: "VideoStreamOverlay.h" must be included to use the class function. @@ -1065,7 +1065,7 @@ NA **Example Code** ~~~~~~~~~~~~~~~~ -Example: TBD +Example: `VideoOSDImage `_ .. note :: "VideoStreamOverlay.h" must be included to use the class function. Each image requires setting a new block index. \ No newline at end of file diff --git a/source/amebapro2/API_Documents/Multimedia/index.rst b/source/amebapro2/API_Documents/Multimedia/index.rst index 792bde1..d36e0fb 100644 --- a/source/amebapro2/API_Documents/Multimedia/index.rst +++ b/source/amebapro2/API_Documents/Multimedia/index.rst @@ -7,10 +7,11 @@ Multimedia Class AudioDecoder Class AudioEncoder Class AudioStream + Class Demuxer Class MotionDetection Class MP4Recording Class RTP Class RTSP Class StreamIO Class VideoStream - Class VideoStreamOverlay + Class VideoStreamOverlay \ No newline at end of file diff --git a/source/amebapro2/Example_Guides/Multimedia/RTSP Demuxer.rst b/source/amebapro2/Example_Guides/Multimedia/RTSP Demuxer.rst new file mode 100644 index 0000000..d173a32 --- /dev/null +++ b/source/amebapro2/Example_Guides/Multimedia/RTSP Demuxer.rst @@ -0,0 +1,78 @@ +RTSP Demuxer +============= + +.. contents:: + :local: + :depth: 2 + +Materials +--------- + +- `AMB82-mini `_ x 1 +- SD Card + +Example +------- +This example demonstrates on how to use a demuxer on the AmebaPro2 board to process an MP4 file from an SD card and stream its content over RTSP (Real-Time Streaming Protocol). + +Open the example in “File” -> “Examples” -> “AmebaMultimedia” -> “DemuxerRTSP”. + +|image01| + +First, you can choose whether to loop the MP4 file during streaming. If looping is enabled, the stream will play continuously without stopping. + +Next, fill in the “ssid” with your WiFi network SSID and “pass” with the network password. + +Finally, specify the name of the MP4 file you want to stream via RTSP. It is recommended to use an MP4 file recorded with the AmebaPro2 board. + +|image02| + +Compile the code and upload it to Ameba. + +After pressing the Reset button, wait for the Ameba Pro 2 board to connect to the WiFi network. The board’s IP address and network port number for RTSP will be shown in the Serial Monitor. + +On a computer connected to the same WiFi network, open VLC media player, and go to “Media” -> “Open Network Stream”. + +|image03| + +Since RTSP is used as the streaming protocol, key in `“rtsp://{IPaddress}:{port}”`` as the Network URL in VLC media player, replacing {IPaddress} with the IP address of your Ameba Pro2 board, and {port} with the RTSP port shown in Serial Monitor. The default RTSP port number is 554. + +Next, click “Play” to start RTSP streaming. + +|image04| + +**To pause the streaming:** + +Enter the command **“pause”** to pause the stream using Serial Monitor. + +|image05| + +**To resume the streaming:** + +Enter the command **“resume"** to resume the stream using Serial Monitor. + +|image06| + +.. |image01| image:: ../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image01.png + :width: 654 px + :height: 854 px + +.. |image02| image:: ../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image02.png + :width: 606 px + :height: 298 px + +.. |image03| image:: ../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image03.png + :width: 432 px + :height: 482 px + +.. |image04| image:: ../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image04.png + :width: 765 px + :height: 659 px + +.. |image05| image:: ../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image05.png + :width: 348 px + :height: 388 px + +.. |image06| image:: ../../../_static/amebapro2/Example_Guides/Multimedia/RTSP_Demuxer/image06.png + :width: 318 px + :height: 385 px \ No newline at end of file diff --git a/source/amebapro2/Example_Guides/Multimedia/index.rst b/source/amebapro2/Example_Guides/Multimedia/index.rst index f5de6d6..188ab6f 100644 --- a/source/amebapro2/Example_Guides/Multimedia/index.rst +++ b/source/amebapro2/Example_Guides/Multimedia/index.rst @@ -17,7 +17,7 @@ Multimedia Play MP3 with SD card RTP Audio Stream RTSP Audio Stream + RTSP Demuxer RTSP Streaming V7RC RTSP Streaming - RTSP Streaming with OSD Image - \ No newline at end of file + RTSP Streaming with OSD Image \ No newline at end of file