本文整理汇总了C#中HandBrake.ApplicationServices.Model.EncodeTask类的典型用法代码示例。如果您正苦于以下问题:C# EncodeTask类的具体用法?C# EncodeTask怎么用?C# EncodeTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EncodeTask类属于HandBrake.ApplicationServices.Model命名空间,在下文中一共展示了EncodeTask类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Export
/// <summary>
/// Export a MacGui style plist preset.
/// </summary>
/// <param name="path">
/// The path.
/// </param>
/// <param name="preset">
/// The preset.
/// </param>
/// <param name="build">
/// The build.PictureModulusPictureModulus
/// </param>
public static void Export(string path, Preset preset, string build)
{
if (string.IsNullOrEmpty(path))
{
return;
}
EncodeTask parsed = new EncodeTask(preset.Task);
using (XmlTextWriter xmlWriter = new XmlTextWriter(path, Encoding.UTF8) { Formatting = Formatting.Indented })
{
// Header
xmlWriter.WriteStartDocument();
xmlWriter.WriteDocType(
"plist", "-//Apple//DTD PLIST 1.0//EN", @"http://www.apple.com/DTDs/PropertyList-1.0.dtd", null);
xmlWriter.WriteStartElement("plist");
xmlWriter.WriteStartElement("array");
// Add New Preset Here. Can write multiple presets here if required in future.
WritePreset(xmlWriter, parsed, preset, build);
// Footer
xmlWriter.WriteEndElement();
xmlWriter.WriteEndElement();
xmlWriter.WriteEndDocument();
// Closeout
xmlWriter.Close();
}
}
开发者ID:JuannyWang,项目名称:HandBrake-QuickSync-Mac,代码行数:43,代码来源:PlistUtility.cs
示例2: GenerateTabbedComponentsQuery
private static string GenerateTabbedComponentsQuery(EncodeTask task, bool filters, int width, int height, int verbose, bool noDvdNav, double x264Step)
{
string query = string.Empty;
// Output Settings
query += OutputSettingsQuery(task);
// Filters Panel
if (filters)
query += FiltersQuery(task);
// Picture Settings
query += PictureSettingsQuery(task, width, height);
// Video Settings
query += VideoSettingsQuery(task, x264Step);
// Audio Settings
query += AudioSettingsQuery(task);
// Subtitles Panel
query += SubtitlesQuery(task);
// Chapter Markers
query += ChapterMarkersQuery(task);
// X264 Panel
query += X264Query(task);
// Extra Settings
query += ExtraSettings(verbose.ToString(), noDvdNav);
return query;
}
开发者ID:vandhanaa,项目名称:Handbrake,代码行数:34,代码来源:QueryGeneratorUtility.cs
示例3: GeneratePreviewQuery
/// <summary>
/// Generate a Query for a Preview Encode
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <param name="configuration">
/// The configuration.
/// </param>
/// <param name="duration">
/// The duration.
/// </param>
/// <param name="startAtPreview">
/// The start At Preview.
/// </param>
/// <returns>
/// A Cli query suitable for generating a preview video.
/// </returns>
public static string GeneratePreviewQuery(EncodeTask task, HBConfiguration configuration, int duration, string startAtPreview)
{
string query = string.Empty;
query += SourceQuery(task, duration, startAtPreview, configuration.PreviewScanCount);
query += DestinationQuery(task);
query += GenerateTabbedComponentsQuery(task, true, configuration.Verbosity, configuration.IsDvdNavDisabled, configuration.DisableQuickSyncDecoding, false, false);
return query;
}
开发者ID:kevleyski,项目名称:HandBrake,代码行数:27,代码来源:QueryGeneratorUtility.cs
示例4: GenerateQuery
/// <summary>
/// Generate a CLI Query for an EncodeTask Model object
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <returns>
/// A Cli Query
/// </returns>
public static string GenerateQuery(EncodeTask task)
{
string query = string.Empty;
query += SourceQuery(task, null, null);
query += DestinationQuery(task);
query += GenerateTabbedComponentsQuery(task, true);
return query;
}
开发者ID:robmcmullen,项目名称:HandBrake,代码行数:18,代码来源:QueryGeneratorUtility.cs
示例5: GeneratePreviewQuery
/// <summary>
/// Generate a Query for a Preview Encode
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <param name="duration">
/// The duration.
/// </param>
/// <param name="startAtPreview">
/// The start At Preview.
/// </param>
/// <returns>
/// A Cli query suitable for generating a preview video.
/// </returns>
public static string GeneratePreviewQuery(EncodeTask task, int duration, string startAtPreview)
{
string query = string.Empty;
query += SourceQuery(task, duration, startAtPreview);
query += DestinationQuery(task);
query += GenerateTabbedComponentsQuery(task, true);
return query;
}
开发者ID:robmcmullen,项目名称:HandBrake,代码行数:24,代码来源:QueryGeneratorUtility.cs
示例6: GeneratePreviewQuery
/// <summary>
/// Generate a Query for a Preview Encode
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <param name="duration">
/// The duration.
/// </param>
/// <param name="startAtPreview">
/// The start At Preview.
/// </param>
/// <param name="previewScanCount">
/// The preview Scan Count.
/// </param>
/// <param name="verbosity">
/// The verbosity.
/// </param>
/// <param name="disableLibDvdNav">
/// The disable Lib Dvd Nav.
/// </param>
/// <param name="disableQsvDecode">
/// The disable Qsv Decode.
/// </param>
/// <returns>
/// A Cli query suitable for generating a preview video.
/// </returns>
public static string GeneratePreviewQuery(EncodeTask task, int duration, string startAtPreview, int previewScanCount, int verbosity, bool disableLibDvdNav, bool disableQsvDecode)
{
string query = string.Empty;
query += SourceQuery(task, duration, startAtPreview, previewScanCount);
query += DestinationQuery(task);
query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav, disableQsvDecode);
return query;
}
开发者ID:RichardMarks,项目名称:HandBrakeMirror,代码行数:36,代码来源:QueryGeneratorUtility.cs
示例7: GenerateQuery
/// <summary>
/// Generate a CLI Query for an EncodeTask Model object
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <param name="previewScanCount">
/// The preview Scan Count.
/// </param>
/// <param name="verbosity">
/// The verbosity.
/// </param>
/// <param name="disableLibDvdNav">
/// The disable Lib Dvd Nav.
/// </param>
/// <returns>
/// A Cli Query
/// </returns>
public static string GenerateQuery(EncodeTask task, int previewScanCount, int verbosity, bool disableLibDvdNav)
{
string query = string.Empty;
query += SourceQuery(task, null, null, previewScanCount);
query += DestinationQuery(task);
query += GenerateTabbedComponentsQuery(task, true, verbosity, disableLibDvdNav);
return query;
}
开发者ID:evolver56k,项目名称:HandBrake,代码行数:27,代码来源:QueryGeneratorUtility.cs
示例8: GenerateQuery
/// <summary>
/// Generate a CLI Query for an EncodeTask Model object
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <param name="configuration">
/// The configuration.
/// </param>
/// <returns>
/// A Cli Query
/// </returns>
public static string GenerateQuery(EncodeTask task, HBConfiguration configuration)
{
if (string.IsNullOrEmpty(task.Source))
{
return "No source selected";
}
string query = string.Empty;
query += SourceQuery(task, null, null, configuration.PreviewScanCount);
query += DestinationQuery(task);
query += GenerateTabbedComponentsQuery(task, true, configuration.Verbosity, configuration.IsDvdNavDisabled, configuration.DisableQuickSyncDecoding, configuration.EnableDxva, configuration.ScalingMode == VideoScaler.BicubicCl);
return query;
}
开发者ID:kevleyski,项目名称:HandBrake,代码行数:26,代码来源:QueryGeneratorUtility.cs
示例9: SourceQuery
private static string SourceQuery(EncodeTask task, int mode, int duration, string preview, string previewTotal)
{
string query = string.Empty;
query += string.Format(" -i \"{0}\"", task.Source);
query += string.Format(" -t {0}", task.Title);
query += string.Format(" --angle {0}", task.Angle);
// Decide what part of the video we want to encode.
switch (task.PointToPointMode)
{
case PointToPointMode.Chapters: // Chapters
if (task.StartPoint == task.EndPoint)
query += string.Format(" -c {0}", task.StartPoint);
else
query += string.Format(" -c {0}-{1}", task.StartPoint, task.EndPoint);
break;
case PointToPointMode.Seconds: // Seconds
int calculatedDuration = task.EndPoint - task.StartPoint;
query += string.Format(" --start-at duration:{0} --stop-at duration:{1}", task.StartPoint, calculatedDuration);
break;
case PointToPointMode.Frames: // Frames
calculatedDuration = task.EndPoint - task.StartPoint;
query += string.Format(" --start-at frame:{0} --stop-at frame:{1}", task.StartPoint, calculatedDuration);
break;
case PointToPointMode.Preview: // Preview
query += " --previews " + previewTotal + " ";
query += " --start-at-preview " + preview;
query += " --stop-at duration:" + duration + " ";
break;
default:
break;
}
return query;
}
开发者ID:vandhanaa,项目名称:Handbrake,代码行数:37,代码来源:QueryGeneratorUtility.cs
示例10: FiltersQuery
/// <summary>
/// Generate the Command Line Arguments for the Filters Tab
/// </summary>
/// <param name="task">
/// The encode task.
/// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
private static string FiltersQuery(EncodeTask task)
{
string query = string.Empty;
switch (task.Detelecine) // DeTelecine
{
case Detelecine.Off:
query += string.Empty;
break;
case Detelecine.Default:
query += " --detelecine";
break;
case Detelecine.Custom:
query += string.Format(" --detelecine=\"{0}\"", task.CustomDetelecine);
break;
default:
query += string.Empty;
break;
}
switch (task.Decomb) // Decomb
{
case Decomb.Off:
query += string.Empty;
break;
case Decomb.Default:
query += " --decomb";
break;
case Decomb.Custom:
query += string.Format(" --decomb=\"{0}\"", task.CustomDecomb);
break;
case Decomb.Fast:
query += " --decomb=\"fast\"";
break;
case Decomb.Bob:
query += " --decomb=\"bob\"";
break;
default:
query += string.Empty;
break;
}
switch (task.Deinterlace) // DeInterlace
{
case Deinterlace.Fast:
query += " --deinterlace=\"fast\"";
break;
case Deinterlace.Slow:
query += " --deinterlace=\"slow\"";
break;
case Deinterlace.Slower:
query += " --deinterlace=\"slower\"";
break;
case Deinterlace.Custom:
query += string.Format(" --deinterlace=\"{0}\"", task.CustomDeinterlace);
break;
case Deinterlace.Bob:
query += " --deinterlace=\"bob\"";
break;
default:
query += string.Empty;
break;
}
switch (task.Denoise) // Denoise
{
case Denoise.Weak:
query += " --denoise=\"weak\"";
break;
case Denoise.Medium:
query += " --denoise=\"medium\"";
break;
case Denoise.Strong:
query += " --denoise=\"strong\"";
break;
case Denoise.Custom:
query += string.Format(" --denoise=\"{0}\"", task.CustomDenoise);
break;
default:
query += string.Empty;
break;
}
if (task.Deblock != 0)
query += string.Format(" --deblock={0}", task.Deblock);
if (task.Grayscale)
query += " -g ";
return query;
//.........这里部分代码省略.........
开发者ID:evolver56k,项目名称:HandBrake,代码行数:101,代码来源:QueryGeneratorUtility.cs
示例11: GenerateTabbedComponentsQuery
/// <summary>
/// Generate a Query from an Encode Task Object.
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <param name="enableFilters">
/// The enableFilters.
/// </param>
/// <param name="verbosity">
/// The verbosity.
/// </param>
/// <param name="disableLibDvdNav">
/// The disable Lib Dvd Nav.
/// </param>
/// <returns>
/// The CLI query for the Tabbed section of the main window UI
/// </returns>
private static string GenerateTabbedComponentsQuery(EncodeTask task, bool enableFilters, int verbosity, bool disableLibDvdNav)
{
string query = string.Empty;
// Output Settings
query += OutputSettingsQuery(task);
// Filters Panel
if (enableFilters)
query += FiltersQuery(task);
// Picture Settings
query += PictureSettingsQuery(task);
// Video Settings
query += VideoSettingsQuery(task);
// Audio Settings
query += AudioSettingsQuery(task);
// Subtitles Panel
query += SubtitlesQuery(task);
// Chapter Markers
query += ChapterMarkersQuery(task);
// Advanced Panel
query += AdvancedQuery(task);
// Extra Settings
query += ExtraSettings(verbosity, disableLibDvdNav);
return query;
}
开发者ID:evolver56k,项目名称:HandBrake,代码行数:52,代码来源:QueryGeneratorUtility.cs
示例12: ChapterMarkersQuery
/// <summary>
/// Generate the Command Line Arguments for the Chapter markers tab
/// </summary>
/// <param name="task">
/// The encode task.
/// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
private static string ChapterMarkersQuery(EncodeTask task)
{
string query = string.Empty;
// Attach Source name and dvd title to the start of the chapters.csv filename.
// This is for the queue. It allows different chapter name files for each title.
string destName = Path.GetFileNameWithoutExtension(task.Destination);
string sourceTitle = task.Title.ToString();
if (task.IncludeChapterMarkers && destName != null)
{
if (destName.Trim() != String.Empty)
{
string path = sourceTitle != "Automatic"
? Path.Combine(Path.GetTempPath(), destName + "-" + sourceTitle + "-chapters.csv")
: Path.Combine(Path.GetTempPath(), destName + "-chapters.csv");
if (ChapterCsvSave(task.ChapterNames, path) == false)
query += " -m ";
else
query += " --markers=" + "\"" + path + "\"";
}
else
query += " -m";
}
return query;
}
开发者ID:evolver56k,项目名称:HandBrake,代码行数:37,代码来源:QueryGeneratorUtility.cs
示例13: DestinationQuery
/// <summary>
/// Generate the Command Line Arguments for the Destination File
/// </summary>
/// <param name="task">
/// The encode task.
/// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
private static string DestinationQuery(EncodeTask task)
{
string query = string.Empty;
if (task.PointToPointMode == PointToPointMode.Preview)
query += string.Format(" -o \"{0}\" ", task.Destination.Replace(".m", "_sample.m"));
else
query += string.Format(" -o \"{0}\" ", task.Destination);
return query;
}
开发者ID:evolver56k,项目名称:HandBrake,代码行数:20,代码来源:QueryGeneratorUtility.cs
示例14: SetSource
/// <summary>
/// Setup this window for a new source
/// </summary>
/// <param name="title">
/// The title.
/// </param>
/// <param name="preset">
/// The preset.
/// </param>
/// <param name="task">
/// The task.
/// </param>
public void SetSource(Title title, Preset preset, EncodeTask task)
{
}
开发者ID:newfront,项目名称:HandBrake,代码行数:15,代码来源:PictureSettingsViewModel.cs
示例15: AudioSettingsQuery
/// <summary>
/// Generate the Command Line Arguments for the Audio Settings Tab
/// </summary>
/// <param name="task">
/// The encode task.
/// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
private static string AudioSettingsQuery(EncodeTask task)
{
string query = string.Empty;
ObservableCollection<AudioTrack> audioTracks = task.AudioTracks;
List<int> tracks = new List<int>();
List<AudioEncoder> codecs = new List<AudioEncoder>();
List<Mixdown> mixdowns = new List<Mixdown>();
List<double> samplerates = new List<double>();
List<int> bitrates = new List<int>();
List<double> drcs = new List<double>();
List<double> gains = new List<double>();
List<string> trackNames = new List<string>();
// No Audio
if (audioTracks.Count == 0)
query += " -a none ";
// Gather information about each audio track and store them in the declared lists.
foreach (AudioTrack track in audioTracks)
{
if (track.Track == null)
{
continue;
}
tracks.Add(track.Track.Value);
// Audio Codec (-E)
codecs.Add(track.Encoder);
// Audio Mixdown (-6)
mixdowns.Add(track.IsPassthru ? Mixdown.None : track.MixDown);
// Sample Rate (-R)
samplerates.Add(track.IsPassthru ? 0 : track.SampleRate);
// Audio Bitrate (-B)
bitrates.Add(track.IsPassthru ? 0 : track.Bitrate);
// DRC (-D)
drcs.Add(track.IsPassthru ? 0 : track.DRC);
// Gain (--gain)
gains.Add(track.IsPassthru ? 0 : track.Gain);
// Audio Track Name (--aname)
trackNames.Add(track.TrackName);
}
// Audio Track (-a)
string audioItems = string.Empty;
bool firstLoop = true;
foreach (int item in tracks)
{
if (firstLoop)
{
audioItems = item.ToString();
firstLoop = false;
}
else
audioItems += "," + item;
}
if (audioItems.Trim() != String.Empty)
query += " -a " + audioItems;
firstLoop = true;
audioItems = string.Empty; // Reset for another pass.
// Audio Codec (-E)
foreach (AudioEncoder item in codecs)
{
if (firstLoop)
{
audioItems = Converters.GetCliAudioEncoder(item);
firstLoop = false;
}
else
audioItems += "," + Converters.GetCliAudioEncoder(item);
}
if (audioItems.Trim() != String.Empty)
query += " -E " + audioItems;
firstLoop = true;
audioItems = string.Empty; // Reset for another pass.
// Audio Mixdown (-6)
foreach (Mixdown item in mixdowns)
{
if (firstLoop)
{
//.........这里部分代码省略.........
开发者ID:evolver56k,项目名称:HandBrake,代码行数:101,代码来源:QueryGeneratorUtility.cs
示例16: SubtitlesQuery
/// <summary>
/// Generate the Command Line Arguments for the Subtitles Tab
/// </summary>
/// <param name="task">
/// The encode task.
/// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
private static string SubtitlesQuery(EncodeTask task)
{
string query = string.Empty;
if (task.SubtitleTracks.Count != 0)
{
// BitMap and CC's
string subtitleTracks = String.Empty;
string subtitleForced = String.Empty;
string subtitleBurn = String.Empty;
string subtitleDefault = String.Empty;
// SRT
string srtFile = String.Empty;
string srtCodeset = String.Empty;
string srtOffset = String.Empty;
string srtLang = String.Empty;
string srtDefault = String.Empty;
int srtCount = 0;
int subCount = 0;
// Languages
IDictionary<string, string> langMap = LanguageUtilities.MapLanguages();
foreach (SubtitleTrack item in task.SubtitleTracks)
{
string itemToAdd;
if (item.IsSrtSubtitle) // We have an SRT file
{
srtCount++; // SRT track id.
srtLang += srtLang == string.Empty ? langMap[item.SrtLang] : "," + langMap[item.SrtLang];
srtCodeset += srtCodeset == string.Empty ? item.SrtCharCode : "," + item.SrtCharCode;
if (item.Default)
srtDefault = srtCount.ToString();
itemToAdd = item.SrtPath;
srtFile += srtFile == string.Empty ? itemToAdd : "," + itemToAdd;
itemToAdd = item.SrtOffset.ToString();
srtOffset += srtOffset == string.Empty ? itemToAdd : "," + itemToAdd;
}
else // We have Bitmap or CC
{
subCount++;
// Find --subtitle <string>
if (item.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch)
itemToAdd = "scan";
else
{
string[] tempSub = item.Track.Split(' ');
itemToAdd = tempSub[0];
}
subtitleTracks += subtitleTracks == string.Empty ? itemToAdd : "," + itemToAdd;
// Find --subtitle-forced
if (item.Forced)
subtitleForced += subtitleForced == string.Empty ? subCount.ToString() : "," + subCount;
// Find --subtitle-burn
if (item.Burned)
subtitleBurn = subCount.ToString();
// Find --subtitle-default
if (item.Default)
subtitleDefault = subCount.ToString();
}
}
// Build The CLI Subtitles Query
if (subtitleTracks != string.Empty)
{
query += " --subtitle " + subtitleTracks;
if (subtitleForced != string.Empty)
query += " --subtitle-forced=" + subtitleForced;
if (subtitleBurn != string.Empty)
query += " --subtitle-burned=" + subtitleBurn;
if (subtitleDefault != string.Empty)
query += " --subtitle-default=" + subtitleDefault;
}
if (srtFile != string.Empty) // SRTs
{
query += " --srt-file " + "\"" + srtFile + "\"";
if (srtCodeset != string.Empty)
query += " --srt-codeset " + srtCodeset;
//.........这里部分代码省略.........
开发者ID:evolver56k,项目名称:HandBrake,代码行数:101,代码来源:QueryGeneratorUtility.cs
示例17: VideoSettingsQuery
private static string VideoSettingsQuery(EncodeTask task, double x264CqStep)
{
string query = string.Empty;
switch (task.VideoEncoder)
{
case VideoEncoder.FFMpeg:
query += " -e ffmpeg";
break;
case VideoEncoder.X264:
query += " -e x264";
break;
case VideoEncoder.Theora:
query += " -e theora";
break;
default:
query += " -e x264";
break;
}
switch (task.VideoEncodeRateType)
{
case VideoEncodeRateType.AverageBitrate:
if (task.VideoBitrate.HasValue)
query += string.Format(" -b {0}", task.VideoBitrate.Value);
break;
case VideoEncodeRateType.ConstantQuality:
double value;
switch (task.VideoEncoder)
{
case VideoEncoder.FFMpeg:
value = 31 - (task.Quality.Value - 1);
query += string.Format(" -q {0}", value.ToString(new CultureInfo("en-US")));
break;
case VideoEncoder.X264:
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
value = 51 - (task.Quality.Value * x264CqStep);
value = Math.Round(value, 2);
query += string.Format(" -q {0}", value.ToString(culture));
break;
case VideoEncoder.Theora:
value = task.Quality.Value;
query += string.Format(" -q {0}", value.ToString(new CultureInfo("en-US")));
break;
}
break;
}
if (task.TwoPass)
query += " -2 ";
if (task.TurboFirstPass)
query += " -T ";
if (task.Framerate.HasValue)
query += string.Format(" -r {0}", task.Framerate);
switch (task.FramerateMode)
{
case FramerateMode.CFR:
query += " --cfr";
break;
case FramerateMode.VFR:
query += " --vfr";
break;
case FramerateMode.PFR:
query += " --pfr";
break;
default:
query += " --vfr";
break;
}
return query;
}
开发者ID:shkolnik,项目名称:HandBrake,代码行数:76,代码来源:QueryGeneratorUtility.cs
示例18: VideoSettingsQuery
/// <summary>
/// Generate the Command Line Arguments for the Video Settings Tab
/// </summary>
/// <param name="task">
/// The encode task.
/// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
private static string VideoSettingsQuery(EncodeTask task)
{
string query = string.Empty;
switch (task.VideoEncoder)
{
case VideoEncoder.FFMpeg:
query += " -e ffmpeg4";
break;
case VideoEncoder.FFMpeg2:
query += " -e ffmpeg2";
break;
case VideoEncoder.X264:
query += " -e x264";
break;
case VideoEncoder.Theora:
query += " -e theora";
break;
default:
query += " -e x264";
break;
}
switch (task.VideoEncodeRateType)
{
case VideoEncodeRateType.AverageBitrate:
if (task.VideoBitrate.HasValue)
query += string.Format(" -b {0}", task.VideoBitrate.Value);
break;
case VideoEncodeRateType.ConstantQuality:
double value;
switch (task.VideoEncoder)
{
case VideoEncoder.FFMpeg:
case VideoEncoder.FFMpeg2:
query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));
break;
case VideoEncoder.X264:
query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));
break;
case VideoEncoder.Theora:
query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));
break;
}
break;
}
if (task.TwoPass)
query += " -2 ";
if (task.TurboFirstPass)
query += " -T ";
if (task.Framerate.HasValue)
query += string.Format(" -r {0}", task.Framerate.Value.ToString(CultureInfo.InvariantCulture));
switch (task.FramerateMode)
{
case FramerateMode.CFR:
query += " --cfr";
break;
case FramerateMode.VFR:
query += " --vfr";
break;
case FramerateMode.PFR:
query += " --pfr";
break;
default:
query += " --vfr";
break;
}
return query;
}
开发者ID:evolver56k,项目名称:HandBrake,代码行数:83,代码来源:QueryGeneratorUtility.cs
示例19: OutputSettingsQuery
/// <summary>
/// Generate the Command Line Arguments for the Output Settings
/// </summary>
/// <param name="task">
/// The encode task.
/// </param>
/// <returns>
/// A Cli Query as a string
/// </returns>
private static string OutputSettingsQuery(EncodeTask task)
{
string query = string.Empty;
query += string.Format(" -f {0} ", EnumHelper<Enum>.GetDescription(task.OutputFormat).ToLower());
// These are output settings features
if (task.LargeFile)
query += " -4 ";
if (task.IPod5GSupport)
query += " -I ";
if (task.OptimizeMP4)
query += " -O ";
return query;
}
开发者ID:evolver56k,项目名称:HandBrake,代码行数:27,代码来源:QueryGeneratorUtility.cs
示例20: UpdateTask
/// <summary>
/// Update all the UI controls based on the encode task passed in.
/// </summary>
/// <param name="task">
/// The task.
/// </param>
public void UpdateTask(EncodeTask task)
{
this.Task = task;
this.NotifyOfPropertyChange(() => this.IsConstantFramerate);
this.NotifyOfPropertyChange(() => this.IsConstantQuantity);
this.NotifyOfPropertyChange(() => this.IsPeakFramerate);
this.NotifyOfPropertyChange(() => this.IsVariableFramerate);
this.NotifyOfPropertyChange(() => this.SelectedVideoEncoder);
this.NotifyOfPropertyChange(() => this.SelectedFramerate);
this.NotifyOfPropertyChange(() => this.RF);
this.NotifyOfPropertyChange(() => this.DisplayRF);
this.NotifyOfPropertyChange(() => this.Task.VideoBitrate);
this.NotifyOfPropertyChange(() => this.Task.TwoPass);
this.NotifyOfPropertyChange(() => this.Task.TurboFirstPass);
this.NotifyOfPropertyChange(() => this.X264Tune);
this.NotifyOfPropertyChange(() => this.X264Preset);
this.NotifyOfPropertyChange(() => this.H264Level);
this.NotifyOfPropertyChange(() => this.H264Profile);
this.NotifyOfPropertyChange(() => this.FastDecode);
this.NotifyOfPropertyChange(() => this.ExtraArguments);
}
开发者ID:betabot7,项目名称:HandBrakeMirror,代码行数:28,代码来源:VideoViewModel.cs
注:本文中的HandBrake.ApplicationServices.Model.EncodeTask类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论