- Removed the AppComaptActivity Dependency for the callQuery method. Using Handler and post instead.
- By doing is this way you can easily use this on a ViewModel without needing access to the Activity.
SSffmpegVideoOperation
SimformSolutionsPvtLtdApache-2.0长期未更新面向 Android 的 FFmpeg 封装库,用 Kotlin 调用即可完成视频压缩、帧提取、GIF 生成和 MP3 转换等常见音视频处理。
This is a library of FFmpeg for android... 📸 🎞 🚑
README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。
README 没有说明硬件要求。
项目说明
这个项目的说明还在生成中,先参考下面「最近发版」和 README。
- 1.0.8Removing AppCompatActivity in the CallQuery method最新正式版2022-02-23 · 2022-02-23 04:55 UTC
- 1.0.7🔖1.0.72021-09-08 · 2021-09-08 08:26 UTC
查看更新说明
1.0.7 #22 min sdk update to 24
- 1.0.6FFMPEG Video Operations2021-01-22 · 2021-01-22 09:19 UTC
查看更新说明
FFmpeg compiled for Android. Execute FFmpeg commands with ease in your Android app.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
FFMPEG video operations
FFmpeg compiled for Android. Execute FFmpeg commands with ease in your Android app.
Getting Started
This project is provide in-build FFmpeg operation queries:
Video operation ffmpeg queries like
- Cut video using time
- Convert image to video
- Add water mark on video
- Add text on video
- Combine image image and video
- Combine images
- Combine videos
- Compress a video
- Extract frames from video
- Fast/Slow motion video
- Reverse video
- video fade in / fade out
- Compress video to GIF
- Rotate and Flip video (Mirroring)
- Remove audio from video
- Update aspect ratio of video
Other extra operation FFmpeg queries like
- Merge GIFs
- Merge Audios
- Update audio volume
- Fast/Slow audio
- Crop audio using time
- Compress Audio
Architectures
FFmpeg Android runs on the following architectures:
- arm-v7a, arm-v7a-neon, arm64-v8a, x86 and x86_64
Features
- Enabled network capabilities
- Multi-threading
- Supports zlib and Media-codec system libraries
- Camera access on supported devices
- Supports API Level 24+
Support target sdk
- 30
Dependency
Gradle Dependency
-
Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } } -
Add the dependency in your app's build.gradle file
dependencies { implementation 'com.github.SimformSolutionsPvtLtd:SSffmpegVideoOperation:1.0.8' }
This is all you have to do to load the FFmpeg library.
Run FFmpeg command
In this sample code we will run the FFmpeg -version command in background call.
val query:Array<String> = "-i, input,....,...., outout"
CallBackOfQuery().callQuery(query, object : FFmpegCallBack {
override fun statisticsProcess(statistics: Statistics) {
Log.i("FFMPEG LOG : ", statistics.videoFrameNumber)
}
override fun process(logMessage: LogMessage) {
Log.i("FFMPEG LOG : ", logMessage.text)
}
override fun success() {
}
override fun cancel() {
}
override fun failed() {
}
})
In-build query example
val startTimeString = "00:01:00" (HH:MM:SS)
val endTimeString = "00:02:00" (HH:MM:SS)
val query:Array<String> = FFmpegQueryExtension().cutVideo(inputPath, startTimeString, endTimeString, outputPath)
CallBackOfQuery().callQuery(query, object : FFmpegCallBack {
override fun statisticsProcess(statistics: Statistics) {
Log.i("FFMPEG LOG : ", statistics.videoFrameNumber)
}
override fun process(logMessage: LogMessage) {
Log.i("FFMPEG LOG : ", logMessage.text)
}
override fun success() {
//Output = outputPath
}
override fun cancel() {
}
override fun failed() {
}
})
same for other queries. And you can apply your query also
Medium Blog
For more info go to Multimedia Operations for Android using FFmpeg
Find this library useful? :heart:
Support it by joining stargazers for this repository. :star:
Awesome Mobile Libraries
- Check out our other available awesome mobile libraries
License
Copyright 2021 Simform Solutions
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.