• 推流脚本


    #!/bin/bash

    serverName="localhost:1935"
    basePath="/home/rocdean/nginx"
    filePath="/tmp"
    HLSPath="/hls"

    while getopts :f opt
    do
    case $opt in
    f) force=true;;
    *) echo $opt not a option;;
    esac
    done
    shift $[$OPTIND-1]

    if [ $force ];then
    rm -r $filePath$HLSPath$1
    fi

    if [ ! -d "$filePath$HLSPath$1" ] && [ ! -f "$filePath$HLSPath$1/index.m3u8" ];then
    ffmpeg -re -i $basePath$1.mp4 -vcodec copy -vprofile baseline -acodec copy -f flv rtmp://$serverName$HLSPath$1
    echo "#EXT-X-ENDLIST" >> $filePath$HLSPath$1/index.m3u8

    else
    echo "$filePath$HLSPath$1 OR $filePath$HLSPath$1/index.m3u8 is already exist."
    fi

    echo "finished~"

  • 相关阅读:
    构造函数
    时延(delay,latency)
    吞吐量
    带宽(band-width)
    单位
    bps
    比特(bit)
    速率
    C语言中的“>>”和“<<”
    C#中unit
  • 原文地址:https://www.cnblogs.com/jiangjing/p/7978705.html
Copyright © 2020-2023  润新知