Audio/Video recorder. More...
#include <inttypes.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "mutex.h"
#include "refcount.h"
#include "rtp.h"
Go to the source code of this file.
Data Structures | |
struct | janus_recorder |
Structure that represents a recorder. More... | |
Typedefs | |
typedef enum janus_recorder_medium | janus_recorder_medium |
Media types we can record. | |
typedef struct janus_recorder | janus_recorder |
Structure that represents a recorder. | |
Enumerations | |
enum | janus_recorder_medium { JANUS_RECORDER_AUDIO , JANUS_RECORDER_VIDEO , JANUS_RECORDER_DATA } |
Media types we can record. More... | |
Functions | |
void | janus_recorder_init (gboolean tempnames, const char *extension) |
Initialize the recorder code. | |
void | janus_recorder_deinit (void) |
De-initialize the recorder code. | |
janus_recorder * | janus_recorder_create (const char *dir, const char *codec, const char *filename) |
Create a new recorder. | |
janus_recorder * | janus_recorder_create_full (const char *dir, const char *codec, const char *fmtp, const char *filename) |
Create a new recorder with additional info. | |
int | janus_recorder_pause (janus_recorder *recorder) |
Pause recording packets. | |
int | janus_recorder_resume (janus_recorder *recorder) |
Resume recording packets. | |
int | janus_recorder_add_extmap (janus_recorder *recorder, int id, const char *extmap) |
Add an RTP extension to this recording. | |
int | janus_recorder_description (janus_recorder *recorder, const char *description) |
Set the description for this recording. | |
int | janus_recorder_opusred (janus_recorder *recorder, int red_pt) |
Mark this recording as using RED for audio. | |
int | janus_recorder_encrypted (janus_recorder *recorder) |
Mark this recorder as end-to-end encrypted (e.g., via Insertable Streams) | |
int | janus_recorder_save_frame (janus_recorder *recorder, char *buffer, uint length) |
Save an RTP frame in the recorder. | |
int | janus_recorder_close (janus_recorder *recorder) |
Close the recorder. | |
void | janus_recorder_destroy (janus_recorder *recorder) |
Destroy the recorder instance. | |
Audio/Video recorder.
Audio/Video recorder (headers)
Implementation of a simple recorder utility that plugins can make use of to record audio/video frames to a Janus file. This file just saves RTP frames in a structured way, so that they can be post-processed later on to get a valid container file (e.g., a .opus file for Opus audio or a .webm file for VP8 video) and keep things simpler on the plugin and core side. Check the Recordings documentation for more details.
typedef struct janus_recorder janus_recorder |
Structure that represents a recorder.
typedef enum janus_recorder_medium janus_recorder_medium |
Media types we can record.
int janus_recorder_add_extmap | ( | janus_recorder * | recorder, |
int | id, | ||
const char * | extmap ) |
Add an RTP extension to this recording.
[in] | recorder | The janus_recorder instance to add the extension to |
[in] | id | Numeric ID of the RTP extension |
[in] | extmap | Namespace of the RTP extension |
int janus_recorder_close | ( | janus_recorder * | recorder | ) |
Close the recorder.
[in] | recorder | The janus_recorder instance to close |
janus_recorder * janus_recorder_create | ( | const char * | dir, |
const char * | codec, | ||
const char * | filename ) |
Create a new recorder.
[in] | dir | Path of the directory to save the recording into (will try to create it if it doesn't exist) |
[in] | codec | Codec the packets to record are encoded in ("vp8", "opus", "h264", "g711", "vp9") |
[in] | filename | Filename to use for the recording |
janus_recorder * janus_recorder_create_full | ( | const char * | dir, |
const char * | codec, | ||
const char * | fmtp, | ||
const char * | filename ) |
Create a new recorder with additional info.
[in] | dir | Path of the directory to save the recording into (will try to create it if it doesn't exist) |
[in] | codec | Codec the packets to record are encoded in ("vp8", "opus", "h264", "g711", "vp9") |
[in] | fmtp | Codec-specific details (e.g., the H.264 or VP9 profile) |
[in] | filename | Filename to use for the recording |
void janus_recorder_deinit | ( | void | ) |
De-initialize the recorder code.
int janus_recorder_description | ( | janus_recorder * | recorder, |
const char * | description ) |
Set the description for this recording.
[in] | recorder | The janus_recorder instance to add the description to |
[in] | description | The description |
void janus_recorder_destroy | ( | janus_recorder * | recorder | ) |
Destroy the recorder instance.
[in] | recorder | The janus_recorder instance to destroy |
int janus_recorder_encrypted | ( | janus_recorder * | recorder | ) |
Mark this recorder as end-to-end encrypted (e.g., via Insertable Streams)
janus-pp-rec
out of the box, since the post-processor will not have access to unencrypted media [in] | recorder | The janus_recorder instance to mark as encrypted |
void janus_recorder_init | ( | gboolean | tempnames, |
const char * | extension ) |
Initialize the recorder code.
[in] | tempnames | Whether the filenames should have a temporary extension, while saving, or not |
[in] | extension | Extension to add in case tempnames is true |
int janus_recorder_opusred | ( | janus_recorder * | recorder, |
int | red_pt ) |
Mark this recording as using RED for audio.
[in] | recorder | The janus_recorder instance to configure |
[in] | red_pt | Payload type of RED |
int janus_recorder_pause | ( | janus_recorder * | recorder | ) |
Pause recording packets.
[in] | recorder | The janus_recorder to pause |
int janus_recorder_resume | ( | janus_recorder * | recorder | ) |
Resume recording packets.
[in] | recorder | The janus_recorder to resume |
int janus_recorder_save_frame | ( | janus_recorder * | recorder, |
char * | buffer, | ||
uint | length ) |
Save an RTP frame in the recorder.
[in] | recorder | The janus_recorder instance to save the frame to |
[in] | buffer | The frame data to save |
[in] | length | The frame data length |