-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Natalie Silvanovich
committed
Sep 5, 2023
1 parent
b0e9e89
commit ffedbf3
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# RTP Replay | ||
|
||
Have you ever wanted to replay rtpdump files in a browser? Use this script! | ||
|
||
1) Create an rtpdump file (see https://wiki.wireshark.org/rtpdump and https://webrtchacks.com/video_replay/) | ||
|
||
2) Run rtp-to-webrtc as directed: https://github.com/webrtc-rs/webrtc/tree/master/examples/examples/rtp-to-webrtc | ||
|
||
3) Run: | ||
|
||
python3 replayer.py <yourfile.rtpdump> | ||
|
||
## Disclaimer | ||
|
||
This is not an official Google product. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import sys | ||
import socket, time | ||
|
||
UDP_IP = "127.0.0.1" | ||
UDP_PORT = 5004 | ||
|
||
sock = socket.socket(socket.AF_INET, | ||
socket.SOCK_DGRAM) | ||
|
||
f = open(sys.argv[1], 'rb') | ||
|
||
dump = f.read() | ||
|
||
|
||
|
||
ind = dump.find(b"\n") | ||
header = dump[0:ind] | ||
|
||
print(header) | ||
|
||
ind = ind + 4*4 + 1 | ||
|
||
while ind < len(dump): | ||
ind +=2 | ||
plen = (dump[ind] << 8) + dump[ind+1] | ||
ind += 6 | ||
packet = dump[ind:ind+plen] | ||
print(packet) | ||
sock.sendto(packet, (UDP_IP, UDP_PORT)) | ||
ind = ind + plen | ||
time.sleep(.1) |