mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-14 02:04:14 +01:00
-map filtering
Add map filtering to choose videostream
Former-commit-id: e60fb71ff8
This commit is contained in:
parent
726e8cd486
commit
f6132e2eba
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 WithDuration(TimeSpan? duration) => WithArgument(new DurationArgument(duration));
|
||||||
public FFMpegArguments WithFastStart() => WithArgument(new FaststartArgument());
|
public FFMpegArguments WithFastStart() => WithArgument(new FaststartArgument());
|
||||||
public FFMpegArguments WithFrameOutputCount(int frames) => WithArgument(new FrameOutputCountArgument(frames));
|
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 UsingShortest(bool shortest = true) => WithArgument(new ShortestArgument(shortest));
|
||||||
public FFMpegArguments UsingMultithreading(bool multithread) => WithArgument(new ThreadsArgument(multithread));
|
public FFMpegArguments UsingMultithreading(bool multithread) => WithArgument(new ThreadsArgument(multithread));
|
||||||
|
|
Loading…
Reference in a new issue