Class

MPEG1

MPEG1(filename, audioopt)

Constructor

# new MPEG1(filename, audioopt)

load MPEG1 for video/audio playback. Videos can be converted using ffmpeg, e.g. for converting to MPEG1 with 320 width: "ffmpeg -i infile -filter:v scale=320:-1 -c:v mpeg1video -c:a mp2 -format mpeg outfile"

Note: MPEG1 module must be loaded by calling LoadLibrary("mpeg1") before using!

Parameters:
Name Type Attributes Description
filename string

file name of the soundfile to load.

audio boolean <optional>

enable audioo playback with true, disable with false (default: false).

See:
  • LoadLibrary()

Members

number

# duration

video duration in seconds

string

# filename

name of file

number

# framerate

frame rate.

number

# height

video height

number

# samplerate

audio sample rate.

number

# width

video width

Methods

# Close()

Close MPEG1.

# CurrentTime() → {number}

current play pos

the current video position in seconds

number

# HasEnded()

check if playback has ended.

true if the video has ended, else false.

# Play(x, y)

must be called periodically (e.g. every Loop()) to render audio/video.

Parameters:
Name Type Description
x number

x position of the upper left corner of the video

y number

y position of the upper left corner of the video

# Rewind()

rewind to the start of the video.

# Seek(tidx)

seek to given time index.

Parameters:
Name Type Description
tidx number

the index in seconds