-
Notifications
You must be signed in to change notification settings - Fork 10
Images to video generation cli command tests added (Resolves #11) #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
86bf410
eefc3f4
008cc3b
6f033a6
7885401
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,42 @@ void main() { | |
), | ||
); | ||
}); | ||
|
||
test("converts a group of images to a video", () { | ||
final command = FfmpegCommand.simple( | ||
inputs: [ | ||
// file%d.png represents images named like file0.png, file1.png, file2.png, etc. | ||
|
||
FfmpegInput.asset("assets/images/file%d.png"), | ||
|
||
FfmpegInput.asset("assets/audio/audio.mp3"), | ||
], | ||
args: [ | ||
const CliArg(name: 'y'), | ||
|
||
const CliArg(name: 'c:a', value: 'aac'), | ||
const CliArg(name: 'qscale:v', value: '1'), | ||
], | ||
outputFilepath: 'assets/output/file.mp4', | ||
|
||
); | ||
|
||
expect( | ||
command.toCli(), | ||
const CliCommand( | ||
|
||
executable: 'ffmpeg', | ||
args: [ | ||
"-i", | ||
"assets/images/file%d.png", | ||
"-i", | ||
"assets/audio/audio.mp3", | ||
"-y", | ||
"-c:a", | ||
"aac", | ||
"-qscale:v", | ||
"1", | ||
"assets/output/file.mp4" | ||
], | ||
), | ||
); | ||
}); | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that other tests in this file test technical details of the package. This test is really more of an example use-case. If we put all use cases in this file then it would be very difficult to find anything. Please put this test in a new file called
test/use_cases/use_cases_test.dart
.