Loading...
Searching...
No Matches
pcap2mjr.c File Reference
Tools and utilities » Recordings post-processing utility

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 "../version.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

Copyright
  GNU General Public License v3

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

The SSRC is optional but recommended, since a pcap capture may contain multiple streams, RTP or not, and so the tool might need help figuring out which RTP stream specifically should be converted to .mjr. Omitting the SSRC will instruct the tool to try and autodetect the first SSRC it finds, and use that one as a filter.

If the tool can't detect any RTP packet with the specified SSRC, itwill 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

## pcap2mjr_ethernet_header

typedef struct pcap2mjr_ethernet_header pcap2mjr_ethernet_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