{"id":15027268,"url":"https://github.com/wangshuo1143368701/wslivedemo","last_synced_at":"2025-05-15T17:02:53.754Z","repository":{"id":43676586,"uuid":"123081789","full_name":"WangShuo1143368701/WSLiveDemo","owner":"WangShuo1143368701","description":"音视频，直播SDK，rtmp推流，录制视频，滤镜。百万用户，线上迭代半年，已经稳定。","archived":false,"fork":false,"pushed_at":"2022-04-04T06:24:43.000Z","size":379,"stargazers_count":2040,"open_issues_count":44,"forks_count":563,"subscribers_count":68,"default_branch":"master","last_synced_at":"2025-03-31T23:34:04.773Z","etag":null,"topics":["android","camera","gpuimage","mediacodec","opengl-es","rtmp"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WangShuo1143368701.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T06:10:53.000Z","updated_at":"2025-03-26T14:29:45.000Z","dependencies_parsed_at":"2022-09-03T04:41:03.235Z","dependency_job_id":null,"html_url":"https://github.com/WangShuo1143368701/WSLiveDemo","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangShuo1143368701%2FWSLiveDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangShuo1143368701%2FWSLiveDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangShuo1143368701%2FWSLiveDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangShuo1143368701%2FWSLiveDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WangShuo1143368701","download_url":"https://codeload.github.com/WangShuo1143368701/WSLiveDemo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755550,"owners_count":20990620,"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","camera","gpuimage","mediacodec","opengl-es","rtmp"],"created_at":"2024-09-24T20:06:05.836Z","updated_at":"2025-04-08T00:34:18.597Z","avatar_url":"https://github.com/WangShuo1143368701.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WSLiveDemo\n直播SDK，推流，录制视频，滤镜。\n\n博客教程：http://blog.csdn.net/King1425/article/details/79392158\u003cbr/\u003e\n交流群号：364886309 ，949792060\n\n概述：\n---\n**现在把我们项目中的直播SDK开源出来，我们是境外直播平台，百万用户，经过半年迭代，SDK已经相当稳定，大家可以放心使用。https://github.com/WangShuo1143368701/WSLiveDemo**\n\n\n之前写过一篇[ffmpeg实战教程（十一）手把手教你实现直播功能，不依赖第三方SDK](http://blog.csdn.net/king1425/article/details/72560673)\n是用ffmpeg实现的推流，但是在实际移动端直播项目中，推流是不适合用ffmpeg的。\n\n特性：\n--\n支持视频录制和推流，推流录制视频可以同时进行\u003cbr/\u003e\n支持推流过程中实时截帧功能\u003cbr/\u003e\n支持推流过程中实时镜像功能，不会打断推流\u003cbr/\u003e\n支持设置关键帧间隔gop\u003cbr/\u003e\n支持动态设置码率，帧率\u003cbr/\u003e\n支持分开设置预览分辨率，编码的分辨率\u003cbr/\u003e\n支持gpu滤镜，并可以通过opengles绘制图像纹理来自定义滤镜。\u003cbr/\u003e\n支持设fbo滤镜组。\u003cbr/\u003e\n支持设置水印\u003cbr/\u003e\n支持前后摄像头快速切换，不会打断推流。\u003cbr/\u003e\n支持后台推流，后台录制视频\u003cbr/\u003e\n美颜滤镜可动态调节磨皮，美白，红润。\u003cbr/\u003e\n兼容GPUImage，一行代码不用修改就可以直接使用GPUImage的滤镜。可参考demo。\u003cbr/\u003e\n\n关于美颜：\n----\n美颜滤镜可动态调节磨皮，美白，红润。你可以调出一个你喜欢的美颜滤镜。\n\n关于截帧，镜像：\n----\n推流过程中可以实时截帧。\u003cbr/\u003e\n推流过程中可以实时调节镜像，不会打断推流。可以分别调节预览镜像，推流镜像。\n\n关于性能：\n-----\n采用相机回调纹理texture,OpenGL渲染后直接把textureID传给编码器的方案，中间没有数据格式转换，没有glReadPixel()函数耗时问题。所以性能较其它方案要好的多。缺点是必须是Android4.3以上。\n\n关于拉流：\n-----\nhttps://github.com/WangShuo1143368701/WS_IJK\n优化过的IJK播放器，秒开实现，推流端断网回调等。。。\n\n关于使用：\n-----\n\n1.所有常用API都在StreamLiveCameraView类中\n\n```\n \u003cme.lake.librestreaming.ws.StreamLiveCameraView\n        android:id=\"@+id/stream_previewView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/\u003e\n```\n\n2.初始化推流配置， StreamAVOption类里面有多种参数可配置，如不配置则使用默认值\n\n```\n    /**\n     * 设置推流参数\n     */\n    public void initLiveConfig() {\n        mLiveCameraView = (StreamLiveCameraView) findViewById(R.id.stream_previewView);\n\n        //参数配置 start   \n        streamAVOption = new StreamAVOption();\n        streamAVOption.streamUrl = rtmpUrl;\n        //参数配置 end\n\n        mLiveCameraView.init(this, streamAVOption);\n        mLiveCameraView.addStreamStateListener(resConnectionListener);\n        //设置滤镜组\n        LinkedList\u003cBaseHardVideoFilter\u003e files = new LinkedList\u003c\u003e();\n        files.add(new GPUImageCompatibleFilter(new GPUImageBeautyFilter()));\n        files.add(new GPUImageCompatibleFilter(new GPUImageAddBlendFilter()));\n        mLiveCameraView.setHardVideoFilter(new HardVideoGroupFilter(files));\n    }\n```\n3.开始推流录制 具体参考demo：\n\n```\n          case R.id.btn_startStreaming://开始推流\n               if(!liveCameraView.isStreaming()){\n                   liveCameraView.startStreaming(rtmpUrl);\n               }\n               break;\n           case R.id.btn_stopStreaming://停止推流\n               if(liveCameraView.isStreaming()){\n                   liveCameraView.stopStreaming();\n               }\n               break;\n           case R.id.btn_startRecord://开始录制\n               if(!liveCameraView.isRecord()){ \n                   liveCameraView.startRecord();\n               }\n               break;\n           case R.id.btn_stopRecord://停止录制\n               if(liveCameraView.isRecord()){\n                   liveCameraView.stopRecord();                \n               }\n```\n\n关于集成：\n-----\n方法1.https://github.com/WangShuo1143368701/WSLiveDemo下载后，copy出libWSLive库到你的项目中即可。\n\n方法2.\n\n```\n//Add it in your root build.gradle at the end of repositories:\n \n allprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url 'https://jitpack.io' }\n\t}\n }\n\n    //Add the dependency\n\n   dependencies {\n\t         compile 'com.github.WangShuo1143368701:WSLiveDemo:v1.7'\n\t}\n\n```\n\n关于学习：\n-----\n欢迎加入音视频交流群：364886309，949792060\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangshuo1143368701%2Fwslivedemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangshuo1143368701%2Fwslivedemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangshuo1143368701%2Fwslivedemo/lists"}