File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # RTP Replay
2+
3+ Have you ever wanted to replay rtpdump files in a browser? Use this script!
4+
5+ 1 ) Create an rtpdump file (see https://wiki.wireshark.org/rtpdump and https://webrtchacks.com/video_replay/ )
6+
7+ 2 ) Run rtp-to-webrtc as directed: https://github.com/webrtc-rs/webrtc/tree/master/examples/examples/rtp-to-webrtc
8+
9+ 3 ) Run:
10+
11+ python3 replayer.py <yourfile.rtpdump>
12+
13+ ## Disclaimer
14+
15+ This is not an official Google product.
Original file line number Diff line number Diff line change 1+ import sys
2+ import socket , time
3+
4+ UDP_IP = "127.0.0.1"
5+ UDP_PORT = 5004
6+
7+ sock = socket .socket (socket .AF_INET ,
8+ socket .SOCK_DGRAM )
9+
10+ f = open (sys .argv [1 ], 'rb' )
11+
12+ dump = f .read ()
13+
14+
15+
16+ ind = dump .find (b"\n " )
17+ header = dump [0 :ind ]
18+
19+ print (header )
20+
21+ ind = ind + 4 * 4 + 1
22+
23+ while ind < len (dump ):
24+ ind += 2
25+ plen = (dump [ind ] << 8 ) + dump [ind + 1 ]
26+ ind += 6
27+ packet = dump [ind :ind + plen ]
28+ print (packet )
29+ sock .sendto (packet , (UDP_IP , UDP_PORT ))
30+ ind = ind + plen
31+ time .sleep (.1 )
You can’t perform that action at this time.
0 commit comments