Просмотр файла vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php

Размер файла: 1.51Kb
  1. <?php
  2. /*
  3. * This file is part of PHP-FFmpeg.
  4. *
  5. * (c) Alchemy <info@alchemy.fr>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace FFMpeg\Media;
  11.  
  12. use FFMpeg\Coordinate\TimeCode;
  13. use FFMpeg\Coordinate\Dimension;
  14.  
  15. class Video extends AbstractVideo
  16. {
  17.  
  18. /**
  19. * Gets the frame at timecode.
  20. *
  21. * @param TimeCode $at
  22. * @return Frame
  23. */
  24. public function frame(TimeCode $at)
  25. {
  26. return new Frame($this, $this->driver, $this->ffprobe, $at);
  27. }
  28.  
  29. /**
  30. * Extracts a gif from a sequence of the video.
  31. *
  32. * @param TimeCode $at
  33. * @param Dimension $dimension
  34. * @param int $duration
  35. * @return Gif
  36. */
  37. public function gif(TimeCode $at, Dimension $dimension, $duration = null)
  38. {
  39. return new Gif($this, $this->driver, $this->ffprobe, $at, $dimension, $duration);
  40. }
  41.  
  42. /**
  43. * Concatenates a list of videos into one unique video.
  44. *
  45. * @param array $sources
  46. * @return Concat
  47. */
  48. public function concat($sources)
  49. {
  50. return new Concat($sources, $this->driver, $this->ffprobe);
  51. }
  52.  
  53. /**
  54. * Clips the video at the given time(s).
  55. *
  56. * @param TimeCode $start Start time
  57. * @param TimeCode $duration Duration
  58. * @return \FFMpeg\Media\Clip
  59. */
  60. public function clip(TimeCode $start, TimeCode $duration = null)
  61. {
  62. return new Clip($this, $this->driver, $this->ffprobe, $start, $duration);
  63. }
  64. }