Comments (7)
This happens if the input video dimensions are larger then the calculated pad area. ffmpeg throws an error like:
[Parsed_pad_1 @ 0x36df440] Input area 80:0:720:360 not within the padded area 0:0:640:360 or zero-sized
[Parsed_scale_0 @ 0x372fdc0] Failed to configure input pad on Parsed_pad_1
Error opening filters!
I think we should first scale down the video and then apply the pad area in one step, like
-vf scale=640:360,pad=480:360:80:0:0x000000
I did a quick test and combined the scaling and padding in one method
// add size and pad area in one step
// video must be scaled down before we apply the pad area!
if (this.options.video.size && this.options.video.pad && !this.options.video.skip) {
args.push('-vf');
args.push('scale=' + this.options.video.size
+ ',pad=' + this.options.video.pad.w +
':' + this.options.video.pad.h +
':' + this.options.video.pad.x +
':' + this.options.video.pad.y +
':' + this.options.video.padcolor);
}
Seems to work so far.
from node-fluent-ffmpeg.
please test the branch commited above, if everything works we can merge it to the master
from node-fluent-ffmpeg.
Will this be merged and and updated into npm?
from node-fluent-ffmpeg.
Would be good to get a test written before this is merged
from node-fluent-ffmpeg.
On a side note, I'm considering rewriting those size/aspect/padding helpers to only use ffmpeg filters. I'm sick of this dimension calculation code, it is too error prone and ffmpeg filters can do that automagically :)
from node-fluent-ffmpeg.
I completely agree, the more we can push functionality down into ffmpeg the better.
from node-fluent-ffmpeg.
I'm closing this because it should have been addressed by #236. Feel free to reopen if you have problems.
from node-fluent-ffmpeg.
Related Issues (20)
- FFmpeg Error: Error: Output format wav is not available HOT 3
- Is it possible to write multiple output files from a complex filter? HOT 1
- How to record screen on Mac?
- How to add cover image to audio on the "fly" (stream) ?
- pass text file to complexFilter
- ffmpeg : ffmpeg error :Output format xxx is not available HOT 1
- Error: Cannot find ffmpeg on Azure Function HOT 1
- Take url as input HOT 2
- How do I use transitions in fluent-ffmpeg
- When I install v2.1.3 package is really large and contains coverage directory
- Error: Input format lavfi is not available
- ReferenceError: `__dirname` is not defined
- Property 'on' does not exist on type 'FfmpegCommand'. Did you mean to access the static member 'FfmpegCommand.on' instead? HOT 4
- Crash when setting ffmpeg path after successfully converting
- vstack passthrough stream of buffered images HOT 1
- Crush on second instance of ffmpeg HOT 1
- Input format v4l2 is not available
- Can someone help me use fetch to transcode and return a response object that is a stream? HOT 1
- Input Format dshow is not avaiable
- ReferenceError: setImmediate is not defined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-fluent-ffmpeg.