Skip to content

Commit 7f913d2

Browse files
Merge pull request #82 from hudl/AddLastArgsToProcessor
ICommandProcessor changes, and new filters and defaults
2 parents 5b57d97 + 926bdd1 commit 7f913d2

File tree

12 files changed

+101
-11
lines changed

12 files changed

+101
-11
lines changed

Hudl.FFmpeg.Core/Command/BaseTypes/ICommandProcessor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ public interface ICommandProcessor
2121
/// contains the stdout message from the last command.
2222
/// </summary>
2323
string StdOut { get; }
24-
24+
25+
/// <summary>
26+
/// contains the last ran Arguments through the processor
27+
/// </summary>
28+
string Command { get; }
29+
2530
/// <summary>
2631
/// opens a command builder session, should get the processor started and ready to recieve commands
2732
/// </summary>

Hudl.FFmpeg.Core/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyInformationalVersion("4.0.0")]
36-
[assembly: AssemblyFileVersion("4.0.0")]
37-
[assembly: AssemblyVersion("3.0.0.0")]
35+
[assembly: AssemblyInformationalVersion("5.0.0")]
36+
[assembly: AssemblyFileVersion("5.0.0")]
37+
[assembly: AssemblyVersion("5.0.0.0")]

Hudl.FFmpeg/Command/FFmpegCommandProcessor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public FFmpegCommandProcessor()
2424
public Exception Error { get; protected set; }
2525

2626
public string StdOut { get; protected set; }
27+
public string Command { get; protected set; }
2728

2829
public CommandProcessorStatus Status { get; protected set; }
2930

@@ -94,6 +95,8 @@ public bool Send(string command, int? timeoutMilliseconds)
9495
throw new ArgumentException("Processing command cannot be null or empty.", "command");
9596
}
9697

98+
Command = command;
99+
97100
var retryCount = 0;
98101
var isSuccessful = false;
99102
do

Hudl.FFmpeg/Filters/Overlay.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public Overlay()
2525
{
2626
Format = OverlayVideoFormatType.Yuv420;
2727
Eval = OverlayVideoEvalType.Frame;
28+
RepeatLast = true;
2829
}
2930
public Overlay(int x, int y)
3031
: this()
@@ -42,7 +43,7 @@ public Overlay(int x, int y)
4243
[FilterParameter(Name = "shortest", Default = false, Formatter = typeof(BoolToInt32Formatter))]
4344
public bool Shortest { get; set; }
4445

45-
[FilterParameter(Name = "repeatlast", Default = false, Formatter = typeof(BoolToInt32Formatter))]
46+
[FilterParameter(Name = "repeatlast", Default = true, Formatter = typeof(BoolToInt32Formatter))]
4647
public bool RepeatLast { get; set; }
4748

4849
[FilterParameter(Name ="eval", Default = OverlayVideoEvalType.Frame, Formatter = typeof(EnumParameterFormatter))]

Hudl.FFmpeg/Hudl.Ffmpeg.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
<Compile Include="Settings\ChannelInput.cs" />
124124
<Compile Include="Settings\DurationOutput.cs" />
125125
<Compile Include="Settings\FrameDropThreshold.cs" />
126+
<Compile Include="Settings\MapChapters.cs" />
127+
<Compile Include="Settings\MapMetadata.cs" />
128+
<Compile Include="Settings\LogLevel.cs" />
126129
<Compile Include="Settings\LoopInput.cs" />
127130
<Compile Include="Settings\CopyTimestamps.cs" />
128131
<Compile Include="Settings\QualityScaleAudio.cs" />

Hudl.FFmpeg/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
// by using the '*' as shown below:
3737
// [assembly: AssemblyVersion("1.0.*")]
3838

39-
[assembly: AssemblyInformationalVersion("4.0.0")]
40-
[assembly: AssemblyFileVersion("4.0.0")]
41-
[assembly: AssemblyVersion("3.0.0.0")]
39+
[assembly: AssemblyInformationalVersion("5.0.0")]
40+
[assembly: AssemblyFileVersion("5.0.0")]
41+
[assembly: AssemblyVersion("5.0.0.0")]

Hudl.FFmpeg/Settings/LogLevel.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Hudl.FFmpeg.Attributes;
2+
using Hudl.FFmpeg.Resources.BaseTypes;
3+
using Hudl.FFmpeg.Settings.Attributes;
4+
using Hudl.FFmpeg.Settings.Interfaces;
5+
6+
namespace Hudl.FFmpeg.Settings
7+
{
8+
/// <summary>
9+
/// set the logging level used by the target library.
10+
/// </summary>
11+
[ForStream(Type = typeof(AudioStream))]
12+
[ForStream(Type = typeof(VideoStream))]
13+
[Setting(Name = "loglevel")]
14+
public class LogLevel : ISetting
15+
{
16+
public LogLevel(string level)
17+
{
18+
Level = level;
19+
}
20+
21+
[SettingParameter]
22+
public string Level { get; set; }
23+
}
24+
}

Hudl.FFmpeg/Settings/MapChapters.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Hudl.FFmpeg.Attributes;
2+
using Hudl.FFmpeg.Resources.BaseTypes;
3+
using Hudl.FFmpeg.Settings.Attributes;
4+
using Hudl.FFmpeg.Settings.Interfaces;
5+
6+
namespace Hudl.FFmpeg.Settings
7+
{
8+
/// <summary>
9+
/// copy chapters from input file with index input_file_index to the next output file..
10+
/// </summary>
11+
[ForStream(Type = typeof(AudioStream))]
12+
[ForStream(Type = typeof(VideoStream))]
13+
[Setting(Name = "map_chapters")]
14+
public class MapChapters : ISetting
15+
{
16+
public MapChapters(string mapping)
17+
{
18+
Mapping = mapping;
19+
}
20+
21+
[SettingParameter]
22+
public string Mapping { get; set; }
23+
}
24+
}

Hudl.FFmpeg/Settings/MapMetadata.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Hudl.FFmpeg.Attributes;
2+
using Hudl.FFmpeg.Resources.BaseTypes;
3+
using Hudl.FFmpeg.Settings.Attributes;
4+
using Hudl.FFmpeg.Settings.Interfaces;
5+
6+
namespace Hudl.FFmpeg.Settings
7+
{
8+
/// <summary>
9+
/// set metadata information of the next output file from infile.
10+
/// </summary>
11+
[ForStream(Type = typeof(AudioStream))]
12+
[ForStream(Type = typeof(VideoStream))]
13+
[Setting(Name = "map_metadata")]
14+
public class MapMetadata : ISetting
15+
{
16+
public MapMetadata(string mapping)
17+
{
18+
Mapping = mapping;
19+
}
20+
21+
[SettingParameter]
22+
public string Mapping { get; set; }
23+
}
24+
}

Hudl.FFprobe/Command/FFprobeCommandProcessor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public FFprobeCommandProcessor()
2121
public Exception Error { get; protected set; }
2222

2323
public string StdOut { get; protected set; }
24+
public string Command { get; protected set; }
2425

2526
public CommandProcessorStatus Status { get; protected set; }
2627

@@ -91,6 +92,8 @@ public bool Send(string command, int? timeoutMilliseconds)
9192
throw new ArgumentException("Processing command cannot be null or empty.", "command");
9293
}
9394

95+
Command = command;
96+
9497
try
9598
{
9699
Status = CommandProcessorStatus.Processing;

0 commit comments

Comments
 (0)