MP4-LibMP4v2

Perl interface to the libmp4v2


License
Artistic-1.0-Perl

Documentation

Build Status

NAME

MP4::LibMP4v2 - Perl interface to the libmp4v2

SYNOPSIS

use MP4::LibMP4v2;
my $mp4 = MP4::LibMP4v2->read('/path/to/movie.mp4');
my $num_tracks = $mp4->get_number_of_tracks;
for (my $i = 0; $i < $num_tracks; $i++) {
    my $track_id = $mp4->find_track_id($i);
    my $bit_rate = $mp4->get_track_bit_rate($track_id);
}

DESCRIPTION

The MP4::LibMP4v2 module provides an interface to the libmp4v2. This module supports libmp4v4 version 2 or above. Please use MP4::File for its version 1.

METHODS

MP4::LibMP4v2->optimize($filename [, $to_filename])

Optimize the mp4 file.

MP4::LibMP4v2->read($filename) :MP4::LibMP4v2

Read the file and return an instance of MP4::LibMP4v2.

MP4::LibMP4v2->set_log_level($level)

Set log level. Defaults to MP4_LOG_NONE.

MP4::LibMP4v2->get_log_level() :Int

Get log level.

$mp4->get_file_name() :Str

$mp4->info() :Str

$mp4->have_atom($atom_name) :Bool

$mp4->get_integer_property($prop_name) :Int

$mp4->get_float_property($prop_name) :Num

$mp4->get_string_property($prop_name) :Str

$mp4->get_bytes_property($prop_name) :ArrayRef[Str]

$mp4->get_duration() :Int

$mp4->get_time_scale() :Int

$mp4->get_od_profile_level() :Int

$mp4->get_scene_profile_level() :Int

$mp4->get_video_profile_level() :Int

$mp4->get_audio_profile_level() :Int

$mp4->get_graphics_profile_level() :Int

$mp4->get_number_of_tracks() :Int

$mp4->find_track_id($index [, $type, $subtype]) :Int

$mp4->find_track_index($track_id) :Int

$mp4->get_track_duration_per_chunk($track_id) :Int

$mp4->have_track_atom($track_id, $atom_name) :Bool

$mp4->get_track_type($track_id) :Str

$mp4->get_track_media_data_name($track_id) :Str

$mp4->get_track_media_original_format($track_id) :Str

$mp4->get_track_duration($track_id) :Int

$mp4->get_track_time_scale($track_id) :Int

$mp4->get_track_language($track_id) :Str

$mp4->get_track_name($track_id) :Str

$mp4->get_track_audio_mpeg4_type($track_id) :Int

$mp4->get_track_esds_object_type_id($track_id) :Int

$mp4->get_track_fixed_sample_duration($track_id) :Int

$mp4->get_track_bit_rate($track_id) :Int

$mp4->get_track_video_metadata($track_id) :ArrayRef[Str]

$mp4->get_track_es_configuration($track_id) :ArrayRef[Str]

$mp4->get_track_h264_length_size($track_id) :Int

$mp4->get_track_number_of_samples($track_id) :Int

$mp4->get_track_video_width($track_id) :Int

$mp4->get_track_video_height($track_id) :Int

$mp4->get_track_video_frame_rate($track_id) :Num

$mp4->get_track_audio_channels($track_id) :Int

$mp4->is_isma_cryp_media_track($track_id) :Bool

$mp4->get_track_integer_property($track_id, $prop_name) :Int

$mp4->get_track_float_property($track_id, $prop_name) :Num

$mp4->get_track_string_property($track_id, $prop_name) :Str

$mp4->get_track_bytes_property($track_id, $prop_name) :ArrayRef[Str]

$mp4->get_hint_track_rtp_payload($track_id) :Str

$mp4->convert_from_movie_duration($duration, $time_scale) :Int

$mp4->convert_from_track_timestamp($track_id, $timestamp, $time_scale) :Int

$mp4->convert_to_track_timestamp($track_id, $timestamp, $time_scale) :Int

$mp4->convert_from_track_duration($track_id, $duration, $time_scale) :Int

$mp4->convert_to_track_duration($track_id, $duration, $time_scale) :Int

CONSTANTS

MP4_LOG_NONE

MP4_LOG_ERROR

MP4_LOG_WARNING

MP4_LOG_INFO

MP4_LOG_VERBOSE1

MP4_LOG_VERBOSE2

MP4_LOG_VERBOSE3

MP4_LOG_VERBOSE4

MP4_OD_TRACK_TYPE

MP4_SCENE_TRACK_TYPE

MP4_AUDIO_TRACK_TYPE

MP4_VIDEO_TRACK_TYPE

MP4_HINT_TRACK_TYPE

MP4_CNTL_TRACK_TYPE

MP4_TEXT_TRACK_TYPE

MP4_SUBTITLE_TRACK_TYPE

MP4_SUBPIC_TRACK_TYPE

MP4_CLOCK_TRACK_TYPE

MP4_MPEG7_TRACK_TYPE

MP4_OCI_TRACK_TYPE

MP4_IPMP_TRACK_TYPE

MP4_MPEGJ_TRACK_TYPE

MP4_SECONDS_TIME_SCALE

MP4_MILLISECONDS_TIME_SCALE

MP4_MICROSECONDS_TIME_SCALE

MP4_NANOSECONDS_TIME_SCALE

MP4_SECS_TIME_SCALE

MP4_MSECS_TIME_SCALE

MP4_USECS_TIME_SCALE

MP4_NSECS_TIME_SCALE

MP4_MPEG4_INVALID_AUDIO_TYPE

MP4_MPEG4_AAC_MAIN_AUDIO_TYPE

MP4_MPEG4_AAC_LC_AUDIO_TYPE

MP4_MPEG4_AAC_SSR_AUDIO_TYPE

MP4_MPEG4_AAC_LTP_AUDIO_TYPE

MP4_MPEG4_AAC_HE_AUDIO_TYPE

MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE

MP4_MPEG4_CELP_AUDIO_TYPE

MP4_MPEG4_HVXC_AUDIO_TYPE

MP4_MPEG4_TTSI_AUDIO_TYPE

MP4_MPEG4_MAIN_SYNTHETIC_AUDIO_TYPE

MP4_MPEG4_WAVETABLE_AUDIO_TYPE

MP4_MPEG4_MIDI_AUDIO_TYPE

MP4_MPEG4_ALGORITHMIC_FX_AUDIO_TYPE

MP4_MPEG4_ALS_AUDIO_TYPE

MP4_MPEG4_LAYER1_AUDIO_TYPE

MP4_MPEG4_LAYER2_AUDIO_TYPE

MP4_MPEG4_LAYER3_AUDIO_TYPE

MP4_MPEG4_SLS_AUDIO_TYPE

SEE ALSO

https://github.com/sergiomb2/libmp4v2, MP4::File

LICENSE

Copyright (C) Jiro Nishiguchi.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Jiro Nishiguchi jiro@cpan.org