Giter Site home page Giter Site logo

gs01md / bpshortvideosample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rootkit/bpshortvideosample

0.0 1.0 0.0 62.23 MB

Face Filter Based on GPUImage, Short Video Recording, Face Sticker Examples. 短视频录制的一个例子,拥有美颜滤镜、人脸贴纸功能。

License: MIT License

Ruby 0.08% Objective-C 79.89% Shell 0.96% C 18.83% C++ 0.25%

bpshortvideosample's Introduction

短视频录制demo

抖音、快手、火山小视频等一系列 App使短视频录制已经成功热门的功能。阿里云短视频 SDK、趣拍云 SDK、涂图 SDK、七牛短视频 SDK等市面上的短视频 SDK 均收费昂贵。 看到有人给我 star,请期待我后续更新,把代码抽离出来。

功能特性

  • 短视频录制
  • 不含第三方收费 SDK,使用 GPUImage 开源框架和科大讯飞免费的离线人脸识别 SDK开发
  • 支持延迟拍摄、录制中拍照、切换摄像头
  • 仿全民 K 歌,原唱伴唱切换,歌词滚动显示
  • 录制实时美颜,滤镜可调节参数、强弱程度
  • 实时切换背景音乐、调整音量
  • 音视频分离录制,防止黑屏
  • 录制断点续拍、多段合成(可实现回删功能)
  • 实时添加动态固定或人脸贴纸
  • 多视频合成
  • 多轨道合成
  • 上传后文件预览播放
  • 视频转码便于网络传输
  • 自己制作人脸贴纸、动态贴纸,png 序列帧配合 json配置 文件打包(可自主实现加密),简单易懂

操作界面

demo.gif

录制效果

product_demo.gif

人脸、动态贴纸制作格式简单说明

贴纸资源采用zip打包压缩制作,json文件配置,配置格式如下:

{
    "fixed_stickers": [
        {
            "sticker_directory": "flower",
            "filename_format": "flower_%zd",
            "frame_count": 100,
            "positionX": 0.5,
            "positionY": 1,
            "anchorpointX": 0.5,
            "anchorpointY": 1,
            "width": 540,
            "height": 200,
            "animation_duration": 5,
            "display_width": 1,
            "display_height": 0
        }
    ],
    "face_stickers": [
        {
            "sticker_directory": "cap",
            "filename_format": "cap_%zd",
            "frame_count": 25,
            "face_type": "head",
            "width": 330,
            "height": 220,
            "animation_duration": 3
        }
    ]
}

类型 参数名称 说明
固定贴纸/人脸贴纸 sticker_directory 贴纸资源所在目录
固定贴纸/人脸贴纸 filename_format 名称格式化
固定贴纸/人脸贴纸 frame_count 帧数
固定贴纸 positionX 坐标值x(取值0~1)
固定贴纸 positionY 坐标值y(取值0~1)
固定贴纸 anchorpointX 锚点x(取值0~1)
固定贴纸 anchorpointY 锚点y(取值0~1)
固定贴纸/人脸贴纸 width 贴纸原始宽度
固定贴纸/人脸贴纸 height 贴纸原始高度
固定贴纸 display_width 相对屏幕宽度的展示宽度(0为自动)
固定贴纸 display_height 相对屏幕高度的展示高度(0为自动)
固定贴纸/人脸贴纸 animation_duration 完成一次动画的时长
人脸贴纸 face_type 人脸识别类型(face、nose、head、mouth)

bpshortvideosample's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.