-
Notifications
You must be signed in to change notification settings - Fork 38
/
launchEncoderTestPattern.sh
executable file
·50 lines (44 loc) · 1.44 KB
/
launchEncoderTestPattern.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
if [ -z "$1" ]; then
TARGETSERVER="127.0.0.1"
echo "Target Server not specified, assuming ${TARGETSERVER}..."
else
TARGETSERVER="$1"
fi
if [ -z "$2" ]; then
STREAMID="1234"
echo "Target Path not specified, assuming ${STREAMID}..."
else
STREAMID="$2"
fi
echo Oh 💩 here we go!
echo View your stream at http://${TARGETSERVER}:8080/ldashplay/${STREAMID}/manifest.mpd
# Encoding settings for x264 (CPU based encoder)
x264enc='libx264 -tune zerolatency -profile:v high -preset veryfast -bf 0 -refs 3 -sc_threshold 0'
ffmpeg/ffmpeg \
-hide_banner \
-re \
-f lavfi \
-i "testsrc2=size=1920x1080:rate=30" \
-pix_fmt yuv420p \
-map 0:v \
-c:v ${x264enc} \
-g 150 \
-keyint_min 150 \
-b:v 4000k \
-vf "fps=30,drawtext=fontfile=utils/OpenSans-Bold.ttf:box=1:fontcolor=black:boxcolor=white:fontsize=100':x=40:y=400:textfile=utils/text.txt" \
-method PUT \
-seg_duration 5 \
-streaming 1 \
-http_persistent 1 \
-utc_timing_url "https://time.akamai.com/?iso" \
-index_correction 1 \
-use_timeline 0 \
-media_seg_name 'chunk-stream-$RepresentationID$-$Number%05d$.m4s' \
-init_seg_name 'init-stream1-$RepresentationID$.m4s' \
-window_size 5 \
-extra_window_size 10 \
-remove_at_exit 1 \
-adaptation_sets "id=0,streams=v id=1,streams=a" \
-f dash \
http://${TARGETSERVER}:8080/ldash/${STREAMID}/manifest.mpd >/dev/null 2>logs/encode.log &