Skip to content
/ m3u8-cpp Public
forked from tedconf/node-m3u8

Streaming parser for m3u8 files

License

Notifications You must be signed in to change notification settings

zeerd/m3u8-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

m3u8-cpp

This is a pure header files library used to parse M3U8. Spec depends on Apple's HTTP Live Streaming protocol.

I converted the node-m3u8 from javascript into c++ by using Github Copilot then made some adjustments.

All the test-cases passed (yes, I deleted some of them) but I am still not sure if everything works as expected.

TODO: Add serialize back for download function to save a local m3u8 file. But I am not sure if unserialize is necessary or not.

Build

sudo apt install nlohmann-json3-dev libcurl4-openssl-dev
mkdir build && cd build
cmake .. && make -j && make install

Test

./test/m3u8-test

Examples

Check local file.

./example/m3u8-file ../test/fixtures/variant.m3u8

Check online playlist.

./example/m3u8-url https://muiplayer.js.org/media/media.m3u8

Download m3u8 into one single file.

./example/m3u8-download https://muiplayer.js.org/media/media.m3u8 ~/Downloads/media.ts

Play m3u8 media.

./example/m3u8-player https://muiplayer.js.org/media/media.m3u8

Code Style

Need clang-format-12 at least.

find . -name "*.h" | xargs clang-format -i
find . -name "*.cpp" | xargs clang-format -i

About

Streaming parser for m3u8 files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.2%
  • CMake 3.8%