我正在使用fluent-ffmpeg节点包来合并视频.我正在完全遵循文档,但我收到以下错误:Error: ffmpeg exited with code 1: Error configuring complex filters. 这是代码:
ffmpeg('/videos/test/part1.mov')
.input('/videos/test/part2.mov')
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Merging finished !');
})
.mergeToFile('videos/test/final.mp4', 'videos/test/tempDir');
Run Code Online (Sandbox Code Playgroud)
这是错误输出(我将fluent-ffmpeg生成的命令记录到控制台):
C:\Program Files\ffmpeg\bin\ffmpeg.exe [ '-formats' ] { captureStdout: true }
C:\Program Files\ffmpeg\bin\ffmpeg.exe [ '-encoders' ] { captureStdout: true }
C:\Program Files\ffmpeg\bin\ffmpeg.exe [ '-i',
'/videos/test/part1.mov',
'-i','/videos/test/part2.mov',
'-y',
'-filter_complex',
'concat=n=2:v=1:a=1',
'videos/test/final.mp4' ] { niceness: 0 }
An error occurred: Error: ffmpeg exited with code 1: Error configuring …Run Code Online (Sandbox Code Playgroud) 我有一个Web API方法,它接受一个字符串列表,为每个字符串执行Web请求,并将所有数据编译成一个列表以便返回.
输入列表可以是可变长度,可达数千.我是否需要手动限制并发任务的数量,将它们分组到组中,或者创建数千个任务并等待它们是否安全Task.WhenAll()?这是我现在使用的片段:
public async Task<List<Customer>> GetDashboard(List<string> customerIds)
{
HttpClient client = new HttpClient();
var tasks = new List<Task>();
var customers = new List<Customer>();
foreach (var customerId in customerIds)
{
string customerIdCopy = customerId;
tasks.Add(client.GetStringAsync("http://testurl.com/" + customerId)
.ContinueWith(t => {
customers.Add(new Customer { Id = customerIdCopy, Data = t.Result });
}));
}
await Task.WhenAll(tasks);
return customers;
}
Run Code Online (Sandbox Code Playgroud)