[FFmpeg-user] FFplay: How to show the first frame of a video

Gyan Doshi ffmpeg at gyani.pro
Mon Aug 14 09:30:55 EEST 2023



On 2023-08-14 11:47 am, Michael Koch wrote:
> Am 14.08.2023 um 07:41 schrieb Michael Koch:
>> Hello,
>>
>> I'd like to make a batch file for FFplay that shows only the first 
>> frame of a video until the window is closed. It should also work for 
>> still images. This command line works for still images and for most 
>> videos, but not for all:
>>
>> ffplay -loop 0 -t 0 -x 500 -an %1
>>
>> Below is the console output for a video where it doesn't work. I saw 
>> these three messages:
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 000001e8bef96180] st: 0 edit list: 1 
>> Missing key frame while searching for timestamp: 1000
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 000001e8bef96180] st: 0 edit list 1 Cannot 
>> find an index entry before timestamp: 1000.
>> [h264 @ 000001e8c4a4fc00] co located POCs unavailable
>>
>> I have two questions:
>> 1. How must the command line be modified to make it work with all 
>> videos?
>> 2. Any idea how to show the n_th frame of a video?
>
> Just found the solution myself:
>
> ffplay -vf select='eq(n,0)' -x 500 -an %1

This will decode and evaluate all frames.

Go with

   ffplay -vf trim=end_frame=1,tpad=stop=-1:stop_mode=clone -x 500 -an %1

Regards,
Gyan



More information about the ffmpeg-user mailing list