{"id":14985042,"url":"https://github.com/yangjie10930/epmedia","last_synced_at":"2025-05-15T13:05:14.522Z","repository":{"id":41176479,"uuid":"92356177","full_name":"yangjie10930/EpMedia","owner":"yangjie10930","description":"Android上基于FFmpeg开发的视频处理框架，简单易用，体积小，帮助使用者快速实现视频处理功能。包含以下功能：剪辑，裁剪，旋转，镜像，合并，分离，变速，添加LOGO，添加滤镜，添加背景音乐，加速减速视频，倒放音视频。 The video processing framework based on FFmpeg developed on Android is simple, easy to use, and small in size, helping users quickly realize video processing functions. Contains the following functions: editing, cropping, rotating, mirroring, merging, separating, variable speed, adding LOGO, adding filters, adding background music, accelerating and decelerating video, rewinding audio and video.","archived":false,"fork":false,"pushed_at":"2021-08-09T08:11:06.000Z","size":27364,"stargazers_count":2451,"open_issues_count":152,"forks_count":540,"subscribers_count":73,"default_branch":"master","last_synced_at":"2025-05-15T13:05:13.893Z","etag":null,"topics":["android","android-video-editor","ffmpeg","ffmpeg-logo","video-editor"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yangjie10930.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-25T02:23:41.000Z","updated_at":"2025-05-15T11:27:00.000Z","dependencies_parsed_at":"2022-07-21T12:03:05.713Z","dependency_job_id":null,"html_url":"https://github.com/yangjie10930/EpMedia","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangjie10930%2FEpMedia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangjie10930%2FEpMedia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangjie10930%2FEpMedia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangjie10930%2FEpMedia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yangjie10930","download_url":"https://codeload.github.com/yangjie10930/EpMedia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-video-editor","ffmpeg","ffmpeg-logo","video-editor"],"created_at":"2024-09-24T14:10:10.082Z","updated_at":"2025-05-15T13:05:14.490Z","avatar_url":"https://github.com/yangjie10930.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/badge/minSdkVersion-21-green.svg)](https://developer.android.google.cn) [![](https://img.shields.io/badge/FFmpeg-4.2.2-orange.svg)](https://ffmpeg.org/download.html#release_3.3) \n[![](https://jitpack.io/v/yangjie10930/EpMedia.svg)](https://jitpack.io/#yangjie10930/EpMedia)\n#### 中文 / [English](https://github.com/yangjie10930/EpMedia/blob/master/Readme-English.md)\n\n# EpMedia\n基于FFmpeg开发的视频处理框架，简单易用，体积小，帮助使用者快速实现视频处理功能。包含以下功能：剪辑，裁剪，旋转，镜像，合并，分离，添加LOGO，添加滤镜，添加背景音乐，加速减速视频，倒放音视频。\u003c/br\u003e\n\n好用的话麻烦给个star,感谢您的支持与鼓励O(∩_∩)O\n\n\u003ca href=\"https://github.com/yangjie10930/EpMediaDemo\" target=\"_blank\"\u003eDemo点这里\u003c/a\u003e   \n\n##### V1.0.0版本更新说明\n1. 更新FFmpeg至4.2.2版本，使用ndk-r21编译，采用clang工具;\n1. 新增x86_64支持;\n1. 移除添加文字的功能(由于依赖库编译的一些问题，该方法暂时无法使用，后续会加回，如果需要此功能，请使用v0.9.5版本);\n1. 添加MediaCodec的支持。\n\n\n## 使用方法:\n* build.gradle里添加:\n```Java\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n* 添加gradle依赖:\n```Java\ncompile 'com.github.yangjie10930:EpMedia:v1.0.1'\n```\n## 单个视频处理:\n* 创建待处理视频:\n```Java\nEpVideo epVideo = new EpVideo(url);\n```\n* 剪辑\n```Java\n//一个参数为剪辑的起始时间，第二个参数为持续时间,单位：秒\nepVideo.clip(1,2);//从第一秒开始，剪辑两秒\n```\n* 裁剪\n```Java\n//参数分别是裁剪的宽，高，起始位置X，起始位置Y\nepVideo.crop(480,360,0,0);\n```\n* 旋转和镜像\n```Java\n//第一个参数为旋转角度，第二个参数为是否镜像，仅支持90,180,270度旋转\nepVideo.rotation(90,true);\n```\n* 添加文字\n```Java\n//参数分别是添加位置的X,Y坐标,文字的字号(单位px),文字颜色,字体文件的路径,内容，Time类为显示的起始时间和持续时间\nepVideo.addText(10,10,35,\"red\",ttfPath,text);\nepVideo.addText(new EpText(10,10,35,\"red\",ttfPath,text,new EpText.Time(3,5)));\n```\n* 添加logo\n```Java\n//添加图片类\n//参数为图片路径,X,Y,图片的宽,高,是否是动图(仅支持png,jpg,gif图片,如果是gif图片,最后一个参数为true)\nEpDraw epDraw = new EpDraw(filePath,10,10,50,50,false);\nepVideo.addDraw(epDraw);\n或\nepVideo.addDraw(new EpDraw(filePath,10,10,50,50,false,3,5));//最后两个参数为显示的起始时间和持续时间\n```\n* 添加自定义滤镜\n```Java\n//自定义滤镜，ffmpeg命令支持的滤镜都支持\n//详细效果可参考：http://blog.csdn.net/u012027644/article/details/77833484\n//具体内容参见ffmpeg filter官网：http://www.ffmpeg.org/ffmpeg-filters.html\n//举例 String filter = \"lutyuv=y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val\";//底片效果\nepVideo.addFilter(filter);\n```\n* 处理单个视频\n```Java\nEpVideo epVideo = new EpVideo(url);\n//输出选项，参数为输出文件路径(目前仅支持mp4格式输出)\nEpEditor.OutputOption outputOption = new EpEditor.OutputOption(outFile);\noutputOption.width = 480;//输出视频宽，如果不设置则为原始视频宽高\noutputOption.height = 360;//输出视频高度\noutputOption.frameRate = 30;//输出视频帧率,默认30\noutputOption.bitRate = 10;//输出视频码率,默认10\nEpEditor.exec(epVideo, outputOption, new OnEditorListener());\n```\n* 添加背景音乐\n```Java\n//参数分别是视频路径，音频路径，输出路径,原始视频音量(1为100%,0.7为70%,以此类推),添加音频音量\nEpEditor.music(videoPath, audioPath, outfilePath, 1, 0.7, new OnEditorListener());\n```\n* 分离音视频\n```Java\n//参数分别是视频路径，输出路径，输出类型\nEpEditor.demuxer(videoPath, outfilePath,EpEditor.Format.MP3, new OnEditorListener());\n```\n* 视频变速\n```Java\n//参数分别是视频路径,输出路径,变速倍率（仅支持0.25-4倍),变速类型(VIDEO-视频(选择VIDEO的话则会屏蔽音频),AUDIO-音频,ALL-视频音频同时变速)\nEpEditor.changePTS(videoPath, outfilePath, 2.0f, EpEditor.PTS.ALL, new OnEditorListener());\n```\n* 音视频倒放\n```Java\n//参数分别是视频路径,输出路径,视频是否倒放，音频是否倒放（两个都选true的话，音视频都倒放，视频ture音频false的话，输出倒放的无音频视频，视频false音频ture的话，输入倒放的音频，音频的倒放也用这个配置）\nEpEditor.reverse(videoPath, outfilePath, true, true, new OnEditorListener());\n```\n* 视频转图片\n```Java\n//参数分别是视频路径,输出路径（路径用集合的形式，比如pic%03d.jpg,支持jpg和png两种图片格式）,输出图片的宽度，输出图片的高度，每秒输出图片数量（2的话就是每秒2张，0.5f的话就是每两秒一张）\nEpEditor.video2pic(videoPath, outfilePath, 720, 1080, 2, new OnEditorListener());\n```\n* 图片转视频\n```Java\n//参数分别是图片集合路径,输出路径,输出视频的宽度，输出视频的高度，输出视频的帧率\nEpEditor.pic2video(picPath, outfilePath, 480, 320, 30, new OnEditorListener());\n```\n## 多个视频处理\u0026合并\n* 合并视频（支持对要合并的视频进行其他处理操作）\n```Java\nArrayList\u003cEpVideo\u003e epVideos = new ArrayList\u003c\u003e();\nepVideos.add(new EpVideo(url));//视频1\nepVideos.add(new EpVideo(url2));//视频2\nepVideos.add(new EpVideo(url3));//视频3\n//输出选项，参数为输出文件路径(目前仅支持mp4格式输出)\nEpEditor.OutputOption outputOption = new EpEditor.OutputOption(outFile);\noutputOption.width = 480;//输出视频宽，默认480\noutputOption.height = 360;//输出视频高度,默认360\noutputOption.frameRate = 30;//输出视频帧率,默认30\noutputOption.bitRate = 10;//输出视频码率,默认10\nEpEditor.merge(epVideos, outputOption, new OnEditorListener());\n```\n* 无损合并视频(对视频格式严格，需要分辨率，帧率，码率都相同，不支持对要合并的视频进行其他处理操作，该方法合并速度很快，另：两段同格式的音频拼接也可使用该方法)\n```Java\nArrayList\u003cEpVideo\u003e epVideos = new ArrayList\u003c\u003e();\nepVideos.add(new EpVideo(url));//视频1\nepVideos.add(new EpVideo(url2));//视频2\nepVideos.add(new EpVideo(url3));//视频3\nEpEditor.mergeByLc(epVideos, new EpEditor.OutputOption(outFile), new OnEditorListener());\n```\n## 自定义命令\n* 输入ffmpeg命令即可（起头不用输ffmpeg,例子\"-i input.mp4 -ss 0 -t 5 output.mp4\",第二个参数为视频长度，单位微秒，可以填0）\n```Java\nEpEditor.execCmd(\"\", 0, new OnEditorListener() {\n\t@Override\n\tpublic void onSuccess() {\n\n\t}\n\n\t@Override\n\tpublic void onFailure() {\n\n\t}\n\n\t@Override\n\tpublic void onProgress(float progress) {\n\n\t}\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangjie10930%2Fepmedia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyangjie10930%2Fepmedia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangjie10930%2Fepmedia/lists"}