#!/bin/bash if [ $# -ne 2 ];then echo "The argument must be 2" exit; else echo "$1 $2" fi VIDEOPATH=/data/golang/videode INPUTPATH=${1} OUTPATH=${2} #checkout file DECODEFILE=${VIDEOPATH}/${OUTPATH} NEWDIR=${DECODEFILE%/*} if [ ! -d ${NEWDIR} ]; then mkdir -p ${NEWDIR} fi echo $DECODEFILE #if [ ! -f "$DECODEFILE" ]; then # rm -rf $DECODEFILE #fi docker run -i --name ffepmge -v ${VIDEOPATH}:/tmp/workdir jrottenberg/ffmpeg -i ${INPUTPATH} -c:v libx264 -crf 28 -strict -2 ${OUTPATH} docker rm ffepmge curl -connect-timeout 2 -m 5 "http://xxxx/$OUTPATH"