Skip to content

Give the duration of the file. #50

Closed
@browinskipl

Description

@browinskipl

Hi! I am trying to cut a file. I am using this code:

$start = \FFMpeg\Coordinate\TimeCode::fromSeconds(5)
$clipFilter = new \FFMpeg\Filters\Video\ClipFilter($start);

FFMpeg::fromDisk('videos')
    ->open('steve_howe.mp4')
    ->addFilter($clipFilter)
    ->export()
    ->toDisk('converted_videos')
    ->inFormat(new \FFMpeg\Format\Video\X264)
    ->save('short_steve.mkv');

How can I set duration of the video? Now if I have 10 sec lenght video i give start 5 sec and then I get 5 sec video. What if I want to have video from 2 do 8 sec lenght from 10 second video? How to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions