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

Michael Koch astroelectronic at t-online.de
Mon Aug 14 08:41:48 EEST 2023


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?

Thanks,
Michael



C:\Users\astro\Desktop>c:\ffmpeg\ffplay -loop 0 -t 0 -x 500 -an 
C:\Users\astro\Desktop\Schnee.MOV
ffplay version 2023-08-10-git-d9d5695390-essentials_build-www.gyan.dev 
Copyright (c) 2003-2023 the FFmpeg developers
   built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
   configuration: --enable-gpl --enable-version3 --enable-static 
--disable-w32threads --disable-autodetect --enable-fontconfig 
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp 
--enable-bzlib --enable-lzma --enable-zlib --enable-libsrt 
--enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid 
--enable-libaom --enable-libopenjpeg --enable-libvpx 
--enable-mediafoundation --enable-libass --enable-libfreetype 
--enable-libfribidi --enable-libharfbuzz --enable-libvidstab 
--enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm 
--enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc 
--enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme 
--enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame 
--enable-libtheora --enable-libvo-amrwbenc --enable-libgsm 
--enable-libopencore-amrnb --enable-libopus --enable-libspeex 
--enable-libvorbis --enable-librubberband
   libavutil      58. 16.101 / 58. 16.101
   libavcodec     60. 23.100 / 60. 23.100
   libavformat    60. 10.100 / 60. 10.100
   libavdevice    60.  2.101 / 60.  2.101
   libavfilter     9. 10.100 /  9. 10.100
   libswscale      7.  3.100 /  7.  3.100
   libswresample   4. 11.100 /  4. 11.100
   libpostproc    57.  2.100 / 57.  2.100
[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.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\astro\Desktop\Schnee.MOV':
   Metadata:
     major_brand     : qt
     minor_version   : 537986816
     compatible_brands: qt  pana
     creation_time   : 2021-01-27T12:28:58.000000Z
     com.panasonic.Semi-Pro.metadata.xml: <?xml version="1.0" 
encoding="UTF-8" standalone="no" ?>
                     : <ClipMain 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="urn:schemas-Professional-Plug-in:Semi-Pro:ClipMetadata:v1.0">
                     :   <ClipContent>
                     : 
<GlobalClipID>060A2B340101010501010D2113000000BF61E24950BF563460541060C1650131</GlobalClipID>
                     :     <Duration>4056</Duration>
                     :     <EditUnit>1/24</EditUnit>
                     :     <EssenceList>
                     :       <Video>
                     :         <Codec BitRate="100">H264_420_LongGOP</Codec>
                     : <ActiveLine>1080</ActiveLine>
                     : <ActivePixel>1920</ActivePixel>
                     :         <BitDepth>8</BitDepth>
                     :         <FrameRate>24p</FrameRate>
                     :         <VFRRatio 
VRFRState="constant">24/180</VFRRatio>
                     : <TimecodeType>NonDrop</TimecodeType>
                     : <StartTimecode>17:30:54:21</StartTimecode>
                     :       </Video>
                     :       <Audio>
                     :         <Channel>2</Channel>
                     : <SamplingRate>48000</SamplingRate>
                     : <BitsPerSample>16</BitsPerSample>
                     :       </Audio>
                     :     </EssenceList>
                     :     <ClipMetadata>
                     :       <Rating>0</Rating>
                     :       <Access>
                     : 
<CreationDate>2021-01-27T12:28:58+02:00</CreationDate>
                     : 
<LastUpdateDate>2021-01-27T12:28:58+02:00</LastUpdateDate>
                     :       </Access>
                     :       <Device>
                     : <Manufacturer>Panasonic</Manufacturer>
                     : <ModelName>DC-GH5S</ModelName>
                     :       </Device>
                     :       <Shoot>
                     : <StartDate>2021-01-27T12:28:58+02:00</StartDate>
                     :       </Shoot>
                     :     </ClipMetadata>
                     :   </ClipContent>
                     :   <UserArea>
                     :     <AcquisitionMetadata 
xmlns="urn:schemas-Professional-Plug-in:P2:CameraMetadata:v1.2">
                     :       <CameraUnitMetadata>
                     :         <Gamma>
                     : <CaptureGamma>STANDARD</CaptureGamma>
                     :         </Gamma>
                     :         <Gamut>
                     : <CaptureGamut>BT.709</CaptureGamut>
                     :         </Gamut>
                     :       </CameraUnitMetadata>
                     :     </AcquisitionMetadata>
                     :   </UserArea>
                     : </ClipMain>
                     :
   Duration: 00:02:49.00, start: 0.000000, bitrate: 26146 kb/s
   Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), 
yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24596 
kb/s, 24 fps, 24 tbr, 24k tbn (default)
     Metadata:
       creation_time   : 2021-01-27T12:28:58.000000Z
       vendor_id       : [0][0][0][0]
       timecode        : 17:30:54:21
   Stream #0:1[0x2](und): Audio: pcm_s16be (twos / 0x736F7774), 48000 
Hz, 2 channels, s16, 1536 kb/s (default)
     Metadata:
       creation_time   : 2021-01-27T12:28:58.000000Z
       vendor_id       : pana
       timecode        : 17:30:54:21
   Stream #0:2[0x3](und): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
     Metadata:
       creation_time   : 2021-01-27T12:28:58.000000Z
       timecode        : 17:30:54:21
[h264 @ 000001e8c4a4fc00] co located POCs unavailable
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
[h264 @ 000001e8c4a4fc00] co located POCs unavailable    0B f=0/0
Terminate batch job (Y/N)?


More information about the ffmpeg-user mailing list