Fork me on GitHub
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables

Helper tool to convert Janus .mjr recordings to .pcap files. More...

#include <arpa/inet.h>
#include <endian.h>
#include <inttypes.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
#include <glib.h>
#include <jansson.h>
#include "../debug.h"
#include "../version.h"
#include "pp-rtp.h"
Include dependency graph for mjr2pcap.c:

Data Structures

struct  mjr2pcap_global_header
 
struct  mjr2pcap_packet_header
 
struct  mjr2pcap_ethernet_header
 
struct  mjr2pcap_ip_header
 
struct  mjr2pcap_udp_header
 

Macros

#define htonll(x)   ((1==htonl(1)) ? (x) : ((gint64)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))
 
#define ntohll(x)   ((1==ntohl(1)) ? (x) : ((gint64)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))
 

Typedefs

typedef struct mjr2pcap_global_header mjr2pcap_global_header
 
typedef struct mjr2pcap_packet_header mjr2pcap_packet_header
 
typedef struct mjr2pcap_ethernet_header mjr2pcap_ethernet_header
 
typedef struct mjr2pcap_ip_header mjr2pcap_ip_header
 
typedef struct mjr2pcap_udp_header mjr2pcap_udp_header
 

Functions

int main (int argc, char *argv[])
 

Variables

int janus_log_level = 4
 
gboolean janus_log_timestamps = FALSE
 
gboolean janus_log_colors = TRUE
 
char * janus_log_global_prefix = NULL
 
int lock_debug = 0
 
int working = 0
 

Detailed Description

Helper tool to convert Janus .mjr recordings to .pcap files.

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Our Janus WebRTC gateway provides a simple helper (janus_recorder) to allow plugins to record audio, video and text frames sent by users. The mjr2pcap tool is a simple utility that allows you remove extract RTP packets from Janus recordings and save them to a .pcap file instead. Notice that network levels are simulated, and so are timestamps for when the packets have really been received, since that info is not stored in .mjr files. As such, its main purpose is helping analyze RTP packets, rather than investigate network issues.

Using the utility is quite simple. Just pass, as arguments to the tool, the path to the .mjr source file, and the path to the destination file, e.g.:

./mjr2pcap /path/to/source.mjr /path/to/destination.pcap

An attempt to process a non-RTP recording will result in an error.

Recordings post-processing utility

Macro Definition Documentation

◆ htonll

#define htonll ( x)    ((1==htonl(1)) ? (x) : ((gint64)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))

◆ ntohll

#define ntohll ( x)    ((1==ntohl(1)) ? (x) : ((gint64)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))

Typedef Documentation

◆ mjr2pcap_ethernet_header

typedef struct mjr2pcap_ethernet_header mjr2pcap_ethernet_header

◆ mjr2pcap_global_header

typedef struct mjr2pcap_global_header mjr2pcap_global_header

◆ mjr2pcap_ip_header

typedef struct mjr2pcap_ip_header mjr2pcap_ip_header

◆ mjr2pcap_packet_header

typedef struct mjr2pcap_packet_header mjr2pcap_packet_header

◆ mjr2pcap_udp_header

typedef struct mjr2pcap_udp_header mjr2pcap_udp_header

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Variable Documentation

◆ janus_log_colors

gboolean janus_log_colors = TRUE

◆ janus_log_global_prefix

char* janus_log_global_prefix = NULL

◆ janus_log_level

int janus_log_level = 4

◆ janus_log_timestamps

gboolean janus_log_timestamps = FALSE

◆ lock_debug

int lock_debug = 0

◆ working

int working = 0