private static void RemuxToMpeg4Container(JobConfiguration jobConfiguration)
        {
            CommandFactory factory = CommandFactory.Create();
            FFmpegCommand  command = factory.CreateOutputCommand();

            CommandStage chain = command.WithInput <VideoStream>(jobConfiguration.InputFile);

            SettingsCollection outputSettings = SettingsCollection.ForOutput(new CodecVideo(VideoCodecType.Copy),
                                                                             new CodecAudio(AudioCodecType.Copy));

            chain.To <Mp4>(jobConfiguration.OutputFile, outputSettings);

            Console.WriteLine($"Remuxing {jobConfiguration.InputFile}");
            try {
                factory.Render();
//                Console.WriteLine($"Remuxed  {jobConfiguration.OutputFile}");
                if (jobConfiguration.RemoveInputFileAfterRemux && File.Exists(jobConfiguration.OutputFile))
                {
                    File.Delete(jobConfiguration.InputFile);
                }
            } catch (FFmpegRenderingException e) {
                Console.WriteLine($"Remuxing failed for file {jobConfiguration.InputFile}: {e.Message}");
            }
        }
 public static List <CommandOutput> To <TOutputType>(this CommandStage stage, SettingsCollection settings)
     where TOutputType : class, IContainer, new()
 {
     return(stage.To <TOutputType>(string.Empty, settings));
 }
 public static List <CommandOutput> To <TOutputType>(this CommandStage stage)
     where TOutputType : class, IContainer, new()
 {
     return(stage.To <TOutputType>(SettingsCollection.ForOutput()));
 }