flutter-bounty-hunters / ffmpeg_cli Goto Github PK
View Code? Open in Web Editor NEWFFMPEG CLI wrapper written in Dart
License: MIT License
FFMPEG CLI wrapper written in Dart
License: MIT License
FFMPEG scripting is very difficult to learn. We want this package to make it easier, where possible, rather than adding even more complexity on top.
Create a guide website for this package, including instructions for global activation, as well as common FFMPEG use-cases.
Currently, we need to know the syntax of ffmpeg cli arguments. For example, if we want to trim the start of an input, we need to create an argument with the following code:
CliArg(name: 'ss', value: myValueInSeconds);
Ideally, users of this package shouldn't need to know the exact syntax of a cli argument. We should abstract the underlying syntax by providing objects for the arguments. For example, for trimming the start of an input the user should be able to write a code like the following:
TrimStart(const Duration(seconds: 5));
If we want to improve the discoverability of the arguments we could use factory methods like the following:
CliArgs.trimStart(const Duration(seconds: 5));
Using factory methods the users would be able to discover the arguments by using the IDE code completion.
Hi to all involved, I really enjoy using your package.
I just recently came across an issue where the width and height of some videos had odd numbers an the error that through was
[executeThumbnailGenerationLinux] Stderr: width not divisible by 2 (447x800)
[vost#0:0/libx264 @ 0000022e5adaec80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
The code I ran that affected this was:
FilterChain(
inputs: [videoStream.videoOnly],
filters: [
if ((aspectRatio ?? 0) >= 1) ScaleFilter(width: 800, height: -1),
if ((aspectRatio ?? 0) < 1) ScaleFilter(width: -1, height: 800),
],
outputs: [outputStream.videoOnly],
),
);
What i realized is that using ffmpegg on the cli allows you to use '-2" for width or height which ensures that these issues dont happen.
Therefore I just ended up extended the the Filter class and simply changed your assert statements from "-1" to "-2".
See my version below:
PageMeScaleFilter({
this.width,
this.height,
this.eval,
this.interl,
this.swsFlags,
this.param0,
this.param1,
this.size,
}) : assert(width == null || width >= -2),
assert(height == null || height >= -2),
assert(eval == null || eval == 'init' || eval == 'frame'),
assert(interl == null || interl == 1 || interl == 0 || interl == -1);
This completely solves my issue, so I was wondering if you would like me to submit a PR with the changes.
Have a great day.
Cheers
Hello, nice package, but I am curious how to use files that are picked by file_picker plugin with it. When I try - it just errors that there is no such file.
Is there any way the filterGraph could be nullable, or if filterGraph.chains.isEmpty, that it could just not add the filter chains arguments to the command?
When looking through the docs, I see that there is some form of cropping (I think?) with the ScaleFilter (?) but when using, does not affect the size of the video. I need something that is the same as the crop functionality. (crop=x:y:p1:p2)
In my case:
crop=585:1080
However, I do not currently see a way to add burned in subtitles as a filter.
I need a way to be able to add this as a possible filter:
subtitles=.temp/comments.srt:fontsdir=defaults/font:force_style='Fontname=Verdana,Alignment=10'
Hopefully, I can customize the path of ffmpeg and package ffmpeg directly to my installation directory。
Is there a function to track the progress of the video encoding process?
On windows, I just want to convert webm audio file to mp3.
But ffmpeg never find the input file, even the file exist:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: ProcessException: The specified file could not be found.
Command: ffmpeg -i E:\Download/test.webm -ab 320 -ar 44100 -filter_complex " " E:\Download/test.mp3
Same with files in assets
folder.
Rutvik has existing work that captures Flutter screenshots as images and then stitches them together into video with FFMPEG.
Try to use this package to generate that FFMPEG command. If anything is missing from this package in that example, file issues for it.
When everything is working, add a test that configures the same command and verifies the output FFMPEG command.
Currently FfmpegCommand.simple()
takes a List
of inputs
. However, the FFMPEG docs state: "Simple filtergraphs are those that have exactly one input and output, both of the same type."
https://ffmpeg.org/ffmpeg.html#Simple-filtergraphs
Unless I'm missing something, we should probably change inputs
to a singular input
.
The ScaleFilter
current serializes its size
property using string interpolation, which sends "[Size]" to FFMPEG. Update the filter to serialize the appropriate string representation of a size to FFMPEG.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.