mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Merge pull request #253 from stasokrosh/master
fix stream index for passing to ffmpeg while making a snapshot
Former-commit-id: 5de32064c1
This commit is contained in:
commit
71356258f8
1 changed files with 3 additions and 1 deletions
|
@ -116,7 +116,9 @@ private static (FFMpegArguments, Action<FFMpegArgumentOptions> outputOptions) Bu
|
||||||
{
|
{
|
||||||
captureTime ??= TimeSpan.FromSeconds(source.Duration.TotalSeconds / 3);
|
captureTime ??= TimeSpan.FromSeconds(source.Duration.TotalSeconds / 3);
|
||||||
size = PrepareSnapshotSize(source, size);
|
size = PrepareSnapshotSize(source, size);
|
||||||
streamIndex = streamIndex == null ? 0 : source.VideoStreams.FirstOrDefault(videoStream => videoStream.Index == streamIndex).Index;
|
streamIndex ??= source.PrimaryVideoStream?.Index
|
||||||
|
?? source.VideoStreams.FirstOrDefault()?.Index
|
||||||
|
?? 0;
|
||||||
|
|
||||||
return (FFMpegArguments
|
return (FFMpegArguments
|
||||||
.FromFileInput(input, false, options => options
|
.FromFileInput(input, false, options => options
|
||||||
|
|
Loading…
Reference in a new issue