mirror of
https://github.com/seigler/HLS-over-IPFS-video-player
synced 2025-07-27 09:46:12 +00:00
chore: update README with ffmpeg commands
This commit is contained in:
parent
3013b210ee
commit
372fda4a2c
1 changed files with 16 additions and 5 deletions
21
README.md
21
README.md
|
@ -8,21 +8,32 @@ Accepts three query parameters:
|
||||||
- `source`: optional, defaults to `master.m3u8`.
|
- `source`: optional, defaults to `master.m3u8`.
|
||||||
- `title`: optional, allows overriding the browser tab title.
|
- `title`: optional, allows overriding the browser tab title.
|
||||||
|
|
||||||
Here are commands you can use to encode and upload a video to IPFS:
|
Here is a script you can use to encode a video into a HLS folder with a playlist:
|
||||||
|
|
||||||
```
|
```
|
||||||
mkdir output
|
#!/usr/bin/env bash
|
||||||
cd output
|
outdir=${1%.*}
|
||||||
ffmpeg -i ../yourVideoFilename.mp4 -profile:v baseline -level 3.0 -start_number 0 -hls_time 5 -hls_list_size 0 -f hls master.m3u8
|
mkdir "$outdir"
|
||||||
ipfs add -Qr .
|
pushd "$outdir"
|
||||||
|
ffmpeg -i "../$1" -profile:v baseline -level 3.0 -start_number 0 -hls_time 5 -hls_list_size 0 -f hls master.m3u8
|
||||||
|
popd
|
||||||
```
|
```
|
||||||
|
|
||||||
|
(If you add that to your path as `recode-to-hls` you can convert a folder of MP4 files with the command `ls *.mp4 -1 | xargs -d "\n" recode-to-hls`.)
|
||||||
|
|
||||||
|
A folder produced this way can be posted to IPFS, and that hash is used in this page URL. Here are two hashes created following this format:
|
||||||
|
|
||||||
|
`QmdpAidwAsBGptFB3b6A9Pyi5coEbgjHrL3K2Qrsutmj9K` - Big Buck Bunny
|
||||||
|
`QmYzdc44xBkVgp8aWJW57KprjDs5j2hmN8g7eDqm5pvY8L` - Royal Path episode 001
|
||||||
|
|
||||||
The output from the `ipfs` command is the hash to use with this page.
|
The output from the `ipfs` command is the hash to use with this page.
|
||||||
|
|
||||||
Two example URLs:
|
Two example URLs:
|
||||||
|
|
||||||
http://ipfs.io/ipfs/QmQkJRPbmqcYeQcyN6mFmSYGoLWT7731GggCrTKo9tHBqF/?hash=QmdpAidwAsBGptFB3b6A9Pyi5coEbgjHrL3K2Qrsutmj9K&title=Big%20Buck%20Bunny
|
http://ipfs.io/ipfs/QmQkJRPbmqcYeQcyN6mFmSYGoLWT7731GggCrTKo9tHBqF/?hash=QmdpAidwAsBGptFB3b6A9Pyi5coEbgjHrL3K2Qrsutmj9K&title=Big%20Buck%20Bunny
|
||||||
|
|
||||||
|
https://ipfs.io/ipfs/QmQkJRPbmqcYeQcyN6mFmSYGoLWT7731GggCrTKo9tHBqF/?hash=QmYzdc44xBkVgp8aWJW57KprjDs5j2hmN8g7eDqm5pvY8L&title=Royal+Path+001+-+What+is+the+Royal+Path%3F
|
||||||
|
|
||||||
## How to build from source
|
## How to build from source
|
||||||
|
|
||||||
### NPM commands
|
### NPM commands
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue