FFMPEG 命令无法正常工作 [关闭]

问题描述 投票:0回答:0

我想用时间戳来剪辑我的视频。我有一个包含我的时间戳的 txt 文件,我将它们放在正确的变量中。例如,$startzeit = 00:00:01 和 $endzeit = 00:00:10。所以,我想要 :01 -> :10 而不是 :01 并运行 10 秒直到 :11.

问题与“-to”有关,因为时间戳是正确的。

这是我的代码

$segment = 0
$pathtxt = "D:\Streamshit\Stream\Videos schneiden\timestamps.txt"
$pathvideo = "D:\Streamshit\Stream\Videos schneiden\2023-05-04_18-59-45.mkv"
$zeile = (Get-Content -LiteralPath $pathtxt).Length
$segment_list = @(Get-Content -LiteralPath $Pathtxt)

while($segment -lt $zeile){

    $timestamp = $segment_list[$segment].split(",")
    $startzeit = $timestamp[0]
    $endzeit = $timestamp[1]
    $TEST = "D:\Streamshit\Stream\Videos schneiden\Clips\video$segment.mp4"
    $segment++    
    ffmpeg -ss $startzeit -i $pathvideo -to $endzeit -c copy $TEST 
}

这是我的时间戳:

00:00:01,00:00:10
00:00:24,00:00:41
00:01:29,00:01:42
00:02:19,00:02:46
00:04:11,00:04:58
00:08:38,00:08:42
00:10:05,00:10:14
00:12:07,00:14:47
00:16:59,00:17:20
00:26:31,00:27:00
00:34:36,00:36:56
00:39:01,00:39:21
00:46:32,00:46:53
00:48:00,00:48:58
00:51:11,00:52:01
00:56:15,00:57:52
00:59:20,01:01:20
01:03:21,01:03:40
01:12:02,01:12:17
01:14:48,01:14:59
01:15:13,01:19:03
01:19:14,01:19:23
01:23:49,01:24:06
01:24:23,01:24:50
01:25:13,01:26:10
01:26:45,01:26:56
01:29:08,01:29:29
01:31:54,01:32:10
01:36:32,01:37:41
01:39:37,01:39:53
01:55:30,01:56:02
02:13:07,02:13:44
03:12:19,03:12:50

我已经用 -t 尝试过它,它通常做我的代码正在做的事情并且 -to 应该做我想做的,但它没有。

powershell ffmpeg timestamp cut
© www.soinside.com 2019 - 2024. All rights reserved.