Skip to content

Instantly share code, notes, and snippets.

@blmarket
Created August 7, 2012 15:05
Show Gist options
  • Save blmarket/3286135 to your computer and use it in GitHub Desktop.
Save blmarket/3286135 to your computer and use it in GitHub Desktop.
Transcode to iPad
var ffmpeg = require('fluent-ffmpeg');
function Transcode(filename, callback) {
var encoder = new ffmpeg({ source: filename, timeout: 6000});
require('./iPadPreset').load(encoder).saveToFile('/tmp/target.m4v', function(retcode, error) {
console.log("retcode = " + retcode);
console.log("error = " + error);
});
}
Transcode(__dirname + "/test/src/9bZkp7q19f0.flv");
exports.load = function(ffmpeg) {
ffmpeg
.toFormat('m4v')
.withVideoBitrate('1200k')
.withVideoCodec('libx264')
.withSize('1024x768')
.withAudioBitrate('128k')
.withAudioCodec('libvo_aacenc')
.withAudioChannels(2)
.addOptions(['-flags', '+loop+mv4', '-cmp', '+chroma', '-partitions','+parti4x4+partp8x8+partb8x8', '-flags2',
'+mixed_refs', '-me_method umh', '-subq 5', '-bufsize 2M', '-rc_eq \'blurCplx^(1-qComp)\'',
'-qcomp 0.6', '-qmin 10', '-qmax 51', '-qdiff 4', '-level 30' ]);
return ffmpeg;
};
{
"name": "transcode-to-ipad",
"version": "0.0.0",
"description": "Transcode to iPad preset",
"main": "index.js",
"scripts": {
"test": "mocha"
},
"repository": "",
"keywords": [
"transcode",
"ipad",
"movie",
"podcast"
],
"author": "Jeong, Heon",
"license": "MIT",
"dependencies": {
"fluent-ffmpeg": "~1.1.7"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment