Coder Social home page Coder Social logo

ruby-mp4info's Introduction

My Changes

This gem isn’t originally mine, but i’ve added things etc…

Bundler

The gem can now be used with bundler and by extension, Rails 3, just use…

gem “mp4info”, :git => “git://github.com/arbarlow/ruby-mp4info.git”, :require => “mp4info”

Introduction

MP4Info supports the reading of tags and file info from MP4 audio files. It is based on the Perl module MP4::Info (search.cpan.org/~jhar/MP4-Info/) Note: MP4Info does not currently support Unicode strings.

License

This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Usage

With mp4info.rb in your load path, do:

require 'mp4info'

Once the library is loaded, an MP4Info object is created by sending an IO object to MP4Info#new. MP4Info also provides the MP4Info#open method, which takes String containing a filename.

file = "my_favorite_song.mp4"
info = MP4Info.open(file)

io_stream = File.new("that_other_song.m4a")
other_info = MP4Info.new(io_stream)

Once an MP4Info object is succesfully created, a number of tags are avalible:

* ALB   - Album
* APID  - Apple Store ID
* ART   - Artist
* CMT   - Comment
* COVR  - Album art (typically jpeg data)
* CPIL  - Compilation (boolean)
* CPRT  - Copyright statement
* DAY   - Year
* DISK  - Disk number & total (Array of two integers)
* GNRE  - Genre
* GRP   - Grouping
* NAM   - Title
* RTNG  - Rating (integer)
* TMPO  - Tempo (integer)
* TOO   - Encoder
* TRKN  - Track number & total (Array of two integers)
* WRT   - Author or composer

The following extra information about the audio file is also provided:

* VERSION   - MPEG version (=4)
* LAYER     - Doesn't really mean antyhing, but here in case we need it
              for compatibility with an MP3 library...
* BITRATE   - Bitrate in kbps (average for VBR files)
              The formula used to generate this seems a little suspect.
* FREQUENCY - Frequency in kHz
* SIZE      - Bytes in audio stream

* SECS  - Total seconds, rounded to nearest second
* MM    - Minutes
* SS    - Leftover seconds
* MS    - Leftover milliseconds, rounded to nearest millisecond
* TIME  - Time in MM:SS, rounded to nearest second

* COPYRIGHT	- Non-nil if audio is copyrighted
* ENCRYPTED	- Non-nil if audio data is encrypted

ruby-mp4info's People

Contributors

andytinycat avatar arbarlow avatar jsouthern avatar wader avatar yenthefirst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ruby-mp4info's Issues

License

Hello,

I would like to know if i can use this Gem in a commercial app without releasing my app source ?

I see its licensed under GPL. Not sure if up to date.

Thanks

Bump Version and Publish

This looks like the official repository now, but rubygems is still serving 1.7.3 which was last updated in 2010 and does not contain the latest commits.

Can you bump the version and publish a new gem to rubygems?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.