All Projects → exozet → AndroidVideoTranscoder

exozet / AndroidVideoTranscoder

Licence: MIT license
On device extracting images from videos - creating video from images.

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to AndroidVideoTranscoder

PPlayer
ffmpeg 4.0.2静态库从0开始一个播放器的搭建,支持rtmp、rtsp、hls、本地MP4文件播放,音视频同步,直播推流
Stars: ✭ 81 (+200%)
Mutual labels:  mediacodec
ffmpeg-hardcode
No description or website provided.
Stars: ✭ 16 (-40.74%)
Mutual labels:  mediacodec
YingKe-MediaCodec
学习实践MediaCodeC。Android MediaCodec API 实现下载网络video,MediaCodec播放器播放视频,MediaCodec录视频,MediaCodec实视频转码,MediaCodec从视频分离音频aac,MediaCodec音频解码pcm原始数据,MediaCodec多个音频进行混音,MediaCodec拼接多个视频
Stars: ✭ 79 (+192.59%)
Mutual labels:  mediacodec
FPV VR OS
Latest version of FPV_VR, open source under LGPL
Stars: ✭ 42 (+55.56%)
Mutual labels:  mediacodec
RtmpPublishKit
rtmp publish kit for android , encode with mediacodec
Stars: ✭ 106 (+292.59%)
Mutual labels:  mediacodec
LiveVideo10ms
Real time video decoding on android
Stars: ✭ 41 (+51.85%)
Mutual labels:  mediacodec
VideoCrop
Crop video with Android Media Codec API
Stars: ✭ 44 (+62.96%)
Mutual labels:  mediacodec
Wslivedemo
音视频,直播SDK,rtmp推流,录制视频,滤镜。百万用户,线上迭代半年,已经稳定。
Stars: ✭ 1,782 (+6500%)
Mutual labels:  mediacodec
Libstreaming
A solution for streaming H.264, H.263, AMR, AAC using RTP on Android
Stars: ✭ 3,167 (+11629.63%)
Mutual labels:  mediacodec
Rxffmpeg
🔥💥RxFFmpeg 是基于 ( FFmpeg 4.0 + X264 + mp3lame + fdk-aac + opencore-amr + openssl ) 编译的适用于 Android 平台的音视频编辑、视频剪辑的快速处理框架,包含以下功能:视频拼接,转码,压缩,裁剪,片头片尾,分离音视频,变速,添加静态贴纸和gif动态贴纸,添加字幕,添加滤镜,添加背景音乐,加速减速视频,倒放音视频,音频裁剪,变声,混音,图片合成视频,视频解码图片,抖音首页,视频播放器及支持 OpenSSL https 等主流特色功能
Stars: ✭ 3,358 (+12337.04%)
Mutual labels:  mediacodec
codecinfo
Detailed listing of multimedia codecs on an Android device
Stars: ✭ 33 (+22.22%)
Mutual labels:  mediacodec

AndroidVideoTranscoder Build Status Download Hits-of-Code Javadoc API Gradle Version Kotlin GitHub license androidx

Surprisingly fast on device video transcoding.

Features

  • extracting images from video either ffmpeg or mediacodec
  • creating video from image either ffmpeg or mediacodec

Screenshot

How to use FFMpeg Part

Extracting frames

FFMpegTranscoder.extractFramesFromVideo(
		context = application, 
		frameTimes = times, 
		inputVideo = inputVideo, 
		id = "12345", 
		outputDir = frameFolder
	)
	.subscribeOn(Schedulers.io())
	.observeOn(AndroidSchedulers.mainThread())
	.subscribe(
	{ logv { "extract frames ${it.progress} ${it.message} ${(it.duration / 1000f).roundToInt()} s" } },
	{ logv { "extracting frames failed ${it.message}" }}, 
	{ logv { "extracting frames successfully completed" } }
)
.addTo(subscription)

Merging frames to create video

FFMpegTranscoder.createVideoFromFrames(
	context = application,
	frameFolder = frameFolder,
	outputUri = outputVideo,
	config = EncodingConfig(
	sourceFrameRate = 30 // every source image is a frame
	)
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
	{ logv { "merging frames ${it.progress} ${it.message} ${(it.duration / 1000f).roundToInt()} s" } },
	{ logv { "merging frames to create a video failed ${it.message}" }}, 
	{ logv { "video creation successfully completed" } }
)
.addTo(subscription)

How to use MediaCodec Part

Extracting frames

 MediaCodecTranscoder.extractFramesFromVideo(
	context = this,
	frameTimes = times,
	inputVideo = inputVideo,
	id = "loremipsum",
	outputDir = frameFolder,
	photoQuality = 100
    )
	.subscribeOn(Schedulers.io())
	.observeOn(AndroidSchedulers.mainThread())
	.subscribe(
	    { logv { "extractFramesFromVideo progress $it" }},
	    { logv { "extracting frames failed ${it.message}" }}, 
	    { logv { "extracting frames successfully completed" }}
	).addTo(subscription)

Merging frames to create video

MediaCodecTranscoder.createVideoFromFrames(
	frameFolder = frameFolder,
	outputUri = outputVideo,
	deleteFramesOnComplete = true
    )
	.subscribeOn(Schedulers.io())
	.observeOn(AndroidSchedulers.mainThread())
	.subscribe(
	    {logv { "createVideoFromFrames progress $it" }},
		{ logv { "merging frames to create a video failed ${it.message}" }}, 
		{ logv { "video creation successfully completed" } }
	).addTo(subscription)

How to install

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://dl.bintray.com/exozetag/maven' }
	}
}

Step 2. Add the dependency

dependencies {
	implementation 'com.exozet:transcoder:{version}'

	//Need to add ffmpeg dependencies if want to use FFMpegTranscoder(tested version 4.3.1.LTS)
	implementation 'com.arthenica:mobile-ffmpeg-full-gpl:{version}'
}

License

Copyright 2019 Exozet GmbH

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.

Contributors

Jan Rabe

Ömür Kumru

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].