Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1.  
  2. #!/bin/sh
  3.  
  4. PATH="/root/bin:/bin:/usr/bin"
  5. HLS_PATH="/var/www/html"
  6. CHN="TSN5H"
  7. [ ! -d ${HLS_PATH}/${CHN} ] && mkdir -p ${HLS_PATH}/${CHN}
  8.  
  9.  
  10. params()
  11. {
  12. maxrate=$1
  13. resolution=$2
  14. name=$3
  15. echo -c:v libnvenc -r 30 -g 60 -keyint_min 90 -b:v $maxrate -s $resolution \
  16. -metadata service_provider="Provider" -metadata service_name="TSN5" \
  17. -tune zerolatency -output_ts_offset -2 \
  18. -threads 0 -strict -2 \
  19. -c:a aac -ar 48000 -ac 2 -b:a 384k \
  20. -f ssegment \
  21. -hls_wrap 3 -hls_list_size 15 \
  22. -segment_list ${HLS_PATH}/${CHN}/${CHN}_${name}.m3u8 \
  23. -segment_list_type flat \
  24. -segment_list_flags live \
  25. -segment_list_type m3u8 \
  26. -segment_time 3 \
  27. -segment_list_size 15 \
  28. -segment_format mpegts \
  29. "${HLS_PATH}/${CHN}/${CHN}_${name}_%08d.ts"
  30. }
  31.  
  32.  
  33. ffmpeg -i "udp://239.255.4.151:5000?ttl=100&fifo_size=1000000&overrun_nonfatal=1" \
  34. -flags -global_header -map 0:p:1404 -vcodec copy -acodec copy \
  35. $(params 2000k 640x320 2M) \
  36. $(params 3000k 4000k 854x480 3M) \
  37. $(params 5000k 6000k 1280x720 5M)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement