private void WriteFiltergraph(FFmpegCommand command, Filtergraph filtergraph) { if (filtergraph == null) { throw new ArgumentNullException("filtergraph"); } var shouldIncludeDelimitor = false; filtergraph.FilterchainList.ForEach(filterchain => { if (shouldIncludeDelimitor) { BuilderBase.Append(";"); } else { BuilderBase.Append(" -filter_complex \""); shouldIncludeDelimitor = true; } WriteFilterchain(command, filterchain); }); if (shouldIncludeDelimitor) { BuilderBase.Append("\""); } }
private void WriteFilterchain(FFmpegCommand command, Filterchain filterchain) { if (filterchain == null) { throw new ArgumentNullException("filterchain"); } var context = FilterBindingContext.Create(filterchain.InputCount, filterchain.OutputCount); WriteFilterchainIn(command, filterchain); var shouldIncludeDelimitor = false; filterchain.Filters.ToList().ForEach(filter => { if (shouldIncludeDelimitor) { BuilderBase.Append(","); } else { BuilderBase.Append(" "); shouldIncludeDelimitor = true; } WriteFilter(filter, context); }); WriteFilterchainOut(filterchain); }
private void WriteFilter(IFilter filter, FilterBindingContext context) { if (filter == null) { throw new ArgumentNullException("filter"); } BuilderBase.Append(FilterSerializer.Serialize(filter, context)); }
public void WriteCommand(FFprobeCommand command) { var inputResource = new Input(command.Resource); BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(inputResource)); command.Settings.ForEach(WriteSerializerSpecifier); }
private void WriteFilterchainOut(Filterchain filterchain) { var filterchainOutputs = filterchain.GetStreamIdentifiers(); filterchainOutputs.ForEach(streamId => { BuilderBase.Append(" "); BuilderBase.Append(FormattingUtility.Map(streamId.Map)); }); }
private void WriteOutputSettings(CommandOutput output) { if (output == null) { throw new ArgumentNullException("output"); } output.Settings.SettingsList.ForEach(setting => { BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(setting)); }); }
private void WriteResource(CommandInput resource) { if (resource == null) { throw new ArgumentNullException("resource"); } WriteResourcePreSettings(resource); var inputResource = new Input(resource.Resource); BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(inputResource)); WriteResourcePostSettings(resource); }
private void WriteResourcePostSettings(CommandInput resource) { if (resource == null) { throw new ArgumentNullException("resource"); } resource.Settings.SettingsList.ForEach(setting => { if (!setting.IsPostSetting()) { return; } BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(setting)); }); }
private void WriteFilterchainIn(FFmpegCommand command, Filterchain filterchain) { filterchain.ReceiptList.ForEach(streamId => { BuilderBase.Append(" "); var indexOfResource = command.Objects.Inputs.FindIndex(inputs => inputs.GetStreamIdentifiers().Any(s => s.Map == streamId.Map)); if (indexOfResource >= 0) { var commandResource = command.Objects.Inputs[indexOfResource]; var commandStream = commandResource.Resource.Streams.First(s => s.Map == streamId.Map); BuilderBase.Append(FormattingUtility.Map(commandStream, indexOfResource)); } else { BuilderBase.Append(FormattingUtility.Map(streamId.Map)); } }); }
public void WriteSerializerSpecifier(ISetting setting) { BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(setting)); }