Exemple #1
0
        public IngestOperationViewModel(IIngestOperation operation, IPreview preview, IEngine engine)
            : base(operation)
        {
            _ingestOperation = operation;
            _engine          = engine;
            string destFileName = $"{Path.GetFileNameWithoutExtension(operation.Source.FileName)}.{operation.MovieContainerFormat}";

            _destMediaProperties = new PersistentMediaProxy
            {
                FileName      = operation.DestDirectory.GetUniqueFileName(destFileName),
                MediaName     = FileUtils.GetFileNameWithoutExtension(destFileName, operation.Source.MediaType),
                MediaType     = operation.Source.MediaType == TMediaType.Unknown ? TMediaType.Movie : operation.Source.MediaType,
                Duration      = operation.Source.Duration,
                TcStart       = operation.StartTC,
                MediaGuid     = operation.Source.MediaGuid,
                MediaCategory = operation.Source.MediaCategory
            };

            _audioChannelMappingConversion = operation.AudioChannelMappingConversion;
            _aspectConversion = operation.AspectConversion;
            _audioVolume      = operation.AudioVolume;
            _sourceFieldOrderEnforceConversion = operation.SourceFieldOrderEnforceConversion;
            _loudnessCheck = operation.LoudnessCheck;
            operation.Source.PropertyChanged += OnSourceMediaPropertyChanged;
            AspectConversionsEnforce          = new TAspectConversion[3];
            Array.Copy(AspectConversions, AspectConversionsEnforce, 3);
            if (preview != null)
            {
                PreviewViewmodel = new PreviewViewmodel(engine, preview)
                {
                    SelectedIngestOperation = operation
                }
            }
            ;
        }
Exemple #2
0
 internal IngestOperation(FileManager ownerFileManager) : base(ownerFileManager)
 {
     Kind = TFileOperationKind.Ingest;
     _aspectConversion = TAspectConversion.NoConversion;
     _sourceFieldOrderEnforceConversion = TFieldOrder.Unknown;
     _audioChannelMappingConversion     = TAudioChannelMappingConversion.FirstTwoChannels;
 }
