|
@@ -222,12 +222,11 @@ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
|
|
|
|
|
|
##### 不常用参数/不常用参数取值,如何通过help获取
|
|
|
|
|
|
-1. `-atag fourcc/tag` force audio tag/fourcc
|
|
|
-2. `-sample_fmt format` set sample format
|
|
|
-3. `-channel_layout layout` set channel layout
|
|
|
-4. `-ch_layout layout` set channel layout
|
|
|
-5. `-guess_layout_max` set the maximum number of channels to try to guess the channel layout
|
|
|
-6. `-apre preset` set the audio options to the indicated preset
|
|
|
+1. `-atag fourcc/tag` 指定音频编码器标签
|
|
|
+2. `-sample_fmt format` 设置音频采样率
|
|
|
+3. `-channel_layout layout` / `-ch_layout layout` 设置音频声道
|
|
|
+4. `-guess_layout_max` 用于在音频转码时指定允许的最大通道布局数
|
|
|
+5. `-apre preset` 同视频
|
|
|
|
|
|
##### 使用中常见的error,原因及解决方法
|
|
|
|
|
@@ -322,8 +321,12 @@ ffplay -af 'atempo=2' lk-mp4.wav
|
|
|
# 正常
|
|
|
ffmpeg -i lk.aac -c:a libmp3lame lk-01.mp3
|
|
|
|
|
|
-# !!! !!! 失败
|
|
|
+# !!! !!! 失败,原因是在视频提取音频时没有定义好输出的 pcm
|
|
|
ffmpeg -f s16le -ar 44100 -ac 2 -i lk-mp4.pcm -c:a libmp3lame lk-mp4.mp3
|
|
|
+
|
|
|
+# 这个是好的
|
|
|
+ffmpeg -i lk_start.mp4 -vn -f s16le -ar 44100 -ac 2 lk_start.pcm
|
|
|
+ffmpeg -f s16le -ar 44100 -ac 2 -i lk_start.pcm -c:a libmp3lame lk_start.mp3
|
|
|
```
|
|
|
|
|
|
抽取pcm数据
|
|
@@ -442,5 +445,13 @@ ffmpeg -pix_fmt yuv420p -s 1920x1080 -i lk_start.yuv lk_start-01.mp4
|
|
|
|
|
|
查看视频关键帧间隔,查看pts,dts
|
|
|
|
|
|
+```Shell
|
|
|
+ffprobe -select_streams v -show_frames -show_entries frame=key_frame,pts,pkt_dts,pict_type -of json -i lk_start.mp4 | grep -B 3 '"pict_type": "I"'
|
|
|
+```
|
|
|
+
|
|
|
查看文件元信息
|
|
|
|
|
|
+```Shell
|
|
|
+ffprobe -of json -show_streams lk_start.mp4
|
|
|
+```
|
|
|
+
|