mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
-map filtering
Add map filtering to choose videostream
This commit is contained in:
parent
76107fb93e
commit
e60fb71ff8
2 changed files with 19 additions and 1 deletions
17
FFMpegCore/FFMpeg/Arguments/MapStreamArgument.cs
Normal file
17
FFMpegCore/FFMpeg/Arguments/MapStreamArgument.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
namespace FFMpegCore.Arguments
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents choice of video stream, works with one input file
|
||||
/// </summary>
|
||||
public class MapStreamArgument : IArgument
|
||||
{
|
||||
public readonly int VideoStream;
|
||||
|
||||
public MapStreamArgument(int videoStreamNum)
|
||||
{
|
||||
VideoStream = videoStreamNum;
|
||||
}
|
||||
|
||||
public string Text => $"-map 0:{VideoStream}";
|
||||
}
|
||||
}
|
|
@ -59,6 +59,7 @@ private FFMpegArguments(IInputArgument inputArgument)
|
|||
public FFMpegArguments WithDuration(TimeSpan? duration) => WithArgument(new DurationArgument(duration));
|
||||
public FFMpegArguments WithFastStart() => WithArgument(new FaststartArgument());
|
||||
public FFMpegArguments WithFrameOutputCount(int frames) => WithArgument(new FrameOutputCountArgument(frames));
|
||||
public FFMpegArguments WithVideoStream(int videoStreamNumber) => WithArgument(new MapStreamArgument(videoStreamNumber));
|
||||
|
||||
public FFMpegArguments UsingShortest(bool shortest = true) => WithArgument(new ShortestArgument(shortest));
|
||||
public FFMpegArguments UsingMultithreading(bool multithread) => WithArgument(new ThreadsArgument(multithread));
|
||||
|
|
Loading…
Reference in a new issue