Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Generate meta data, add/remove cue points, inspect FLV files, or join them with flvedit.
Ruby
tree: 33dcde006e
Failed to load latest commit information.
bin
lib Fixed error reporting
test Fix timestamp issue when joining more than 2 files (thanks to Dominik…
.document Initial commit to flvedit.
.gitignore
CHANGELOG.rdoc
LICENSE Initial release
README.rdoc Fix for windows version (Thanks to Dominik Felber)
Rakefile Fixed error reporting
VERSION.yml Version bump to 0.7.3
flvedit.gemspec Regenerated gemspec for version 0.7.3

README.rdoc

FLVEdit - Flash video manipulation

FLVEdit is a tool that will read or edit FLV files to:

  • generate meta data

  • add/remove cue points

  • join files

  • inspect files

It is meant as an improved FLVTool2, fixing the shortfalls that prompted others to write FLVTool++ & FLVMeta (see comparison chart)

FLVEdit can be used either as a command-line command or as a ruby library.

Note: The basic functionality is there, but I'll be improving features and documentation. Until version 1.0, there will most likely be many changes to the command line interface and the library API.

Comments & requests welcome…

Installation

flvedit is a gem mirrored on Rubyforge and can thus be installed with:

sudo gem install flvedit

flvedit is compatible with Ruby 1.8 and 1.9

Command-line tool

Type 'flvedit' for description of commands.

Library

FLVEdit is written in ruby and divided in two layers.

FLV file format

The FLV layer handles the FLV file format. It makes reading and writing FLV files a breeze:

FLV::File.open(“example.flv”) {|f| f.to_a } # ==> [<#FLV::Header…>, <#FLV::Tag…>, …]

The main class is FLV::Tag with its different possible bodies: FLV::Audio, FLV::Video and most importantly FLV::Event for all meta data related information (onMetaData, onCuePoint, …)

The data packing and unpacking relies on the packable library.

FLV::Edit tool

The FLV::Edit layer is the command-line tool itself. The FLV::Edit::Runner class parses the options and builds a chain of processors to apply to some flv files. Processors all derive from FLV::Edit::Processor::Base and only need to specify what to do for the type of data it wants to process. A simplistic example to use this level:

class CountCuePoints < FLV::Edit::Processor::Base attr_writer :count def on_cue_point(cue) @count ||= 0 @count += 1 end end

# Call manually count = FLV::File.open(“example.flv”) do |f| CountCuePoints.new(f).process_all.count end

# Chain with other commands: count = FLV::Edit::Runner.new([CountCuePoints, FLV::Edit::Processor::Debug], :files => “example.swf”).run.count

See FLV::Edit::Processor::Base for details on how the processing works

Comparisons with existing tools

FLVTool2

Features:

  • Can join (concat) flv files

  • Won't load the whole files in memory all at once

  • Won't choke on read-only files

  • Supports extented timestamps (for flv over… 4 hours!)

Code:

  • Complete rewrite

  • More ruby-oriented

  • Commented

  • Unit tests

  • Easier to use library

  • Easily expandable with your own processing

Compared to FLVTool++

  • Handles cue points

  • Usable as a library

<to be completed>

Compared to FLVMeta

<to be completed>

Something went wrong with that request. Please try again.