Ubuntu 升级 ffmpeg

今天使用 yt-dlp 下载视频时,遇到一个报错

1
2
3
4
5
[youtube] Extracting URL: https://youtu.be/_dLLIjKz9MY
[youtube] _dLLIjKz9MY: Downloading webpage
...........................................
[Merger] Merging formats into "Fear in Tech - Titus Winters - Keynote Meeting C++ 2024 [_dLLIjKz9MY].mp4"
ERROR: Postprocessing:   Stream #1:0 -> #0:1 (copy)

查找一遍,发现这个是因为 yt-dlpffmpeg 版本冲突导致的,导致yt-dlp --merge-output-format mp4 无法合成 mp4 格式。因此需要升级 ffmpeg

升级 yasm

1
2
3
4
5
6
7
## update yasm
wget https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -xvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make -j
make install

升级 ffmpeg

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
wget https://ffmpeg.org/releases/ffmpeg-7.0.1.tar.xz
tar -xvf ffmpeg-7.0.1.tar.xz
cd ffmpeg-7.0.1

./configure
make install
./ffmpeg --version

whereis ffmpeg
ll /usr/bin/ffmpeg

cp ffmpeg* ffprobe /usr/bin/
ffmpeg --version

成功下载

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
[youtube] Extracting URL: https://www.youtube.com/watch?v=nXcswVW0-Wk
[youtube] nXcswVW0-Wk: Downloading webpage
[youtube] nXcswVW0-Wk: Downloading ios player API JSON
[youtube] nXcswVW0-Wk: Downloading mweb player API JSON
[youtube] nXcswVW0-Wk: Downloading m3u8 information
[info] nXcswVW0-Wk: Downloading 1 format(s): 616+251
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 655
[download] Destination: Herb Sutter - Peering forward  C++’s next decade [nXcswVW0-Wk].f616.mp4
[download] 100% of  441.60MiB in 00:04:40 at 1.57MiB/s
[download] Destination: Herb Sutter - Peering forward  C++’s next decade [nXcswVW0-Wk].f251.webm
[download] 100% of   53.14MiB in 00:00:05 at 10.23MiB/s
[Merger] Merging formats into "Herb Sutter - Peering forward  C++’s next decade [nXcswVW0-Wk].mp4"
Deleting original file Herb Sutter - Peering forward  C++’s next decade [nXcswVW0-Wk].f616.mp4 (pass -k to keep)
Deleting original file Herb Sutter - Peering forward  C++’s next decade [nXcswVW0-Wk].f251.webm (pass -k to keep)
[Metadata] Adding metadata to "Herb Sutter - Peering forward  C++’s next decade [nXcswVW0-Wk].mp4"

[1]  + done       yt-dlp -f 'bv[height<=1080]+ba/b[height<=1080]' --embed-metadata  mp4 --proxy
william 支付宝支付宝
william 微信微信
0%