Avidemux 2.6 Scripting Reference: Editor Class Reference

| Avidemux 2.6 Scripting Reference

- Main Page
- Modules
- Classes
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Enumerations Enumerator Properties Groups Pages
Public Types | Public Member Functions | Properties | List of all members
Editor Class Reference

The Editor object exposes most of the video and audio editing functionality available in Avidemux's graphical user interface to the ECMA scripting engine. More...

## Public Types
enum | ImageType { Bitmap = 1, Jpeg = 2 }
| Specifies a type of image file. More...
enum | SeekFrameType { Any = 0, Intra = 1, Black = 2 }
| Specifies a type of frame to seek. More...

## Public Member Functions
VideoFileProperties | appendVideo (String path)
| Appends an additional video file to the end of the currently open video.
void | clearMarkers ()
| Sets marker A to the start of the video and marker B to the end of the video.
void | closeVideo ()
| Closes the video in the editor.
Boolean | isVideoOpen ()
| Indicates whether a video file is currently open in the editor.
VideoFileProperties | openVideo (String path)
| Opens a video file at the given path in the editor.
void | saveAudio (String path, Number audioIndex=0)
| Saves the specified audio track of the currently open video to a file.
void | saveImage (String path, ImageType imageType)
| Save the current frame as an image file.
void | saveVideo (String path)
| Encodes or copies the video to the specified file.
void | seekNextFrame (Number frameCount=1, SeekFrameType seekFrameType=Editor::Any)
| Seeks forward to the next frame(s) of the specified type.
void | seekPreviousFrame (Number frameCount=1, SeekFrameType seekFrameType=Editor::Any)
| Seeks backward to the next frame(s) of the specified type.
void | setMarkers (Number markerA, Number markerB)
| Sets the time (in milliseconds) of marker A (selection start) and marker B (selection end).

## Properties
Array | activeVideoDecoders
| Gets the video decoders currently being used to decode the video files that are open in the editor.
VideoFilterCollection | appliedVideoFilters
| Gets the filters that will be applied to the encoded video.
AudioOutputCollection | audioOutputs
| Gets the intended audio outputs for the encoded video.
FrameProperties | currentFrameProperties
| Gets extended information about the editor's currently selected frame.
Number | currentFrameTime
| Gets or sets the time (in milliseconds) of the editor's navigation bar.
Muxer | currentMuxer
| Gets or sets the current muxer.
VideoEncoder | currentVideoEncoder
| Gets or sets the current video encoder.
Number | markerA
| Gets or sets the time (in milliseconds) of marker A (selection start).
Number | markerB
| Gets or sets the time (in milliseconds) of marker B (selection end).
Number | position
| Gets or sets the time (in milliseconds) of the editor's position.
SegmentCollection | segments
| Gets extended information about the video segments that have been added to the editor.
Number | videoCount
| Returns the number of video files currently open in the editor.
Array | videoFileProperties
| Gets extended information about the video files that have been added to the editor.

## Detailed Description

The Editor object exposes most of the video and audio editing functionality available in Avidemux's graphical user interface to the ECMA scripting engine.

It can only be accessed using static properties and methods as it doesn't have a constructor. Editor is usually the first object that an individual should become familiar with when starting to write Avidemux ECMA scripts.

Examples:
  TranscodeDirectory.admjs.

## Member Enumeration Documentation

enum ImageType

Specifies a type of image file.

Enumerator:

  Bitmap | Bitmap file (.bmp)
  Jpeg | JPEG file (.jpg)

enum SeekFrameType

Specifies a type of frame to seek.

Enumerator:

  Any | Seek for any type of frame
  Intra | Seek for an intra frame
  Black | Seek for a black frame

## Member Function Documentation

VideoFileProperties appendVideo | ( | String | path | ) |

Appends an additional video file to the end of the currently open video.

Returns
  Returns a VideoFileProperties object that contains extended information about the video file that has been appended to the editor.

See Also
  isVideoOpen, openVideo and VideoFileProperties

void clearMarkers | ( |  | ) |

