-
Notifications
You must be signed in to change notification settings - Fork 43
视频编辑
- AndroVid专业视频编辑 http://apk.gfan.com/Product/App274154.html
- Magisto视频编辑 http://sj.zol.com.cn/magisto/
- Video Edit+ http://www.appchina.com/app/com.w6soft.videoedit/
- 视频编辑器 乐七视频秀 http://apk.hiapk.com/appinfo/com.xvideostudio.videoeditor
- VitamioRecorder帮助开发者实现 Android 平台上的短视频应用开发。 提供视频录制、后滤镜、炫酷 MV 主题、后期强大的 FFMPEG 命令行支 持,可实现水印、音量控制等诸多功能。
- fix, 在MediaObject.java的removePart()方法中增加如下代码
if (part == mCurrentPart) { mCurrentPart = null; }
-
主要流程概述
- 调用camera实现分段拍摄, 存成n.ts
- 调用ffmpeg, 将多段ts合并为一个mp4文件
- 调用ffmpeg, 将上一步的mp4文件加滤镜效果
-
详细流程图
-
native接口实际传的参数
//app启动初始化
//UtilityAdapter.FFmpegInit(Object, String) line: not available [native
method] [local variables unavailable]
versionName=1.0&versionCode=1&sdkVersion=1.2.0&android=4.0.3&device=HTC
T328w
//UtilityAdapter.FilterParserAction(String, int) line: not available
[native method] [local variables unavailable]
"", PARSERACTION_FREE
//UtilityAdapter.FilterParserAction(String, int) line: not available
[native method] [local variables unavailable]
"", PARSERACTION_INIT
//UtilityAdapter.RenderInputSettings(int, int, int, int) line: not
available [native method] [local variables unavailable]
640, 480, 0, UtilityAdapter.FLIPTYPE_NORMAL
//UtilityAdapter.RenderOutputSettings(int, int, int, int) line: not
available [native method] [local variables unavailable]
480, 480, mFrameRate, UtilityAdapter.OUTPUTFORMAT_YUV |
UtilityAdapter.OUTPUTFORMAT_MASK_MP4 /|
UtilityAdapter.OUTPUTFORMAT_MASK_HARDWARE_ACC/
//点击开始分段拍摄
//UtilityAdapter.FilterParserAction(String, int) line: not available
[native method] [local variables unavailable]
cmd, UtilityAdapter.PARSERACTION_START
cmd=filename =
"/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418006696882/0.ts";
UtilityAdapter.RenderDataYuv(data);
//点下一步开始合并分段视频
//UtilityAdapter.FFmpegRun(String, String) line: not available [native
method] [local variables unavailable]
"", cmd
cmd=ffmpeg -d stdout -loglevel verbose -i
"/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418006696882/0.ts" -vcodec copy
-acodec copy -absf aac_adtstoasc -f mp4 -movflags faststart
"/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418006696882/1418006696882.mp4"
UtilityAdapter.registerNativeListener(UtilityAdapter$OnNativeListener) line: 294
//加载主题 //UtilityAdapter.SaveData(saveFile.toString(), pixels, UtilityAdapter.OUTPUTFORMAT_MASK_ZIP) saveFile.toString()=/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp
//预览 //UtilityAdapter.FilterParserInit(getSetting(false), mSurfaceHolder.getSurface()); getSetting(false)=filterpath=/data/data/com.yixia.camera.demo/cache/Theme/Empty; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; length=230.90; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418006696882/1418006696882.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418007231;
UtilityAdapter.ndkAudioWrite(short[], int) line: 239
NativeStart.run() line: not available [native method]
UtilityAdapter.ndkNotify(int, int) line: 284
NativeStart.run() line: not available [native method]
int progress = UtilityAdapter.FilterParserInfo(UtilityAdapter.FILTERINFO_PROGRESS);
//设置主题 滤镜时参数 //UtilityAdapter.FilterParserInit(getSetting(false), mSurfaceHolder.getSurface()); //getSetting(false)= filterpath=/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Love; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; length=32.82; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601/1418008201601.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418008270;
filterpath=/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Love; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; length=32.82; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601/1418008201601.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418008270;
filterpath=/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Love; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; filter=-i "/data/data/com.yixia.camera.demo/cache/Theme/FilterAssets/1974/1974.bmp"; length=32.82; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601/1418008201601.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418008270;
filterpath=/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Love; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; filter=-i "/data/data/com.yixia.camera.demo/cache/Theme/FilterAssets/1974/1974.bmp"; length=32.82; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601/1418008201601.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418008270;
filterpath=/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Dreamworld; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; sourcemusic=-i "/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Dreamworld/Lover.mp3"; length=32.82; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601/1418008201601.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418008270;
//下一步保存时,startEncoding //UtilityAdapter.FilterParserInit(getSetting(true), null); //getSetting(true)=
filterpath=/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Dreamworld; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; sourcemusic=-i "/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Dreamworld/Lover.mp3"; length=32.82; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601/1418008201601.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418008270; outputv="/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601.mp4";
filterpath=/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Dreamworld; commonpath=/data/data/com.yixia.camera.demo/cache/Theme/Common; sourcemusic=-i "/data/data/com.yixia.camera.demo/cache/Theme/MusicVideoAssets/Dreamworld/Lover.mp3"; length=32.82; inputva=/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601/1418008201601.mp4; sourceauthor=-f rawvideo -r 15 -s 182x30 -pix_fmt rgba -i "zip:/data/data/com.yixia.camera.demo/cache/Theme/theme_author.bmp"; authorsizew=182; authorsizeh=30; bitrate=1500; randomfactor=1418008270; outputv="/mnt/emmc/DCIM/100MEDIA/VCameraDemo/1418008201601.mp4";
### Vitamio Recorder 2.0 的一些notes
* 目前版本仅仅支持支持ARMV7 CPU, 我们要用于手机端的话,如何适配别的cpu??
* 拍摄视频没有时间限制的话, 长视频的转码时间将难以接受。且app有概率崩溃。
* 拍长视频的话,文件大小也是个问题,上传服务器的时间将很长。
### related
* [[camera]]
Just build something.