关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。
这个问题似乎与 help center 中定义的范围内的编程无关。 .
9 个月前关闭。
Improve this question
这个答案可以解决我的很多问题,但依赖 wc -l 来计算 ffprobe 输出的音频 channel 数。
How do I use ffmpeg to merge all audio streams (in a video file) into one audio channel?
我正在使用 Windows 批处理文件,因此我需要另一种在 CMD 中完成以下操作的方法:
-filter_complex "[0:v]scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[video];[0:a]amerge=inputs=$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 input.mov | wc -l),atempo=24000/24024[audio]"
有什么帮助吗?我的编程经验很少。这个问题似乎在问同样的事情,但我似乎无法将它的建议调整到 ffprobe 调用中,最终结果是它只是返回一个数字。What is the windows equivalent of Linux command wc -l?
最佳答案
这是未经测试的,因为我没有安装您的程序。但本质上,您需要做的是使用 FOR /F
捕获 ffprobe 的输出。命令。您将 FFPROBE 的输出通过管道传送到 FIND
命令获取非空行数。
FOR /F "delims=" %%G in ('ffprobe -loglevel error -select_streams a -show_entries stream^=codec_type -of csv^=p^=0 input.mov ^| find /v /c ""') do set "count=%%G"
然后可以使用变量 %count%
使用您的 FFMPEG 命令。
关于windows - 在对 FFPROBE 的调用中相当于 linux wc -l 命令的 CMD?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69457398/