Fork me on GitHub
Data Structures | Macros | Typedefs | Functions | Variables

Helper tool to convert .pcap files to Janus .mjr recordings. 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 <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/udp.h>
#include <errno.h>
#include <glib.h>
#include <jansson.h>
#include <pcap.h>
#include <pcap/sll.h>
#include "../debug.h"
#include "p2m-cmdline.h"
#include "pp-rtp.h"
Include dependency graph for pcap2mjr.c:

Data Structures

struct  pcap2mjr_ethernet_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 pcap2mjr_ethernet_header pcap2mjr_ethernet_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 .pcap files to Janus .mjr recordings.

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. These recordings can then be processed and converted to playable files, or replayed via WebRTC again. The pcap2mjr tool is a simple utility that allows you take .pcap network captures, extract a specific RTP session via its SSRC, and convert it to an .mjr Janus recording instead. Its main purpose is helping convert .pcap captures to media files, or make it easier to replay them via Janus.

Using the utility is quite simple. Just pass, as arguments to the tool, the SSRC to extract, the codec used for the RTP packets originally, the path to the .pcap source file, and the path to the destination file, e.g.:

./pcap2mjr -c vp8 -s 12345678 /path/to/source.pcap /path/to/destination.mjr

If the tool can't detect any RTP packet with that SSRC, it will result in an error.

Recordings post-processing utility

Macro Definition Documentation

#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))

Typedef Documentation

Function Documentation

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

Variable Documentation

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