我正在使用 ffmpeg 将 RTMP 从我自己的 RTMP 服务器转码为 HLS 就绪的 H.264。目前,我正在执行以下形式的命令
ffmpeg -i rtmp://<ip>:<port> <options for 480p> <options for 720p30> <options for 720p60> <options for 1080p>
这导致我尝试将较低的分辨率转码为较高的分辨率。
我使用的 RTMP 服务器是 nginx with RTMP module
有没有一种方法可以确定源分辨率,以便我只转码为小于源分辨率的分辨率?
最佳答案
感谢@szatmary 的评论,我找到了以下解决方案:
我可以使用命令行工具 ffprobe 来获取有关流的信息。 Here is the documentation
它说 here那
If a url is specified in input, ffprobe will try to open and probe the url content. If the url cannot be opened or recognized as a multimedia file, a positive exit code is returned.
ffprobe 可以配置为使用不同的写入器和写入选项,以便它可以以多种格式返回结果。
关于ffmpeg - 如何使用 ffmpeg 确定传入 RTMP 流的分辨率?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55121629/