PHPackages                             baohanddd/m3u8 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. baohanddd/m3u8

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

baohanddd/m3u8
==============

Support loading, parsing and clipping m3u8 files and cropping .ts files

1.1.9(3y ago)180MITPHP

Since Oct 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/baohanddd/m3u8)[ Packagist](https://packagist.org/packages/baohanddd/m3u8)[ RSS](/packages/baohanddd-m3u8/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (14)Used By (0)

A library of M3U8
=================

[](#a-library-of-m3u8)

crop m3u8 and .ts files if necessary.

How to use?
-----------

[](#how-to-use)

### Example: crop m3u8

[](#example-crop-m3u8)

```
# load m3u8 file from url...
$filename = new Filename("https://video3.futurelink.live/record/aliyun/en2/a.m3u8");
$m3u8 = new M3U8($filename);
$m3u8->setFFMPEG('/data/bin/ffmpeg');   // Optional，default bin path is /usr/bin/ffmpeg
$m3u8->setSavePath("/oss/video3");      // Optional, default save path is /tmp
$m3u8->addClippableDomain('video3.futurelink.live');
$m3u8->addClippableDomain('video2.futurelink.live');
$m3u8->setIndexSaveHandler(function(string $m3u8Name, string $content): string {
    $path = "/tmp/{$m3u8Name}";
    $fp = fopen($path, 'wb');
    fwrite($fp, $content);
    fclose($fp);
    return $path;
});

# drop clips before 10 seconds and after 200 seconds...
$start = 10.0;
$end = 200.0;
$m3u8->load($filename);
$m3u8->getTimeline()->clip($start, $end)->cut();

# save clips between start and end...
$start = 10.0;
$end = 200.0;
$m3u8->load($filename);
$m3u8->getTimeline()->merge($start, $end)->cut();
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Recently: every ~73 days

Total

13

Last Release

1323d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79f2348c437cf1a1aae2848beacc1adc2cae3d8be7faacbe28d5a3483225a367?d=identicon)[baohanddd](/maintainers/baohanddd)

---

Top Contributors

[![baohanddd](https://avatars.githubusercontent.com/u/3166072?v=4)](https://github.com/baohanddd "baohanddd (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/baohanddd-m3u8/health.svg)

```
[![Health](https://phpackages.com/badges/baohanddd-m3u8/health.svg)](https://phpackages.com/packages/baohanddd-m3u8)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.9k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[google/cloud

Google Cloud Client Library

1.2k16.7M57](/packages/google-cloud)[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M18](/packages/pantheon-systems-terminus)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
