FFmpeg::FileFormat - A multimedia file format supported by FFmpeg


FFmpeg documentation Contained in the FFmpeg distribution.

Index


Code Index:

NAME

Top

FFmpeg::FileFormat - A multimedia file format supported by FFmpeg (eg avi, mov, mpeg, mp3, &c)

SYNOPSIS

Top

  $ff = FFmpeg->new(); #see FFmpeg
  $xx = $ff->file_format('mov');
  #...do something with $xx

DESCRIPTION

Top

Objects of this class are not intended to be instantiated directly by the end user. Access FFmpeg::FileFormat objects using file_format() in FFmpeg or filee_formats() in FFmpeg.

Instances of this class represent a file formats supported by FFmpeg-C. If a file format exists, it means that FFmpeg-C can use it to do at least one of:

read files of this type
write files of this type

Call can_read() and can_write() to see what functionality is supported for a given file format.

FEEDBACK

Top

See FEEDBACK in FFmpeg for details.

AUTHOR

Top

Allen Day <allenday@ucla.edu>

COPYRIGHT AND LICENSE

Top

APPENDIX

Top

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a '_'. Methods are in alphabetical order for the most part.

new()

Usage

my $obj = new FFmpeg::FileFormat();

Function

Builds a new FFmpeg::FileFormat object

Returns

an instance of FFmpeg::FileFormat

Arguments

All optional, refer to the documentation of new() in FFmpeg, this constructor operates in the same way.

init()

Usage

$obj->init(%arg);

Function

Internal method to initialize a new FFmpeg::FileFormat object

Returns

true on success

Arguments

Arguments passed to new

can_read()

Usage

$obj->can_read(); #get existing value

Function

FFmpeg-C can use this format for input?

Returns

a boolean

Arguments

none, read-only

can_write()

Usage

$obj->can_write(); #get existing value

Function

FFmpeg-C can use this format for output?

Returns

a boolean

Arguments

none, read-only

description()

Usage

$obj->description(); #get existing value

Function

file format's description (long name)

Returns

value of description (a scalar)

Arguments

none, read-only

mime_type()

Usage

$obj->mime_type(); #get existing value

Function

MIME type associated with this file type (eg video/mpeg)

Returns

value of mime_type (a scalar)

Arguments

none, read-only

extensions()

Usage

$obj->extensions(); #get existing value

Function

File extensions (following last '.') associated with format (eg mpg,mpeg)

Returns

value of extensions (a list)

Arguments

none, read-only

name()

Usage

$obj->name(); #get existing value

Function

file format's name

Returns

value of name (a scalar)

Arguments

none, read-only


FFmpeg documentation Contained in the FFmpeg distribution.

# Let the code begin...


package FFmpeg::FileFormat;
use strict;
use base qw();
our $VERSION = '0.01';

sub new {
  my($class,%arg) = @_;

  my $self = bless {}, $class;
  $self->init(%arg);

  return $self;
}

sub init {
  my($self,%arg) = @_;

  foreach my $arg (keys %arg){
    $self->{$arg} = $arg{$arg};
  }

  return 1;
}

sub can_read {
  my $self = shift;

  return $self->{'can_read'};
}

sub can_write {
  my $self = shift;

  return $self->{'can_write'};
}

sub description {
  my $self = shift;

  return $self->{'description'};
}

sub mime_type {
  my $self = shift;

  return $self->{'mime_type'};
}

sub extensions {
  my $self = shift;
  return $self->{'extensions'} ? @{ $self->{'extensions'} } : ();
}

sub name {
  my $self = shift;

  return $self->{'name'};
}

1;