Class: VideoFile::File

Inherits:
Data
  • Object
show all
Defined in:
ext/video_file_ext/ext.c

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Object

Parameters:

  • filename (String)

    filename of a video file



40
41
42
43
44
45
46
47
48
49
50
# File 'ext/video_file_ext/ext.c', line 40

VALUE file_m_initialize(VALUE self, VALUE filename)
{
    Check_Type(filename, T_STRING);

    VfFile *file;
    TypedData_Get_Struct(self, VfFile, &file_type, file);
    if(!vf_file_init(file, StringValueCStr(filename))) {
        rb_raise(eError, "%s", file->last_error_str);
    }
    return self;
}

Instance Method Details

#darFloat Also known as: aspect_ratio

Returns the video’s aspect ratio.

Returns:

  • (Float)

    the video’s aspect ratio

#durationFloat

Returns the video’s duration (in seconds).

Returns:

  • (Float)

    the video’s duration (in seconds)

#fpsFloat Also known as: frame_frate

Returns the video’s frame rate (FPS, frames per second).

Returns:

  • (Float)

    the video’s frame rate (FPS, frames per second)

#heightNumeric

Returns the video’s height (in pixels).

Returns:

  • (Numeric)

    the video’s height (in pixels)

#parObject

#widthNumeric

Returns the video’s width (in pixels).

Returns:

  • (Numeric)

    the video’s width (in pixels)