Source

Yamdi /

Filename Size Date modified Message
tests
yamdi
63 B
50 B
0 B
7.5 KB
1.9 KB
0 B
1.2 KB

Yamdi

Yamdi is a Python wrapper around the command line tool yamdi (github.com/ioppermann/yamdi).
You’ll need yamdi installed in order for the package to be of any use.
If you are on OSX I recommend using homebrew (brew install yamdi).

The Yamdi command line tool expects to receive a path to an flv file and will return XML file of the extracted
metadata that we then wrap in a Python object and use to expose the metadata.

Current package version only supports the reading of metadata. The command line tool also supports the writing of
the metadata into a new .flv file but this is not yet supported in this package.

Tested under Python 2.6.1

Requirements

pip install BeautifulSoup
brew install yamdi

Usage

>>> from yamdi import Yamdi
>>> flvmeta = Yamdi(flv_path="/path/to/flv")
>>> flvmeta.duration
10.4
>>> for keyframe in flvmeta.key_frames:
...    keyframe.time # gets time value
...    keyframe.file_position # gets position in file with respect to a time

Supported methods

  • duration - float, in seconds

  • has_keyframe - boolean

  • has_video - boolean

  • has_audio - boolean

  • has_metadata - boolean

  • has_cue_points - boolean

  • can_seek_to_end - boolean

  • audio_codec_id - integer

  • audio_sample_rate - integer

  • audio_data_rate - integer

  • audio_sample_size -integer

  • audio_delay - float, in seconds

  • stereo - boolean

  • video_codec_id - integer

  • frame_rate - float, in seconds

  • video_data_rate - integer

  • height - integer

  • width - integer

  • data_size - integer

  • audio_size - integer

  • video_size - integer

  • file_size - integer

  • last_timestamp - float, in seconds

  • last_video_frame_timestamp - float, in seconds

  • last_key_frame_timestamp - float, in seconds

  • last_key_frame_location - integer

  • key_frames - Array of key frame data, each item contains the following
    • time - float, in seconds
    • file_position - integer

Have fun!