Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6680715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:30:27+00:00 2026-05-26T04:30:27+00:00

I have pcap file that contains RTP data which in turn is audio for

  • 0

I have pcap file that contains RTP data which in turn is audio for G.729 codec. Is there a way to decode this stream by pushing it into FFMPEG? This would probably mean I have to extract the RTP payload data from the PCAP file and then somehow pass it to FFMPEG.

Any guidelines and pointers are highly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:30:27+00:00Added an answer on May 26, 2026 at 4:30 am

    This answer doesn’t require ffmpeg, but I assume you dont really care how the audio is extracted… check out How to Decode G729 on the wireshark wiki…

    1. In Wireshark, use menu "Statistics -> RTP -> Show All Streams". Select the desired stream and press "Analyze".

    2. In the next dialog screen, press "Save Payload…". Save options are Format = .raw and Channel = forward. Name file my_input.raw.

    3. Convert the .raw file to .pcm format using the Open G.729 decoder. Syntax: va_g729_decoder.exe my_input.raw my_output.pcm. Or for Linux: wine va_g729_decoder.exe my_input.raw my_output.pcm.

    4. The .pcm file contains 16-bit linear PCM samples at 8000 Hz. Note that each sample is in Little-Endian format. To convert to .au format, all you need to do is prepend the 24-byte au header, and convert each PCM sample to network byte order (or Big-Endian). The following perl script will do the trick.

    USAGE: perl pcm2au.pl [my_inputFile] [my_outputFile]

    $usage = "Usage: 'perl $0 [Source PCM File] [Destination AU File]' ";
    
    $my_inputFile = shift or die $usage;
    $my_outputFile = shift or die $usage;
    
    open(INPUTFILE, "$my_inputFile") or die "Unable to open file: $!\n";
    binmode INPUTFILE;
    
    open(OUTPUTFILE, "> $my_outputFile") or die "Unable to open file: $!\n";
    binmode OUTPUTFILE;
    
    ###################################
    # Write the AU header
    ###################################
    
    print OUTPUTFILE  ".snd";
    
    $foo = pack("CCCC", 0,0,0,24);
    print OUTPUTFILE  $foo;
    
    $foo = pack("CCCC", 0xff,0xff,0xff,0xff);
    print OUTPUTFILE  $foo;
    
    $foo = pack("CCCC", 0,0,0,3);
    print OUTPUTFILE  $foo;
    
    $foo = pack("CCCC", 0,0,0x1f,0x40);
    print OUTPUTFILE  $foo;
    
    $foo = pack("CCCC", 0,0,0,1);
    print OUTPUTFILE  $foo;
    
    #############################
    # swap the PCM samples
    #############################
    
    while (read(INPUTFILE, $inWord, 2) == 2) {
    
        @bytes   = unpack('CC', $inWord);
        $outWord = pack('CC', $bytes[1], $bytes[0]);
        print OUTPUTFILE  $outWord;
    }
    
    close(OUTPUTFILE);
    close(INPUTFILE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which generates its own Wireshark pcap-file (sort of a network
I am trying to write a .pcap file, which is something that can be
I have a pcap captured with Wireshark. Is there any function in Wireshark that
I have some network traffic captured pcap file and want to send its packets
I have an issue related to the AMR codec in RTP. I have RTP
I want to parse only RTP packets from a .pcap file generated from WireShark
I have written a packet reader that uses libpcap to read a capture file.
I have a pcap file as input and I want to get particular strings
Does anyone know of a tool that will take a PCAP file as input
i am using pcap to create a packet sniffer. i have this tcp structure:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.