Giter Club home page Giter Club logo

ffmpeg-rtmp265's Introduction

在ffmpeg中支持hevc/vp8/vp9/opus的flv格式

项目背景

  1. 当前阿里云,金山云等众多cdn,已经支持hevc in rtmp/flv(采用增加codecid=12的方式)
  2. 国外大厂和国外cdn支持hevc in rtmp/flv方式:enhanced-rtmp

基于兼容上面两种hevc in rtmp/flv的方式,本库均支持。

本库支持的版本(见对应的branch分支):

  • 4.1
  • 4.3
  • 5.0
  • 5.1
  • 6.0(支持enhanced-rtmp)

国内cdn方式: 新增codecid

hevc/vp8/vp9/opus在rtmp中的codecid没有官方协议定义,由国内众多知名cdn共同制定。


FLV_CODECID_OPUS = 9 << FLV_AUDIO_CODECID_OFFSET

enum {
    FLV_CODECID_H263    = 2,
    FLV_CODECID_SCREEN  = 3,
    FLV_CODECID_VP6     = 4,
    FLV_CODECID_VP6A    = 5,
    FLV_CODECID_SCREEN2 = 6,
    FLV_CODECID_H264    = 7,
    FLV_CODECID_REALH263= 8,
    FLV_CODECID_MPEG4   = 9,
    FLV_CODECID_HEVC    = 12,
    FLV_CODECID_AV1     = 13,
    FLV_CODECID_VP8     = 14,
    FLV_CODECID_VP9     = 15,
};

国外大厂和cdn方式:enhanced-rtmp

  • mux/推流:需要设置: -f flv -flvflags ext_header
ffmpeg -re -i source.flv -c:v libx265 -c:a copy -f flv -flvflags ext_header rtmp://192.168.0.1/live/1000
  • demux/拉流: 不需要格外操作,自动识别

编译

只需要把flv.h/flvdec.c/flvenc.c拷贝入libavformat文件夹中,后面ffmpeg正常编译即可。

ffmpeg-rtmp265's People

Watchers

Achilles 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.