Example #1
0
        /// <summary>
        /// The create destination.
        /// </summary>
        /// <param name="job">
        /// The job.
        /// </param>
        /// <returns>
        /// The <see cref="Destination"/>.
        /// </returns>
        private static Destination CreateDestination(EncodeTask job)
        {
            Destination destination = new Destination
            {
                File       = job.Destination,
                Mp4Options = new Mp4Options
                {
                    IpodAtom    = job.IPod5GSupport,
                    Mp4Optimize = job.OptimizeMP4
                },
                ChapterMarkers = job.IncludeChapterMarkers,
                Mux            = HBFunctions.hb_container_get_from_name(job.OutputFormat == OutputFormat.Mp4 ? "av_mp4" : "av_mkv"), // TODO tidy up.
                ChapterList    = new List <Chapter>()
            };

            if (job.IncludeChapterMarkers)
            {
                foreach (ChapterMarker item in job.ChapterNames)
                {
                    Chapter chapter = new Chapter {
                        Name = item.ChapterName
                    };
                    destination.ChapterList.Add(chapter);
                }
            }

            return(destination);
        }
Example #2
0
        /// <summary>
        /// The create destination.
        /// </summary>
        /// <param name="job">
        /// The job.
        /// </param>
        /// <returns>
        /// The <see cref="Destination"/>.
        /// </returns>
        private static Destination CreateDestination(EncodeJob job)
        {
            Destination destination = new Destination
            {
                File       = job.OutputPath,
                Mp4Options = new Mp4Options
                {
                    IpodAtom    = job.IPod5GSupport,
                    Mp4Optimize = job.Optimize
                },
                ChapterMarkers = job.IncludeChapterMarkers,
                Mux            = HBFunctions.hb_container_get_from_name(job.ContainerName),
                ChapterList    = new List <ChapterList>()
            };

            if (job.UseDefaultChapterNames)
            {
                foreach (string item in job.CustomChapterNames)
                {
                    ChapterList chapter = new ChapterList {
                        Name = item
                    };
                    destination.ChapterList.Add(chapter);
                }
            }

            return(destination);
        }