Appearance
FFmpeg
下载m3u8
shell
ffmpeg.exe -i {input} -c copy {output}vob to mp4
shell
@echo off
for %%i in ("*.vob") do ffmpeg -i "%%i" -c:v libx264 -vf yadif -crf 18 "%%i".mp4提取指定開始時間和截至時間
shell
ffmpeg -ss {0.00ms} -to {0.00ms} -i "{input_filepath}" "{output_filepath}"shell
ffmpeg -i "{input_filepath}" -acodec libmp3lame -ar 22050 "{output_filepath}"获取m4b章节
shell
ffprobe -i "{input_filepath}" -print_format json -show_chapters生成指定格式的靜音音頻
shell
ffmpeg -f lavfi -t 10 -i anullsrc {filename}.wav -y
ffmpeg -f lavfi -t 10 -i anullsrc=r=44100:cl=mono {filename}.wav -y生成静音.aac
shell
ffmpeg.exe -f lavfi -i anullsrc=r=48000:cl=stereo -t 1 {filename}.aac生成静音.mp3
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -t 1 {filename}.mp3获取总时长和比特率
shell
ffprobe -v error -show_entries format=duration,bit_rate -of default=noprint_wrappers=1:nokey=1 {filename}输出示例: 120.5 (秒) 和 1500000 (bps)
计算大小: (时长秒数 * 比特率) / 8 / 1024 / 1024 (MB)
获取视频总时长(秒)
shell
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {filename}获取比特率
shell
ffprobe -v error -show_entries format=duration,bit_rate -of default=noprint_wrappers=1:nokey=1 {filename}获取采样率
shell
ffprobe -v error -select_streams a:0 -show_entries stream=bit_rate -of default=nw=1:nk=1 {filename}| Option | Value | Description |
|---|---|---|
| -v | error | 隐藏不必要的输出信息 |
| -select_streams | a:0 | 选择第一个音频流 |
| -of | default=nw=1:nk=1 | 格式化输出,只显示值,不显示标签 |