gpt4 book ai didi

video - FFmpeg 可能带有 -pre 标志的错误

转载 作者:行者123 更新时间:2023-12-04 23:11:14 25 4
gpt4 key购买 nike

我正在研究 ffpresets 和 avpresets 但我偶然发现了一些有趣的东西。
根据ffmpeg docs :

First ffmpeg searches for a file named codec_name-arg.avpreset in the above-mentioned directories, where codec_name is the name of the codec to which the preset file options will be applied. For example, if you select the video codec with -vcodec libvpx and use -pre 1080p, then it will search for the file libvpx-1080p.avpreset.


If no such file is found, then ffmpeg will search for a file named arg.avpreset in the same directories.


我有一个预设存储在正确的目录中:
$ 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
这是一个错误还是我误解了文档?
编辑:我最初尝试使用存储库中可用的最新 ffmpeg 版本(4.3.1)。但是,我随后决定确认从 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.

最佳答案

-pre选项接受流说明符,如果没有任何说明符,将应用于所有流。由于 MP4 的默认音频编码器是 aac , ffmpeg 将寻找 aac-1080p.avpreset然后 1080p.avpreset由于这些都不存在,ffmpeg 会出错。
更改-pre-vpre-pre:v .

关于video - FFmpeg 可能带有 -pre 标志的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67845859/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com