【发布时间】:2021-08-23 00:24:49
【问题描述】:
我正在研究 ffpresets 和 avpresets 但我偶然发现了一些有趣的东西。
根据ffmpeg docs:
首先 ffmpeg 在上述目录中搜索名为 codec_name-arg.avpreset 的文件,其中 codec_name 是要应用预设文件选项的编解码器的名称。例如,如果您选择带有 -vcodec libvpx 的视频编解码器并使用 -pre 1080p,那么它将搜索文件 libvpx-1080p.avpreset。
如果没有找到这样的文件,那么 ffmpeg 将在相同的目录中搜索一个名为 arg.avpreset 的文件。
我有一个预设存储在正确的目录中:
$ ls ~/.avconv/
libvpx-1080p.avpreset
因此,以下命令应该可以工作:
$ ffmpeg -i input.mp4 -vcodec libvpx -pre 1080p output.mp4
但反而会导致以下错误:
Preset 1080p specified for stream 0:1, but could not be opened.
但是,以下命令有效:
ffmpeg -i input.mp4 -vcodec libvpx -pre libvpx-1080p output.mp4
这是一个错误还是我误解了文档?
编辑:我最初尝试使用存储库 (4.3.1) 中提供的最新 ffmpeg 版本。但是,我随后决定确认从 source 构建的最新版本仍然是这种情况,结果如下:
~/Downloads/FFmpeg$ ./ffmpeg --version
ffmpeg version N-102649-g3ac7d99428 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10 (Ubuntu 10.2.0-13ubuntu1)
configuration: --disable-x86asm --enable-libvpx
libavutil 57. 0.100 / 57. 0.100
libavcodec 59. 1.100 / 59. 1.100
libavformat 59. 2.101 / 59. 2.101
libavdevice 59. 0.100 / 59. 0.100
libavfilter 8. 0.101 / 8. 0.101
libswscale 6. 0.100 / 6. 0.100
libswresample 4. 0.100 / 4. 0.100
编辑 2:根据要求添加失败命令的整个日志
$ ./ffmpeg -i ../input.mp4 -vcodec libvpx -pre 1080p ../output.mp4
ffmpeg version N-102649-g3ac7d99428 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10 (Ubuntu 10.2.0-13ubuntu1)
configuration: --disable-x86asm --enable-libvpx
libavutil 57. 0.100 / 57. 0.100
libavcodec 59. 1.100 / 59. 1.100
libavformat 59. 2.101 / 59. 2.101
libavdevice 59. 0.100 / 59. 0.100
libavfilter 8. 0.101 / 8. 0.101
libswscale 6. 0.100 / 6. 0.100
libswresample 4. 0.100 / 4. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../input.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41isomavc1
creation_time : 2015-08-07T09:13:36.000000Z
Duration: 00:00:30.53, start: 0.000000, bitrate: 4675 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 4486 kb/s, 30 fps, 30 tbr, 30 tbn (default)
Metadata:
creation_time : 2015-08-07T09:13:36.000000Z
handler_name : L-SMASH Video Handler
vendor_id : [0][0][0][0]
encoder : AVC Coding
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
Metadata:
creation_time : 2015-08-07T09:13:36.000000Z
handler_name : L-SMASH Audio Handler
vendor_id : [0][0][0][0]
Preset 1080p specified for stream 0:1, but could not be opened.
【问题讨论】:
-
共享失败命令的完整日志。
-
@Gyan 编辑 OP
标签: video ffmpeg encoding decoding transcoding