Pure Kotlin DSL library to build FFmpeg CLI commands in a more descriptive and comprehensive way
Steps explain how the add the FFmpeg DSL
library to your Android project.
Take this post as a reference to the following steps.
// github.properties
gpr.usr=00000 // Your Github User ID
gpr.key=xxxx // Your Github Personal Access Token with the permission to read packages
- Alternative: Set some environment variables with the credentials, something like
GPR_USER
andGPR_API_KEY
.
*see the github.properties.example file
*how to get the Github User Id
At the top of your bundle.gradle
file, add the code to read the github.properties
content
def githubProperties = new Properties()
try {
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
} catch(FileNotFoundException e) {
// ignore
}
def user = githubProperties.getProperty('gpr.usr', System.getenv("GPR_USER"))
def key = githubProperties.getProperty('gpr.key', System.getenv("GPR_API_KEY"))
At the allprojects
block, add a custom Maven repository
allprojects {
repositories {
...
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/moises-ai/ffmpeg-dsl-android")
credentials {
username = user
password = key
}
}
}
}
implementation 'ai.moises:ffmpeg-dsl:[LATEST_VERSION]'
Steps explain how to manually publish a new version of the FFmpeg DSL
library
to the Github Package Registry.
Take this post as a reference to the following steps.
// github.properties
gpr.usr=00000 // Your Github User ID
gpr.key=xxxx // Your Github Personal Access Token with the permission to read packages
- Alternative: Set some environment variables with the credentials, something like
GPR_USER
andGPR_API_KEY
.
*see the github.properties.example file
*how to get the Github User Id
On the build.gradle
file, update the versionName
variable with the new version.
For Windows and Linux, run the flowing scripts under the root directory of the project.
$ gradle clean
$ gradle assemble
$ gradle publish
For MacOS, run the flowing scripts under the root directory of the project.
$ ./gradlew clean
$ ./gradlew assemble
$ ./gradlew publish
ffmpegCommand {
isOverrideAllowed = true
input {
seekStart = minutes(2)
inputTimeOffset = seconds(0.3102834467120186)
path = "test.mp3"
}
outputPath = "out.mp3"
}
// result: -y -ss "02:00" -itoffset "0.3102834467120186" -i "test.mp3" "out.mp3"
See the Example app for more usage examples.