%s代表待操作视频的url
查看视频信息
ffprobe -v quiet -select_streams v:0 -print_format json -show_format -show_streams %s
ffmpeg -i video_url -strict -2 -s 1920X1080 -b:v 3000k -r 25 -acodec aac -threads 16 -y video-url-transcode.mp4
转码
ffmpeg -i %s -strict -2 -s width_height -b:v 3000k -r 25 -vcodec h264 -acodec aac -threads 16
获取视频时长
ffprobe -v error -show_entries format=duration %s
添加水印
ffmpeg -i %s -acodec copy -vf 'movie= %s [watermark];[in][watermark]overlay= main_w-overlay_w-30:30' -threads 20 -y
网友评论