shell 写的 jrottenberg/ffmpeg 转码

时间:2023-03-09 18:43:02
shell 写的 jrottenberg/ffmpeg 转码
#!/bin/bash
if [ $# -ne ];then
echo "The argument must be 2"
exit;
else
echo "$1 $2"
fi
VIDEOPATH=/data/golang/videode
INPUTPATH=${}
OUTPATH=${}
#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"