Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Never use .apply and instead give FfmpegCommand as parameter
- Loading branch information
Spruce (Felix Fichte)
committed
Jun 30, 2013
1 parent
c933414
commit 4a97fff
Showing
8 changed files
with
96 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
var Metalib = require('../index').Metadata; | ||
|
||
// make sure you set the correct path to your video file | ||
var metaObject = new Metalib('/path/to/your_movie.avi'); | ||
metaObject.get(function(metadata, err) { | ||
Metalib('/path/to/your_movie.avi',function(metadata, err) { | ||
console.log(require('util').inspect(metadata, false, null)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,51 @@ | ||
var extlib = process.env.FLUENTFFMPEG_COV ? require('../lib-cov/extensions') : require('../lib/extensions'), | ||
var Ffmpeg = require('../index'), | ||
path = require('path'), | ||
assert = require('assert'); | ||
|
||
// kinda nasty... | ||
var ext = new extlib(); | ||
|
||
describe('Extensions.toAspectRatio', function() { | ||
it('should convert an aspect ratio string to a proper object', function() { | ||
var ret = ext.toAspectRatio('16:9'); | ||
ret.x.should.equal(16); | ||
ret.y.should.equal(9); | ||
}); | ||
it('should return undefined when an invalid aspect ratio is passed', function() { | ||
assert.ok(!ext.toAspectRatio('15.929')); | ||
}); | ||
}); | ||
|
||
describe('Extensions.parseVersionString', function() { | ||
it('should parse the major/minor/patch version correctly', function() { | ||
var ret = ext.parseVersionString('4.5.123'); | ||
ret.should.have.property('major').with.valueOf(4); | ||
ret.should.have.property('minor').with.valueOf(5); | ||
ret.should.have.property('patch').with.valueOf(123); | ||
}); | ||
}); | ||
|
||
describe('Extensions.atLeastVersion', function() { | ||
it('should correctly compare a full version number', function() { | ||
ext.atLeastVersion('2.3.4532', '2.3.4531').should.be.true; | ||
}); | ||
it('should correctly compare a version number without patch version', function() { | ||
ext.atLeastVersion('2.3', '2.2.32').should.be.true; | ||
}); | ||
it('should correctly compare a major version number', function() { | ||
ext.atLeastVersion('3', '2.9.912').should.be.true; | ||
}); | ||
it('should correctly compare an exact version match', function() { | ||
ext.atLeastVersion('1.2.34', '1.2.34').should.be.true; | ||
}); | ||
}); | ||
|
||
describe('Extensions.ffmpegTimemarkToSeconds', function() { | ||
it('should correctly convert a simple timestamp', function() { | ||
ext.ffmpegTimemarkToSeconds('00:02:00.00').should.be.equal(120); | ||
}); | ||
it('should correctly convert a complex timestamp', function() { | ||
ext.ffmpegTimemarkToSeconds('00:08:09.10').should.be.equal(489); | ||
var ext = new Ffmpeg(path.join(__dirname, 'assets', 'testvideo-43.avi')); | ||
describe('Extensions', function() { | ||
describe('toAspectRatio', function() { | ||
it('should convert an aspect ratio string to a proper object', function() { | ||
var ret = ext.toAspectRatio('16:9'); | ||
ret.x.should.equal(16); | ||
ret.y.should.equal(9); | ||
}); | ||
it('should return undefined when an invalid aspect ratio is passed', function() { | ||
assert.ok(!ext.toAspectRatio('15.929')); | ||
}); | ||
}); | ||
|
||
describe('parseVersionString', function() { | ||
it('should parse the major/minor/patch version correctly', function() { | ||
var ret = ext.parseVersionString('4.5.123'); | ||
ret.should.have.property('major').with.valueOf(4); | ||
ret.should.have.property('minor').with.valueOf(5); | ||
ret.should.have.property('patch').with.valueOf(123); | ||
}); | ||
}); | ||
|
||
describe('atLeastVersion', function() { | ||
it('should correctly compare a full version number', function() { | ||
ext.atLeastVersion('2.3.4532', '2.3.4531').should.be.true; | ||
}); | ||
it('should correctly compare a version number without patch version', function() { | ||
ext.atLeastVersion('2.3', '2.2.32').should.be.true; | ||
}); | ||
it('should correctly compare a major version number', function() { | ||
ext.atLeastVersion('3', '2.9.912').should.be.true; | ||
}); | ||
it('should correctly compare an exact version match', function() { | ||
ext.atLeastVersion('1.2.34', '1.2.34').should.be.true; | ||
}); | ||
}); | ||
|
||
describe('ffmpegTimemarkToSeconds', function() { | ||
it('should correctly convert a simple timestamp', function() { | ||
ext.ffmpegTimemarkToSeconds('00:02:00.00').should.be.equal(120); | ||
}); | ||
it('should correctly convert a complex timestamp', function() { | ||
ext.ffmpegTimemarkToSeconds('00:08:09.10').should.be.equal(489); | ||
}); | ||
}); | ||
}); |