/
CM AAC Encode Pre-record

CM AAC Encode Pre-record

The cmPrerecAac is an AAC encoder with a cache that is used to encode the audio/x-raw(PCM) data to audio/mpeg(AAC) data by the fdkaac library. It supports set cache duration in seconds for the codec data, mainly used for MP4 records. This is designed for pre-recording.


API Instructions

create/destroy

gpointer cm_prerec_aac_create(); void cm_prerec_aac_destroy(gpointer hd);

start/stop

void cm_prerec_aac_start(gpointer hd); void cm_prerec_aac_stop(gpointer hd);

parameters

/* @duration Cache time in seconds*/ void cm_prerec_aac_set_duration(gpointer hd, guint64 duration ); /* @return Encode output format, "audio/mpeg,..." */ const char* cm_prerec_aac_get_caps_str(gpointer hd);

data


Demo

Mp4 PreRecord Demo

Structure

Get raw data and use prerecord to encode, then start the mp4 record 3s later.

image-20240520-072539.png

Main codes

For more details please refer to the demo file.

Test result

image-20240520-072618.png

The mp4 file can be displayed on the PC, it contains pre-recorded data for about 4s.

Related content

CM AAC Encode
CM AAC Encode
More like this
CM H264 Encode Pre-Record
CM H264 Encode Pre-Record
More like this
CM MP4 Record
CM MP4 Record
More like this
CM APP Source
CM APP Source
More like this
CM OPUS Encode
CM OPUS Encode
More like this
API
More like this