Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- PATH="/root/bin:/bin:/usr/bin"
- HLS_PATH="/var/www/html"
- CHN="TSN5H"
- [ ! -d ${HLS_PATH}/${CHN} ] && mkdir -p ${HLS_PATH}/${CHN}
- params()
- {
- maxrate=$1
- resolution=$2
- name=$3
- echo -c:v libnvenc -r 30 -g 60 -keyint_min 90 -b:v $maxrate -s $resolution \
- -metadata service_provider="Provider" -metadata service_name="TSN5" \
- -tune zerolatency -output_ts_offset -2 \
- -threads 0 -strict -2 \
- -c:a aac -ar 48000 -ac 2 -b:a 384k \
- -f ssegment \
- -hls_wrap 3 -hls_list_size 15 \
- -segment_list ${HLS_PATH}/${CHN}/${CHN}_${name}.m3u8 \
- -segment_list_type flat \
- -segment_list_flags live \
- -segment_list_type m3u8 \
- -segment_time 3 \
- -segment_list_size 15 \
- -segment_format mpegts \
- "${HLS_PATH}/${CHN}/${CHN}_${name}_%08d.ts"
- }
- ffmpeg -i "udp://239.255.4.151:5000?ttl=100&fifo_size=1000000&overrun_nonfatal=1" \
- -flags -global_header -map 0:p:1404 -vcodec copy -acodec copy \
- $(params 2000k 640x320 2M) \
- $(params 3000k 4000k 854x480 3M) \
- $(params 5000k 6000k 1280x720 5M)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement