Important note: this is a fork of original RTPProxy tool focused exclusively on extractaudio tool.
These modifications were mostly vibe-coded mainly to quickly serve one task - extract audio from pcap files produced by sngrep utility with possibility to force the output codec.
A powerful Docker-based audio extraction tool for RTP streams from PCAP files, rtpproxy recordings, and RTP stream data.
The extractaudio-docker.sh tool provides enhanced audio extraction capabilities with:
- Automatic Docker image building and management
- Support for multiple audio formats and codecs
- Linux SLL format PCAP conversion
- True stereo extraction from dual RTP streams
- SRTP encrypted stream support (when compiled with libsrtp)
The tool automatically builds the required Docker image on first use. To manually build:
./extractaudio-docker.sh --build-imageBasic syntax:
./extractaudio-docker.sh [wrapper options] [extractaudio options] input_file output_file--build-image- Force rebuild of Docker image--show-info- Show Docker image information and codec support--shell- Open interactive shell in container--direct- Skip Linux SLL conversion (use original extractaudio)--true-stereo- Split RTP streams by SSRC for true stereo (default with -s)--mixed-stereo- Use single stream mixed to stereo (legacy mode)
-
-d- Delete input files after processing -
-s- Enable stereo output (2 channels) -
-i- Set idle priority for processing -
-n- Disable synchronization (nosync mode) -
-e- Fail on decoder errors instead of continuing -
-S- Scan mode - analyze files without extracting audio -
-F FORMAT- Output file format (wav, aiff, flac, ogg, etc.) -
-D FORMAT- Output data format (pcm_16, pcm_24, float, etc.) -
-A FILE- Answer channel capture file -
-B FILE- Originate channel capture file
--alice-crypto CSPEC- Crypto specification for Alice (answer) channel--bob-crypto CSPEC- Crypto specification for Bob (originate) channel
CSPEC format: suite:key[:salt]
Basic mono extraction:
./extractaudio-docker.sh -F wav call.pcap output.wavTrue stereo from dual RTP streams:
./extractaudio-docker.sh -s -F wav call.pcap stereo_output.wavSeparate channel files:
./extractaudio-docker.sh -A answer.pcap -B originate.pcap -s output.wavHigh-quality PCM output:
./extractaudio-docker.sh -F wav -D pcm_16 call.pcap hq_output.wavFLAC lossless compression:
./extractaudio-docker.sh -F flac -D pcm_24 call.pcap lossless.flacScan mode (analyze without extraction):
./extractaudio-docker.sh -S call.pcap- PCAP files (.pcap extension)
- Linux SLL format (automatically converted)
- rtpproxy recording directories (rdir.a.rtp, rdir.o.rtp)
- Individual RTP stream files
- G.711 μ-law (PCMU) - payload type 0
- G.711 A-law (PCMA) - payload type 8
- G.729 - payload type 18
- G.722 - payload type 9
- GSM - payload type 3
- Opus - dynamic payload types
- WAV, AIFF, AU, RAW, PAF, SVX, NIST, VOC
- IRCAM, W64, MAT4, MAT5, PVF, XI, HTK
- SDS, AVR, WAVEX, SD2, FLAC, CAF, WVE
- OGG, MPC2K, RF64
- Docker must be installed and accessible
- First run may take several minutes to build the image
- File paths are automatically mounted into the container
For detailed options and examples:
./extractaudio-docker.sh --helpFor Docker image information:
./extractaudio-docker.sh --show-info