Sets marker A to the start of the video and marker B to the end of the video.

See Also
  markerA, markerB and setMarkers

void closeVideo | ( |  | ) |

Closes the video in the editor.

See Also
  isVideoOpen and openVideo

Boolean isVideoOpen | ( |  | ) |

Indicates whether a video file is currently open in the editor.

Returns
  Returns true if a video is open in the editor; otherwise, false.

See Also
  openVideo

VideoFileProperties openVideo | ( | String | path | ) |

Opens a video file at the given path in the editor.

Returns
  Returns a VideoFileProperties object that contains extended information about the video file that has been opened in the editor.

See Also
  closeVideo, isVideoOpen and VideoFileProperties

Examples:
  TranscodeDirectory.admjs.

void saveAudio | ( | String | path,
|  | Number | audioIndex = `0`
| ) |  |

Saves the specified audio track of the currently open video to a file.

See Also
  VideoFileProperties.audioProperties

void saveImage | ( | String | path,
|  | ImageType | imageType
| ) |  |

Save the current frame as an image file.

Example usage:

Editor.saveImage("C:\\Test\\Test.bmp", Editor.ImageType.Bitmap);

See Also
  currentFrameTime

void seekNextFrame | ( | Number | frameCount = `1`,
|  | SeekFrameType | seekFrameType = `Editor::Any`
| ) |  |

Seeks forward to the next frame(s) of the specified type.

See Also
  seekPreviousFrame and position

void seekPreviousFrame | ( | Number | frameCount = `1`,
|  | SeekFrameType | seekFrameType = `Editor::Any`
| ) |  |

Seeks backward to the next frame(s) of the specified type.

See Also
  seekNextFrame and position

void setMarkers | ( | Number | markerA,
|  | Number | markerB
| ) |  |

Sets the time (in milliseconds) of marker A (selection start) and marker B (selection end).

See Also
  markerA, markerB and setMarkers

## Property Documentation

Array activeVideoDecoders
| read

Gets the video decoders currently being used to decode the video files that are open in the editor.

Returns
  Returns an array of VideoDecoder objects if a video is open in the editor; otherwise, null.

See Also
  openVideo and appendVideo

VideoFilterCollection appliedVideoFilters
| read

Gets the filters that will be applied to the encoded video.

Returns
  Returns an array of VideoFilter objects if a video is open in the editor; otherwise, null.

Examples:
  TranscodeDirectory.admjs.

FrameProperties currentFrameProperties
| read

Gets extended information about the editor's currently selected frame.

Returns
  Returns a FrameProperties object if a video is open in the editor; otherwise, null.

Muxer currentMuxer
| readwrite

Gets or sets the current muxer.

Example usage:

Editor.currentMuxer = AviMuxer;

Examples:
  TranscodeDirectory.admjs.

VideoEncoder currentVideoEncoder
| readwrite

Gets or sets the current video encoder.

Example usage:

Editor.currentVideoEncoder = Xvid4VideoEncoder;

Examples:
  TranscodeDirectory.admjs.

Number markerA
| readwrite

Gets or sets the time (in milliseconds) of marker A (selection start).

See Also
  markerB, setMarkers and clearMarkers

Number markerB
| readwrite

Gets or sets the time (in milliseconds) of marker B (selection end).

See Also
  markerA, setMarkers and clearMarkers

Number position
| readwrite

Gets or sets the time (in milliseconds) of the editor's position.

See Also
  seekNextFrame and seekPreviousFrame

SegmentCollection segments
| read

Gets extended information about the video segments that have been added to the editor.

Returns
  Returns an array of Segment objects if a video is open in the editor; otherwise, null.

Number videoCount
| read

Returns the number of video files currently open in the editor.

See Also
  openVideo and appendVideo

Array videoFileProperties
| read

Gets extended information about the video files that have been added to the editor.

Returns
  Returns an array of VideoFileProperties objects if a video is open in the editor; otherwise, null.

See Also
  openVideo and appendVideo

Examples:
  TranscodeDirectory.admjs.