Skip to content

Low-level, minimal H264 decoder & encoder library for windows, hololens/uwp, ios/tvos/macos, linux, android/quest/magic leap. CAPI for use with c#, unreal, swift

License

Notifications You must be signed in to change notification settings

NewChromantics/PopH264

Repository files navigation

Documentation

The bulk of the API documentation is in PopH264.h

Installation

Unity

Install as a unity package using their scoped registry system;

  • In your project's ProjectName/Packages/manifest.json add
"scopedRegistries": [
    {
      "name": "New Chromantics Packages",
      "url": "https://npm.pkg.github.com/@newchromantics",
      "scopes": [
        "com.newchromantics"
      ]
    }
  ]
  • Generate a github PAT (a personal access token in your github user-settings)
  • In your user directory (~ on mac, c:\users\yourname on windows) add a .upmconfig.toml file and add an entry
[npmAuth."https://npm.pkg.github.com/@newchromantics"]
token = "your_personal_access_token"
email = "[email protected]"
alwaysAuth = true

Build Status

Build Windows Build Linux Build Apple Create Release

Platform Support

Any empty platforms are generally planned, but not yet implemented.

Platform Software Decoding Hardware Decoding Software Encoding Hardware Encoding Build Status
Windows x86
Windows x64 Broadway MediaFoundation MediaFoundation
Windows UWP Hololens1
Windows UWP Hololens2
Linux arm64 for Nvidia Jetson Nano Broadway x264 V4L2 (Nvidia)
Linux arm for Raspberry PI 1,2,Zero (untested) Broadway x264
Linux arm for Raspberry PI 3 Broadway x264
Linux x64 ubuntu Broadway x264
Osx Intel Broadway AvFoundation x264 AvFoundation
Osx Arm64 Broadway AvFoundation AvFoundation
Ios Broadway AvFoundation AvFoundation
Ios Simulator Untested Untested Untested Untested
Android armeabi-v7a Broadway
Android x86 Broadway
Android x86_64 Broadway
Android arm64-v8a Broadway
Magic Leap/Luma (Linux x86) Broadway MLMediaCodec Google,Nvidia
Web Broadway.js
Unity WebGL

Unity Decoder Support

  • Included is a c# CAPI wrapper with threading support, texture2D output wrapper.
  • Turning this into a package is WIP.

Unity Encoder Support

  • Still todo, but is a CAPI which can be easily implemented
  • Turning this into a package is WIP.

Unreal Support

  • Not currently planned, but CAPI which hopefully lends itself well to being a class.

Build Instructions

Windows

  • Open solutions and build

Osx & Ios

  • Open xcodeprojects and build
  • Use PopH264_Universal target to build PopH264.xcframework which contains OSX, IOS and IOS simulator frameworks.

Linux

  • Install X264
    • sudo apt-get install libx264-dev
  • Compile
    • make osTarget=arm64 (jetson,pi4 = arm64)

Start Self Hosted Runner as a Service

Android

Misc Notes

The following are various notes which PopH264 handles. (Or at least, it should handle and there should be an issue covering it if not).

MediaFoundation

  • If you try and decode any Nalu before SPS, you get no error, but no output. This include PPS before SPS.

Broadway

  • If you try and decode an IDR keyframe once then end the stream, you will get no frame out. It requires submitting the frame a second time to get the frame out.
  • SPS & PPS need to be sent before other packets, or we will get no output. #20
  • If you try and decode an intra-frame before keyframe, the decoder will stop with no error and get no frame output. #21

About

Low-level, minimal H264 decoder & encoder library for windows, hololens/uwp, ios/tvos/macos, linux, android/quest/magic leap. CAPI for use with c#, unreal, swift

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •