Skip to content

Commit

Permalink
added more stun server
Browse files Browse the repository at this point in the history
  • Loading branch information
jh committed Aug 30, 2024
1 parent 4ac9028 commit 60810bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
You'll need `meson`, the `gstreamer-plugins-bad,gstreamer-plugins-good` library, and the following librarys.

* gstreamer >= 1.22.0
* gstreamer1.0-nice
* pkg-config
* libjson-glib-dev >= 1.66
* libsoup2.4-dev
* libsoup-3.0-dev
* glib-2.0 >= 2.74.6
* sqlite3
* libudev
Expand Down
9 changes: 5 additions & 4 deletions build_debian_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ARCH=$(dpkg --print-architecture)
# make clean
# make
VERSION=0.1.3
VERSION=0.1.4
TAG=v${VERSION}

if [ -d deb_root ]; then
Expand All @@ -26,6 +26,7 @@ Architecture: ${PKG_ARCH}
Maintainer: Michael Liu <yjdwbj@gmail.com>
Installed-Size: 1421
Depends: libglib2.0-0 (>= 2.74),
gstreamer1.0-nice,
gstreamer1.0-x (>= 1.22),
gstreamer1.0-opencv (>= 1.22),
gstreamer1.0-plugins-bad (>= 1.22),
Expand Down Expand Up @@ -54,7 +55,7 @@ EOF
cat > ${DEB_PKG_ROOT}/DEBIAN/postinst <<EOF
#!/bin/bash
GWC_USER_PATH=/home/\${SUDO_USER}/.config/gwc
GWC_USER_PATH=/home/\${SUDO_USER}/.config/gwc/webroot
USER_SYSTEMD=/home/\${SUDO_USER}/.config/systemd/user/default.target.wants
if [ ! -d \${USER_SYSTEMD} ]; then
Expand Down Expand Up @@ -100,12 +101,12 @@ EOF
CAPS=video/x-raw,width=1280,height=720,framerate=10/1,format=YUY2
VIDEO_PATH=/mnt/nfs
UDPHOST=224.1.1.5
UDPHOST=127.0.0.1
WEB_PORT=9001
AUTH_USER=admin
AUTH_PWD=admin
# 10 mintues
MAX_TIME=10
IFACE=eth0
EOF
Expand Down
11 changes: 11 additions & 0 deletions rtspsrc-webrtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@

#define STUN_SERVER "stun://stun.l.google.com:19302"

const char *g_stun_sv[] = {
"stun.l.google.com:19302",
"stun1.l.google.com:19302",
"stun2.l.google.com:19302",
"stun3.l.google.com:19302",
"stun4.l.google.com:19302",
"stun.ekiga.net",
"stun.stunprotocol.org:3478",
"stun.voipbuster.com",
"stun.voipstunt.com"};

#define AUDIO_PORT "6006"
#define VIDEO_PORT "6005"
#define MUDP_ADDR "224.1.1.4"
Expand Down
4 changes: 2 additions & 2 deletions webrtc-sendonly.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,13 +803,13 @@ int main(int argc, char *argv[]) {
app->video_dev, strvcaps, app->videoflip, clockstr, enc);
}


#define NS_OF_SECOND 1000000000
if (app->max_time > 0) {
gchar *splitfile = g_strdup_printf("udpsrc port=%d multicast-group=%s multicast-iface=%s ! "
" application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,payload=(int)96 ! "
" rtph264depay ! h264parse ! splitmuxsink muxer=matroskamux muxer-factory=matroskamux "
" max-size-time=%"G_GUINT64_FORMAT" location=%s/video%s.mkv max-files=100",
app->udpport, app->udphost, app->iface,(app->max_time * 60 * GST_SECOND), app->record_path,"%05d");
app->udpport, app->udphost, app->iface,(app->max_time * 60 * NS_OF_SECOND), app->record_path,"%05d");
gchar *tmp = g_strdup_printf("%s ! rtph264pay config-interval=-1 aggregate-mode=1 ! "
" application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,payload=(int)96 ! "
" queue leaky=1 ! udpsink port=%d host=%s multicast-iface=%s async=false sync=false %s ",
Expand Down

0 comments on commit 60810bd

Please sign in to comment.