jackxiao / jslibs

Automatically exported from code.google.com/p/jslibs
0 stars 0 forks source link

Wrap the functionality of libav* #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Provide a JSLibs extension wrapping the functionality of libavformat,
libavcodec and associated code.

var av = new AVHandler('foo.avi');

Particularly, provide functionality to:

- query media files for information - resolution, frame rate, audio sample
rate, codec, wrapper, etc:

print('The video is at ' + av.frameRate + ' frames per second);

- convert between formats in native code, effectively making ffmpeg a
scriptable resource:

var avOpts = {
    vcodec: 'libx264',
    acodec: 'libmp3lame',
    vbitrate: 256,
    abitrate: 96
    /* etc */
};

av.convertTo('foo.mov',avOpts);

- Tools for navigating the AV stream:

print(av.position); // 0
av.seekTo(100);
print(av.position); // 100
av.frameAdvance(1);
/* etc */

- extract individual frames from a video stream to a JSlibs image object.

av.seekTo(128); // like mplayer -ss
var frame = av.snapshot(); // returns an image

- create new media files from JSlibs image objects:

var newAv = new AVHandler(null);
newAv.appendFrame(imageObject);
newAv.appendFrame(arrayOfImageObjects);
newAv.convertTo('foo.mov',avOpts);

Preferably, use open code written for ffmpegbc
(http://code.google.com/p/ffmbc/) since it includes useful enhancements for
film and TV work.

Original issue reported on code.google.com by phil_rho...@rocketmail.com on 5 Dec 2009 at 11:16

GoogleCodeExporter commented 9 years ago
libvlc may be another option to think about; it is a little bit more high-level,
includes playlist handling, streaming-service-discovery etc.

Decision for one of both may be a matter of taste in most cases, but the VLC
interface may be easier to use, maybe worth a closer look before making a final 
decision.

Original comment by nishimur...@gmail.com on 16 Jan 2010 at 1:59