我正在尝试在 Win10 上使用 x265 编译 FFMPEG。我正在使用来自 xhmikosr 的最新完整 MinGW 构建:
http://xhmikosr.1f0.de/tools/msys/
Run Code Online (Sandbox Code Playgroud)
没有 x265 的 FFMEPG 编译没有问题,编译 x265 独立工作也没有问题。但是,当我在 ffmpeg 中 --enable-libx265 时出现以下错误:
ERROR: x265 not found using pkg-config
Run Code Online (Sandbox Code Playgroud)
这来自 config.log:
require_pkg_config libx265 x265 x265.h x265_api_get
check_pkg_config libx265 x265 x265.h x265_api_get
test_pkg_config libx265 x265 x265.h x265_api_get
false --exists --print-errors x265
ERROR: x265 not found using pkg-config
Run Code Online (Sandbox Code Playgroud)
我的配置路径似乎都设置正确。
$ echo $PKG_CONFIG_PATH
C:\MYSYS\local\x86_64-w64-mingw32\lib\pkgconfig
Run Code Online (Sandbox Code Playgroud)
当我寻找库 x265 时:
$ pkg-config --list-all
...
x265 x265 - H.265/HEVC video encoder
...
Run Code Online (Sandbox Code Playgroud)
和这里的调试日志:
$ pkg-config --debug
...
File …
Run Code Online (Sandbox Code Playgroud) 我想通过从每个数组中一一选取元素来连接两个数组。并且不要将它们合并或简单地合并
我知道如何将第二个数组添加到第一个数组,如下所示:
$array1 = (0,4,8)
$array2 = (1,5,2)
$array1 += $array2
$array1
Run Code Online (Sandbox Code Playgroud)
结果如下:
0
4
8
1
5
2
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能将它们复制到另一个中,给我这样的输出:
0
1
4
5
8
2
Run Code Online (Sandbox Code Playgroud)
注意:我不想合并它们然后对列表进行排序。
元素需要保持相同的顺序。如何实现这一目标?
我不明白我在这里做错了什么,因为我似乎做了同样的事情,但只有一个有效。
我有一个文本文件,其中包含我想要处理的数字列表(舍入值):
39.145049
40.258140
41.400803
42.540093
43.664530
Run Code Online (Sandbox Code Playgroud)
这是我的脚本:
$a = get-content "input.txt"
$b = $a -join ','
$b | % {$_.ToString("#.###")}
Run Code Online (Sandbox Code Playgroud)
这会导致以下错误:
Cannot find an overload for "ToString" and the argument count: "1".
At D:\script.ps1:9 char:9
+ $b | % {$_.ToString("#.###")}
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Run Code Online (Sandbox Code Playgroud)
但是,如果我加入后得到的结果是:
39.145049,40.258140,41.400803,42.540093,43.664530
Run Code Online (Sandbox Code Playgroud)
并创建以下脚本:
$b = 39.145049,40.258140,41.400803,42.540093,43.664530
$b | % {$_.ToString("#.###")}
Run Code Online (Sandbox Code Playgroud)
它工作得很好并输出:
39.145
40.258
41.401
42.54
43.665
Run Code Online (Sandbox Code Playgroud)
我在这件事上哪里出错了?
偶然我遇到了这个简单的数学方程式,PowerShell出错了.
PS 99.804-99.258
0.546000000000006
PS 10.804-10.258
0.546000000000001
Run Code Online (Sandbox Code Playgroud)
这让我很好奇,我尝试了一些不同的计算器,大多数计算器都正确并返回
0.546
Run Code Online (Sandbox Code Playgroud)
和:
PS 1.804-1.258
0.546
Run Code Online (Sandbox Code Playgroud)
也是对的.但我发现其他计算器也返回了错误的结果:
0.54600000000001
0.545999999999999999
0.5460000000000065
Run Code Online (Sandbox Code Playgroud)
为什么会发生这种情况?如何在PowerShell中获得正确的结果?