repeat first and last frame of a video

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

repeat first and last frame of a video

Michael Koch
Hi,

is it possible to do the following with ffmpeg?

Repeat the first frame of a video 100 times (with the same framerate as
the video), then copy the video, then repeat the last frame 100 times?

Thanks,
Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: repeat first and last frame of a video

Paul B Mahol
On 8/1/18, Michael Koch <[hidden email]> wrote:
> Hi,
>
> is it possible to do the following with ffmpeg?
>
> Repeat the first frame of a video 100 times (with the same framerate as
> the video), then copy the video, then repeat the last frame 100 times?

If you mean to copy video without generally losing quality than answer is no.
Otherwise you can use loop video filter.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: repeat first and last frame of a video

Michael Koch

>
>> Repeat the first frame of a video 100 times (with the same framerate as
>> the video), then copy the video, then repeat the last frame 100 times?
> If you mean to copy video without generally losing quality than answer is no.
> Otherwise you can use loop video filter.

The loop video filter requires the number of the first frame of the
loop. For the first frame that's 0, that's easy. But is there a way for
find out the number of the last frame in a video? I mean automatically,
because I want to run the command for several videos of different length.

Thanks,
Michael
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: repeat first and last frame of a video

Michael Koch
>
>>
>>> Repeat the first frame of a video 100 times (with the same framerate as
>>> the video), then copy the video, then repeat the last frame 100 times?
>> If you mean to copy video without generally losing quality than
>> answer is no.
>> Otherwise you can use loop video filter.
>
> The loop video filter requires the number of the first frame of the
> loop. For the first frame that's 0, that's easy. But is there a way
> for find out the number of the last frame in a video? I mean
> automatically, because I want to run the command for several videos of
> different length.
>

Related question:
Is it possible to give ffmpeg a video as input, and get the last frame
of this video as output?

Thanks,
Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: repeat first and last frame of a video

Gyan Doshi


On 02-08-2018 01:15 AM, Michael Koch wrote:

>
> Related question:
> Is it possible to give ffmpeg a video as input, and get the last frame
> of this video as output?

Yes, using something like

     ffmpeg -sseof -0.2 -i input -q:v 1 -update 1 out.jpg


For holding last frame, see

     https://stackoverflow.com/a/43417253/5726027


Regards,
Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".