MP4 Recording

Materials

Example

In this example, we will use the Ameba Pro2 development board to record video and audio data from the on-board camera sensor (JX-F37P) and audio codec to an MP4 file on the SD card.

The following examples shows different use cases for MP4 recording.

  1. AudioOnly

  2. VideoOnly

  3. SingleVideoWithAudio

  4. DoubleVideoWithAudio

Open one of the RecordMP4 examples in File -> Examples -> AmebaMultimedia -> RecordMP4

../../../_images/image01136.png

Compile the code and upload it to Ameba. After pressing the Reset button, the Ameba Pro 2 board will start recording MP4 to SD card.

../../../_images/image02132.png

After the recording duration has passed, the MP4 file will stop recording.

../../../_images/image03113.png

Disconnect power from the Ameba Pro 2 board, remove the SD card and connect it to a computer to view the contents. Depending on the compiled example, there will be either one or two MP4 videos. Using VLC to open the MP4 file, detailed information about the MP4 files can be obtained in FileFileTools -> Codec Information`

Example

MP4 file details

RecordMP4AudioOnly

Single 30 second MP4 file with audio only

../../../_images/image0475.png

RecordMP4VideoOnly

Single 30 second MP4 file with video only

../../../_images/image0556.png

RecordMP4SingleVideoWithAudio

Single 30 second MP4 file with audio and video

../../../_images/image0639.png

RecordMP4DoubleVideoWithAudio

One 30 second and one 15 second MP4 file

Both files with audio and video

../../../_images/image0732.png
../../../_images/image0822.png

There are 4 additional examples that has been integrated with NTPClient. These examples complement the original examples, by being able to set the last modified time of the recordings to the actual time and date automatically.

They are:

  1. AudioOnlyWithNTPClient

  2. VideoOnlyWithNTPClient

  3. SingleVideoWithAudioAndNTPClient

  4. DoubleVideoWithAudioAndNTPClient