Last active
March 19, 2020 03:36
-
-
Save ytlm/2bd65eb9d8fe48b1623fb224797a22db to your computer and use it in GitHub Desktop.
ffmpeg command record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -ss 00:00:03 -t 60s -i test.flv -c:v libx264 -c:a aac -strict experimental -b:a 98k out.mp4 | |
# 从test.flv视频中的00:00:03时间点开始,截取60s时间的视频,输出为out.mp4视频文件 | |
ffmpeg -i test.flv -strict -2 -vf crop=1920:1000:430:0 out.mp4 | |
# 具体含义是 crop=width:height:x:y,其中 width 和 height 表示裁剪后的尺寸,x:y 表示裁剪区域的左上角坐标。将该点作为基准点,向右下进行裁剪得到输出视频。 | |
ffmpeg -i test.flv -filter_complex transpose=1 -y out.mp4 | |
# transpose=1为顺时针旋转90°,transpose=2逆时针旋转90°。 | |
ffmpeg -i test.flv -vf "split [mian][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [mian][flip]overlay=0:H/2" -y out.mp4 | |
# 上下镜像 | |
ffmpeg -i test.flv -vf "split [main][tmp]; [tmp] crop=iw/2:ih:0:0, hflip [flip]; [main][flip]overlay=W/2:0" -y out.mp4 | |
# 左右镜像 | |
ffmpeg -i test.flv -vol 100 out.mp4 | |
# 调节音量 | |
ffprobe -show_frames test.m4s | |
# -show_frames 显示帧的详细信息,包含pts/dts等等 | |
# -show_streams 显示流详细信息 | |
# -select_streams [v/a] v只过滤视频帧信息,a只过滤音频真信息 | |
循环推流 | |
ffmpeg -re -stream_loop -1 -i test.mp4 -f flv rtmp://127.0.0.1/test/name | |
在视频中打入时间戳 | |
ffmpeg -i 9493457-1-32.flv -vf "drawtext=fontsize=60:fontcolor=red:timecode='00\:00\:00\:00':rate=25:text='TCR\ '" -vcodec h264 -acodec aac -f flv test.flv | |
rate是视频帧率 | |
获取视频文件duration | |
ffprobe -v error -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 input.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment