C# Класс HandBrake.Interop.HandBrakeInstance

A wrapper for a HandBrake instance.
Наследование: IHandBrakeInstance, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CalculateBitrate ( HandBrake.Interop.Model.EncodeJob job, int sizeMB, double overallSelectedLengthSeconds ) : int

Calculates the video bitrate for the given job and target size.

CalculateFileSize ( HandBrake.Interop.Model.EncodeJob job, int videoBitrate ) : double

Gives estimated file size (in MB) of the given job and video bitrate.

Dispose ( ) : void

Frees any resources associated with this object.

DisposeGlobal ( ) : void

Call before app shutdown. Performs global cleanup.

GetPreview ( HandBrake.Interop.Model.EncodeJob job, int previewNumber ) : BitmapImage

Gets an image for the given job and preview

Only incorporates sizing and aspect ratio into preview image.

GetSize ( HandBrake.Interop.Model.EncodeJob job, int &width, int &height, int &parWidth, int &parHeight ) : void

Gets the final size for a given encode job.

Initialize ( int verbosity ) : void

Initializes this instance.

PauseEncode ( ) : void

Pauses the current encode.

ResumeEncode ( ) : void

Resumes a paused encode.

StartEncode ( HandBrake.Interop.Model.EncodeJob jobToStart ) : void

Starts an encode with the given job.

StartEncode ( HandBrake.Interop.Model.EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds ) : void

Starts an encode with the given job.

StartScan ( string path, int previewCount ) : void

Starts scanning the given path.

StartScan ( string path, int previewCount, int titleIndex ) : void

Starts a scan of the given path.

StopEncode ( ) : void

Stops the current encode.

StopScan ( ) : void

Stops an ongoing scan.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Frees any resources associated with this object.

Приватные методы

Метод Описание
AddFilter ( List filterList, int filterType, string settings, List allocatedMemory ) : void

Adds a filter to the given filter list.

ApplyJob ( hb_job_s &nativeJob, HandBrake.Interop.Model.EncodeJob job ) : List

Applies the encoding job to the native memory structure and returns a list of memory locations allocated during this.

ApplyJob ( hb_job_s &nativeJob, HandBrake.Interop.Model.EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds ) : List

Applies the encoding job to the native memory structure and returns a list of memory locations allocated during this.

CalculateNonAnamorphicOutput ( HandBrake.Interop.Model.Encoding.EncodingProfile profile, HandBrake.Interop.SourceData.Title title ) : HandBrake.Interop.Model.Size

Calculates the output size for a non-anamorphic job.

ConvertAudioBack ( AudioEncoding encoding, hb_audio_s baseStruct, int outputTrack, List allocatedMemory ) : hb_audio_s

Applies an audio encoding to a native audio encoding base structure.

ConvertTitle ( hb_title_s title ) : HandBrake.Interop.SourceData.Title

Converts a native title to a Title object.

GetNearestValue ( int number, int modulus ) : int

Gets the closest value to the given number divisible by the given modulus.

GetOriginalTitle ( int titleIndex ) : hb_title_s

Gets the native title object from the title index.

GetOutputTracks ( HandBrake.Interop.Model.EncodeJob job, HandBrake.Interop.SourceData.Title title ) : int>>.List

Gets a list of encodings and target track indices (1-based).

GetTitle ( int titleIndex ) : HandBrake.Interop.SourceData.Title

Gets the title, given the 1-based index.

PollEncodeProgress ( ) : void

Checks the status of the ongoing encode.

PollScanProgress ( ) : void

Checks the status of the ongoing scan.

Описание методов

CalculateBitrate() публичный Метод

Calculates the video bitrate for the given job and target size.
public CalculateBitrate ( HandBrake.Interop.Model.EncodeJob job, int sizeMB, double overallSelectedLengthSeconds ) : int
job HandBrake.Interop.Model.EncodeJob The encode job.
sizeMB int The target size in MB.
overallSelectedLengthSeconds double The currently selected encode length. Used in preview /// for calculating bitrate when the target size would be wrong.
Результат int

CalculateFileSize() публичный Метод

Gives estimated file size (in MB) of the given job and video bitrate.
public CalculateFileSize ( HandBrake.Interop.Model.EncodeJob job, int videoBitrate ) : double
job HandBrake.Interop.Model.EncodeJob The encode job.
videoBitrate int The video bitrate to be used (kbps).
Результат double

Dispose() публичный Метод

Frees any resources associated with this object.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Frees any resources associated with this object.
protected Dispose ( bool disposing ) : void
disposing bool True if managed objects as well as unmanaged should be disposed.
Результат void

DisposeGlobal() публичный статический Метод

Call before app shutdown. Performs global cleanup.
public static DisposeGlobal ( ) : void
Результат void

GetPreview() публичный Метод

Gets an image for the given job and preview
Only incorporates sizing and aspect ratio into preview image.
public GetPreview ( HandBrake.Interop.Model.EncodeJob job, int previewNumber ) : BitmapImage
job HandBrake.Interop.Model.EncodeJob The encode job to preview.
previewNumber int The index of the preview to get (0-based).
Результат System.Windows.Media.Imaging.BitmapImage

GetSize() публичный Метод

Gets the final size for a given encode job.
public GetSize ( HandBrake.Interop.Model.EncodeJob job, int &width, int &height, int &parWidth, int &parHeight ) : void
job HandBrake.Interop.Model.EncodeJob The encode job to use.
width int The storage width.
height int The storage height.
parWidth int The pixel aspect X number.
parHeight int The pixel aspect Y number.
Результат void

Initialize() публичный Метод

Initializes this instance.
public Initialize ( int verbosity ) : void
verbosity int The code for the logging verbosity to use.
Результат void

PauseEncode() публичный Метод

Pauses the current encode.
public PauseEncode ( ) : void
Результат void

ResumeEncode() публичный Метод

Resumes a paused encode.
public ResumeEncode ( ) : void
Результат void

StartEncode() публичный Метод

Starts an encode with the given job.
public StartEncode ( HandBrake.Interop.Model.EncodeJob jobToStart ) : void
jobToStart HandBrake.Interop.Model.EncodeJob The job to start.
Результат void

StartEncode() публичный Метод

Starts an encode with the given job.
public StartEncode ( HandBrake.Interop.Model.EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds ) : void
job HandBrake.Interop.Model.EncodeJob The job to start.
preview bool True if this is a preview encode.
previewNumber int The preview number to start the encode at (0-based).
previewSeconds int The number of seconds in the preview.
overallSelectedLengthSeconds double The currently selected encode length. Used in preview /// for calculating bitrate when the target size would be wrong.
Результат void

StartScan() публичный Метод

Starts scanning the given path.
public StartScan ( string path, int previewCount ) : void
path string The path to the video to scan.
previewCount int The number of preview images to make.
Результат void

StartScan() публичный Метод

Starts a scan of the given path.
public StartScan ( string path, int previewCount, int titleIndex ) : void
path string The path of the video to scan.
previewCount int The number of previews to make on each title.
titleIndex int The title index to scan (1-based, 0 for all titles).
Результат void

StopEncode() публичный Метод

Stops the current encode.
public StopEncode ( ) : void
Результат void

StopScan() публичный Метод

Stops an ongoing scan.
public StopScan ( ) : void
Результат void