Extracting audio from pcap and mixing them

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Extracting audio from pcap and mixing them

Juan F Gomez
Hello List,

I have a pcap file which contains two streams of g729 audio. I want to
extract them and mix them. The problem is that one audio is shorter
than the other by about 2 secs. When seeing the pcap in wireshark you
can see that one of the streams starts earlier (like 5 seconds earlier
than the other). When I mix them they both start at the same time and
of course get out of sync. Here is the pipeline I am using:

gst-launch-1.0 \
filesrc location=test.pcap ! tee name=t ! \
queue ! pcapparse dst-port=30100 ! "application/x-rtp, payload=18,
clock-rate=8000" ! rtpg729depay ! avdec_g729 !\
audiomixer name=mix ! wavenc ! filesink location=out.wav t. !\
queue ! pcapparse dst-port=30200 ! "application/x-rtp, payload=18,
clock-rate=8000" ! rtpg729depay ! avdec_g729 ! mix.

Any Ideas are welcome. Thanks

JF
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Extracting audio from pcap and mixing them

Nicolas Dufresne-5


Le mar. 14 janv. 2020 22 h 45, Juan F Gomez <[hidden email]> a écrit :
Hello List,

I have a pcap file which contains two streams of g729 audio. I want to
extract them and mix them. The problem is that one audio is shorter
than the other by about 2 secs. When seeing the pcap in wireshark you
can see that one of the streams starts earlier (like 5 seconds earlier
than the other). When I mix them they both start at the same time and
of course get out of sync. Here is the pipeline I am using:

gst-launch-1.0 \
filesrc location=test.pcap ! tee name=t ! \
queue ! pcapparse dst-port=30100 ! "application/x-rtp, payload=18,
clock-rate=8000" ! rtpg729depay ! avdec_g729 !\
audiomixer name=mix ! wavenc ! filesink location=out.wav t. !\
queue ! pcapparse dst-port=30200 ! "application/x-rtp, payload=18,
clock-rate=8000" ! rtpg729depay ! avdec_g729 ! mix.

Each pcap element don't know about each other, so they probably assume first buffer is time 0. To handle this, we'd need to use the same pcapparse, but this is not supported by this simple element. Meanwhile, you can use the ts-offset property.


Any Ideas are welcome. Thanks

JF
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel