Skip to content

Commit c16b3de

Browse files
- add setHlsListSize method
- update readme
1 parent f7876c4 commit c16b3de

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,20 @@ require 'vendor/autoload.php'; // path to the autoload file
5858
This package will autodetect FFmpeg and FFprobe binaries. If you want to give binary paths explicitly, you can pass an array as configuration. A Psr\Logger\LoggerInterface can also be passed to log binary executions.
5959

6060
``` php
61+
use Monolog\Handler\StreamHandler;
62+
use Monolog\Logger;
63+
6164
$config = [
6265
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
6366
'ffprobe.binaries' => '/usr/bin/ffprobe',
6467
'timeout' => 3600, // The timeout for the underlying process
6568
'ffmpeg.threads' => 12, // The number of threads that FFmpeg should use
6669
];
70+
71+
$log = new Logger('FFmpeg_Streaming');
72+
$log->pushHandler(new StreamHandler('/var/log/ffmpeg-streaming.log')); // path to log file
6773

68-
$ffmpeg = Streaming\FFMpeg::create($config);
74+
$ffmpeg = Streaming\FFMpeg::create($config, $log);
6975
```
7076

7177
### Opening a File
@@ -282,12 +288,12 @@ You can use these libraries to play your streams.
282288
- **WEB**
283289
- DASH and HLS:
284290
- **[Shaka Player](https://github.com/google/shaka-player)**
285-
- **[Flowplayer](https://github.com/flowplayer/flowplayer)**
286291
- **[videojs-http-streaming (VHS)](https://github.com/videojs/http-streaming)**
287292
- **[MediaElement.js](https://github.com/mediaelement/mediaelement)**
288293
- **[DPlayer](https://github.com/MoePlayer/DPlayer)**
289294
- **[Clappr](https://github.com/clappr/clappr)**
290295
- **[Plyr](https://github.com/sampotts/plyr)**
296+
- **[Flowplayer](https://github.com/flowplayer/flowplayer)**
291297
- DASH:
292298
- **[dash.js](https://github.com/Dash-Industry-Forum/dash.js)**
293299
- HLS:
@@ -305,6 +311,8 @@ You can use these libraries to play your streams.
305311
- **[FFmpeg(ffplay)](https://github.com/FFmpeg/FFmpeg)**
306312
- **[VLC media player](https://github.com/videolan/vlc)**
307313

314+
As you may know, **[IOS](https://www.apple.com/ios)** does not have native support for DASH. Although there are some libraries such as **[Viblast](https://github.com/Viblast/ios-player-sdk)** and **[MPEGDASH-iOS-Player](https://github.com/MPEGDASHPlayer/MPEGDASH-iOS-Player)** to support this technique, I have never tested them. So if you know any IOS player that supports DASH Stream and also works fine, please add it to the above list.
315+
308316
**NOTE:** You should pass a manifest of stream(e.g. `https://www.aminyazdanpanah.com/PATH_TO_STREAM_DIRECTORY/dash-stream.mpd` or `/PATH_TO_STREAM_DIRECTORY/hls-stream.m3u8` ) to these players.
309317

310318
## Contributing and Reporting Bugs

src/Filters/HLSFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private function HLSFilter(HLS $hls): array
5454
$filter[] = "-keyint_min";
5555
$filter[] = "48";
5656
$filter[] = "-hls_list_size";
57-
$filter[] = "0";
57+
$filter[] = $hls->getHlsListSize();
5858
$filter[] = "-hls_time";
5959
$filter[] = $hls->getHlsTime();
6060
$filter[] = "-hls_allow_cache";

src/HLS.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class HLS extends Streaming
3131
/** @var string */
3232
private $hls_base_url = "";
3333

34+
/** @var int */
35+
private $hls_list_size = 0;
36+
3437
/** @var bool */
3538
public $tmp_key_info_file = false;
3639

@@ -138,6 +141,24 @@ public function getHlsBaseUrl(): string
138141
return $this->hls_base_url;
139142
}
140143

144+
/**
145+
* @param int $hls_list_size
146+
* @return HLS
147+
*/
148+
public function setHlsListSize(int $hls_list_size): HLS
149+
{
150+
$this->hls_list_size = $hls_list_size;
151+
return $this;
152+
}
153+
154+
/**
155+
* @return int
156+
*/
157+
public function getHlsListSize(): int
158+
{
159+
return $this->hls_list_size;
160+
}
161+
141162
/**
142163
* @return Filter
143164
*/

0 commit comments

Comments
 (0)