Exemple #3
0
 public IngestOperationViewModel(IIngestOperation operation, IEngine engine)
     : base(operation, engine.MediaManager)
 {
     _operation                         = operation;
     _engine                            = engine;
     _destMediaVideoFormat              = operation.Source.VideoFormat;
     DestMediaName                      = FileUtils.GetFileNameWithoutExtension(operation.Source.MediaName, operation.Source.MediaType);
     _duration                          = operation.Source.Duration;
     _startTc                           = operation.Source.TcStart;
     _destCategory                      = ((IIngestDirectory)operation.Source.Directory).MediaCategory;
     IsMovie                            = operation.Source.MediaType == TMediaType.Unknown || operation.Source.MediaType == TMediaType.Movie;
     IsStill                            = operation.Source.MediaType == TMediaType.Still;
     _audioChannelMappingConversion     = operation.AudioChannelMappingConversion;
     _aspectConversion                  = operation.AspectConversion;
     _audioVolume                       = operation.AudioVolume;
     _sourceFieldOrderEnforceConversion = operation.SourceFieldOrderEnforceConversion;
     _loudnessCheck                     = operation.LoudnessCheck;
     operation.Source.PropertyChanged  += OnSourceMediaPropertyChanged;
     AspectConversionsEnforce           = new TAspectConversion[3];
     Array.Copy(AspectConversions, AspectConversionsEnforce, 3);
     if (engine.Preview != null)
     {
         _preview = new PreviewViewmodel(engine.Preview, true, false)
         {
             SelectedIngestOperation = operation
         }
     }
     ;
     CommandRemove = new UiCommand(o => Removed?.Invoke(this, EventArgs.Empty));
 }
        private MediaConversion(TAudioChannelMappingConversion type)
        {
            Conversion = type;
            switch (type)
            {
                case TAudioChannelMappingConversion.Default:
                    FFMpegParameter = "ac 2";
                    OutputFormat = TAudioChannelMapping.Unknown;
                    break;
                case TAudioChannelMappingConversion.FirstTwoChannels:
                    OutputFormat = TAudioChannelMapping.Stereo;
                    FFMpegParameter = "ac 2";
                    FFMpegAudioFilter = "pan=stereo|c0=c0|c1=c1";
                    break;
                case TAudioChannelMappingConversion.SecondTwoChannels:
                    OutputFormat = TAudioChannelMapping.Stereo;
                    FFMpegParameter = "ac 2";
                    FFMpegAudioFilter = "pan=stereo|c0=c2|c1=c3";
                    break;
                case TAudioChannelMappingConversion.FirstChannelOnly:

                    // Temporary fix due to Caspar's audio distortion in right channlel playing mono file

                    //OutputFormat = TAudioChannelMapping.Mono;
                    //FFMpegParameter = "ac 1";
                    //FFMpegAudioFilter = "pan=mono|c0=c0";
                    OutputFormat = TAudioChannelMapping.Stereo;
                    FFMpegParameter = "ac 2";
                    FFMpegAudioFilter = "pan=stereo|c0=c0|c1=c0";
                    break;
                case TAudioChannelMappingConversion.SecondChannelOnly:
                    //OutputFormat = TAudioChannelMapping.Mono;
                    //FFMpegParameter = "ac 1";
                    //FFMpegAudioFilter = "pan=mono|c0=c1";
                    OutputFormat = TAudioChannelMapping.Stereo;
                    FFMpegParameter = "ac 2";
                    FFMpegAudioFilter = "pan=stereo|c0=c1|c1=c1";
                    break;
                case TAudioChannelMappingConversion.Combine1plus2:
                    //OutputFormat = TAudioChannelMapping.Mono;
                    //FFMpegParameter = "ac 1";
                    //FFMpegAudioFilter = "pan=mono|c0=0.5*c0+0.5*c1";
                    OutputFormat = TAudioChannelMapping.Stereo;
                    FFMpegParameter = "ac 2";
                    FFMpegAudioFilter = "pan=stereo|c0=0.5*c0+0.5*c1|c1=0.5*c0+0.5*c1";
                    break;
                case TAudioChannelMappingConversion.Combine3plus4:
                    //OutputFormat = TAudioChannelMapping.Mono;
                    //FFMpegParameter = "ac 1";
                    //FFMpegAudioFilter = "pan=mono|c0=0.5*c2+0.5*c3";
                    OutputFormat = TAudioChannelMapping.Stereo;
                    FFMpegParameter = "ac 2";
                    FFMpegAudioFilter = "pan=stereo|c0=0.5*c2+0.5*c3|c1=0.5*c2+0.5*c3";
                    break;
            }
        }
        private MediaConversion(TAudioChannelMappingConversion type)
        {
            Conversion = type;
            switch (type)
            {
            case TAudioChannelMappingConversion.Default:
                OutputFormat = TAudioChannelMapping.Unknown;
                break;

            case TAudioChannelMappingConversion.FirstTwoChannels:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=c0|c1=c1";
                break;

            case TAudioChannelMappingConversion.SecondTwoChannels:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=c2|c1=c3";
                break;

            case TAudioChannelMappingConversion.ThirdTwoChannels:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=c4|c1=c5";
                break;

            case TAudioChannelMappingConversion.FourthTwoChannels:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=c6|c1=c7";
                break;

            case TAudioChannelMappingConversion.FirstChannelOnly:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=c0|c1=c0";
                break;

            case TAudioChannelMappingConversion.SecondChannelOnly:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=c1|c1=c1";
                break;

            case TAudioChannelMappingConversion.Combine1Plus2:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=0.5*c0+0.5*c1|c1=0.5*c0+0.5*c1";
                break;

            case TAudioChannelMappingConversion.Combine3Plus4:
                OutputFormat = TAudioChannelMapping.Stereo;
                FFMpegFilter = "pan=stereo|c0=0.5*c2+0.5*c3|c1=0.5*c2+0.5*c3";
                break;

            case TAudioChannelMappingConversion.MergeAllChannels:
                OutputFormat = TAudioChannelMapping.Unknown;
                break;
            }
        }
 internal IngestOperation()
 {
     _aspectConversion = TAspectConversion.NoConversion;
     _sourceFieldOrderEnforceConversion = TFieldOrder.Unknown;
     _audioChannelMappingConversion     = TAudioChannelMappingConversion.FirstTwoChannels;
 }