Skip to content

Commit 7a6dca4

Browse files
Update start_rtsp_server.sh
1 parent f883260 commit 7a6dca4

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1-
#!/bin/bash
1+
#!/bin/bash
2+
23
BASEDIR=$(dirname "$0")
3-
cd $BASEDIR
4-
4+
cd "$BASEDIR"
5+
6+
# Take MP4 file as argument
7+
MP4_FILE="$1"
8+
9+
if [ -z "$MP4_FILE" ]; then
10+
echo "Usage: $0 <mp4-file-path>"
11+
exit 1
12+
fi
13+
14+
# Convert to absolute path (important for uri=file://)
15+
MP4_FILE_ABS=$(realpath "$MP4_FILE")
16+
17+
echo "Using MP4 file: $MP4_FILE_ABS"
518

6-
#./test-launch "( videotestsrc pattern=snow ! video/x-raw,width=1920,height=1080,format=I420 ! videoconvert ! x264enc ! rtph264pay name=pay0 pt=96 audiotestsrc ! audio/x-raw,channels=2,rate=48000 ! audioconvert ! avenc_aac ! rtpmp4apay name=pay1 pt=97 )"
19+
./test-launch "(
20+
uridecodebin uri=file://$MP4_FILE_ABS name=dec
721
22+
dec. ! queue ! videoconvert ! videoscale ! videorate !
23+
video/x-raw,width=1920,height=1080,framerate=30/1 !
24+
x264enc bitrate=2000 key-int-max=60 tune=zerolatency speed-preset=veryfast !
25+
rtph264pay name=pay0 pt=96
826
9-
./test-launch "( videotestsrc pattern=snow ! video/x-raw,width=1920,height=1080,format=I420,framerate=25/1 ! videoconvert ! x264enc bitrate=2000 tune=zerolatency ! rtph264pay name=pay0 pt=96 audiotestsrc ! audio/x-raw,channels=2,rate=48000 ! audioconvert ! avenc_aac ! rtpmp4apay name=pay1 pt=97 )"
27+
dec. ! queue ! audioconvert ! audioresample !
28+
audio/x-raw,rate=48000,channels=2 !
29+
avenc_aac ! rtpmp4apay name=pay1 pt=97
30+
)"

0 commit comments

Comments
 (0)