File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 22
33All Notable changes to ` pbmedia/laravel-ffmpeg ` will be documented in this file
44
5+ ## 8.1.1 - 2022-05-13
6+
7+ - Bugfix for parsing the average frame rate.
8+
59## 8.1.0 - 2022-05-12
610
711- You may now specify a separate temporary disk for processing HLS exports.
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public static function new(Stream $stream): StreamParser
2121
2222 public function getFrameRate (): ?string
2323 {
24- $ frameRate = trim (Str:: before ( optional ($ this ->stream )->get ('avg_frame_rate ' ), " /1 " ));
24+ $ frameRate = trim (optional ($ this ->stream )->get ('avg_frame_rate ' ));
2525
2626 if (!$ frameRate || Str::endsWith ($ frameRate , '/0 ' )) {
2727 return null ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace ProtoneMedia \LaravelFFMpeg \Tests ;
4+
5+ use FFMpeg \FFProbe \DataMapping \Stream ;
6+ use ProtoneMedia \LaravelFFMpeg \Support \StreamParser ;
7+
8+ class StreamParserTest extends TestCase
9+ {
10+ /** @test */
11+ public function it_can_extract_the_average_frame_rate ()
12+ {
13+ $ this ->assertEquals (25 , StreamParser::new (new Stream (['avg_frame_rate ' => 25 ]))->getFrameRate ());
14+ $ this ->assertEquals (25 , StreamParser::new (new Stream (['avg_frame_rate ' => '25/1 ' ]))->getFrameRate ());
15+ $ this ->assertEquals (25 , StreamParser::new (new Stream (['avg_frame_rate ' => '250/10 ' ]))->getFrameRate ());
16+ $ this ->assertEquals (25 , StreamParser::new (new Stream (['avg_frame_rate ' => '50/2 ' ]))->getFrameRate ());
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments