public static MetadataInfoTreeContainer GetMetadataInfo(FFmpegCommand command, StreamIdentifier streamId) { //first validate that the streamId does in fact belong to the command. if (!CommandHelperUtility.ReceiptBelongsToCommand(command, streamId)) { throw new ArgumentException("The provided streamId is not part of the provided ffmpeg command.", "streamId"); } var resourceIndex = CommandHelperUtility.IndexOfResource(command, streamId); if (resourceIndex > -1) { return(ResourceMetadataInfo(command, resourceIndex)); } var filterchainIndex = CommandHelperUtility.IndexOfFilterchain(command, streamId); if (filterchainIndex > -1) { return(FilterchainMetadataInfo(command, filterchainIndex)); } var outputIndex = CommandHelperUtility.IndexOfOutput(command, streamId); if (outputIndex > -1) { return(OutputMetadataInfo(command, outputIndex)); } return(null); }
public static List <CommandOutput> To <TOutputType>(this CommandStage stage, string fileName, SettingsCollection settings) where TOutputType : class, IContainer, new() { ValidateTo(stage.Command); var commandOutput = CommandHelperUtility.SetupCommandOutput <TOutputType>(stage.Command, settings, fileName); stage.Command.OutputManager.Add(commandOutput); return(new List <CommandOutput> { commandOutput }); }
private void Fill(FFmpegCommand command, Filterchain filterchain) { filterchain.ReceiptList.ForEach(streamId => { var resourceIndexOf = CommandHelperUtility.IndexOfResource(command, streamId); if (resourceIndexOf > -1) { DependecyTree.Add(MetadataInfoTreeSource.Create(command.Inputs[resourceIndexOf])); } var filterchainIndexOf = CommandHelperUtility.IndexOfFilterchain(command, streamId); if (filterchainIndexOf > -1) { DependecyTree.Add(Create(command, command.Filtergraph[filterchainIndexOf])); } }); }