Metadata-Version: 2.1
Name: m3u8tool
Version: 0.1.1
Summary: A HTTP Live Streaming (HLS) manipulation tool
Home-page: https://github.com/kurusugawa-computer/m3u8tool
Author: squld
Author-email: sato@kurusugawa.jp
License: Apache License 2.0
Keywords: m3u8
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Utilities
Classifier: Operating System :: OS Independent
Requires-Python: >=3.5
Description-Content-Type: text/markdown

# m3u8tool
HTTP Live Streaming (HLS) フォーマットファイルを取り扱うための CLI ツールです。

# Features
* HLS フォーマットファイル (m3u8+ts) を分割 (split) できます。
* HLS フォーマットファイル (m3u8+ts) を結合 (cat) できます。
* HLS フォーマットファイル (m3u8+ts) を別の動画フォーマットと相互変換 (convert) できます。

# Requirements
* python 3.5+
* ffmpeg 4.x (動画フォーマット変換する場合のみ)

# Install
pip
```shell
$ pip install git+https://github.com/kurusugawa-computer/m3u8tool
```

pipenv
```shell
$ pipenv install -e git+https://github.com/kurusugawa-computer/m3u8tool#egg=m3u8tool
```

# Usage

## HLS フォーマットファイル (m3u8+ts) を分割 (split)

`input.m3u8` を `{filename}-{index:04}.m3u8` に分割
```shell
$ m3u8tool split input.m3u8
```

`input.m3u8` を `3.0` 秒ごとに `output-{index:04}.m3u8` に分割
```shell
$ m3u8tool split -d 3.0 -m output-{index:04}.m3u8 input.m3u8
```

`input.m3u8` を `output-{index:04}.m3u8` と `output-{index:04}.ts` に分割
```shell
$ m3u8tool split -m output-{index:04}.m3u8 -t output-{index:04}.ts input.m3u8
```

## HLS フォーマットファイル (m3u8+ts) を結合
`input-{index:04}.m3u8` を `output.m3u8` に結合
```shell
$ m3u8tool cat input-*.m3u8 output.m3u8
```

`input-{index:04}.m3u8` を `output.m3u8` と `output.ts` に結合
```shell
$ m3u8tool cat -t output.ts input-*.m3u8 output.m3u8
```

## HLS フォーマットファイル (m3u8+ts) を別の動画フォーマットと相互変換
`input.mp4` を `output.m3u8` と `output.ts` に変換
```shell
$ m3u8tool convert input.mp4 output.m3u8
```

`input.m3u8` を `output.mp4` に変換
```shell
$ m3u8tool convert input.m3u8 output.mp4
```


