我的 synology DS718+ NAS 上安装了 2 个版本的 ffmpeg。它附带默认的和过时的 2.7.1,但我还安装了 synocommunity ffmpeg 包 (4.2.1),以便使用 tvheadend 的 mpeg-ts spawn 配置文件来改进功能。
现在我有这个命令行:
ffmpeg -i pipe:0 -map a -map v -c:v libx264 -vf "yadif=1:-1:1, scale=720:576" -crf 24 -profile:v main -preset veryfast -c:a mp3 -b:a 96k -ac 2 -async 1 -sn -fflags +genpts -metadata service_provider=STRING -metadata service_name=STRING -f mpegts pipe:1
如果我使用2.7.1它可以工作(如果设置 c:a aac 它不起作用,因为 2.7.1 没有 aac),但如果我使用4.2.1它给了我这个:
spawn: Stream #0:1 -> #0:0 (mp2 (native) -> mp3 (libmp3lame))
spawn: Stream #0:2 -> #0:1 (mp2 (native) -> mp3 (libmp3lame))
spawn: Stream #0:0 -> #0:2 (mpeg2video (native) -> h264 (libx264))
spawn: -async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
spawn: Last message repeated 1 times
spawn: Error initializing output stream 0:2 -- Error while opening encoder for output stream #0:2 - maybe incorrect parameters such as bit_rate, rate, width or height
spawn: Conversion failed!
奇怪的是,如果我选择 c:a aac4.2.1它在音频流处崩溃。
spawn: Stream #0:1 -> #0:0 (mp2 (native) -> aac (native))
spawn: Stream #0:2 -> #0:1 (mp2 (native) -> aac (native))
spawn: Stream #0:0 -> #0:2 (mpeg2video (native) -> h264 (libx264))
spawn: -async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
spawn: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
spawn: Conversion failed!
不知道我做错了什么。请帮忙。