Ffmpeg can't find codec parameters while converting images to video

7,640

Typo

Your inputs are named frame1.jpg, frame2.jpg, etc, but you have a typo in your command.

Change frame-*.jpg to frame*.jpg.

Zero padding

Because there is no zero padding in the file names (frame1.jpg vs frame01.jpg) the frame order may be incorrect when using the glob pattern. You can see the same effect using ls to view the files in the directory. To avoid this use the default sequence pattern instead:

ffmpeg -framerate 24 -i frame%01d.jpg output.avi

-f image2 is not needed.

Unrelated, but building with --disable-x86asm is not recommended as it may cause slowness.

Share:
7,640

Related videos on Youtube

R S
Author by

R S

Updated on September 18, 2022

Comments

  • R S
    R S over 1 year

    I tried to use ffmpeg both from repos and from github. I tried this (also tried with -c:v some_codec ):

    ffmpeg -f image2 -framerate 24 -pattern_type glob -i 'frame-*.jpg' -s WxH 'foo.avi'
    ffmpeg version N-90232-g0645698ecc Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 7 (Ubuntu 7.2.0-8ubuntu3.2)
      configuration: --disable-x86asm
      libavutil      56.  8.100 / 56.  8.100
      libavcodec     58. 13.102 / 58. 13.102
      libavformat    58. 10.100 / 58. 10.100
      libavdevice    58.  2.100 / 58.  2.100
      libavfilter     7. 12.100 /  7. 12.100
      libswscale      5.  0.102 /  5.  0.102
      libswresample   3.  0.101 /  3.  0.101
    [image2 @ 0x5579541a5780] Could not open file : frame-*.jpg
    [image2 @ 0x5579541a5780] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, image2, from 'frame-*.jpg':
      Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
        Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), 24 tbr, 24 tbn, 24 tbc
    Output #0, avi, to 'foo.avi':
    Output file #0 does not contain any stream
    

    Input images named like that:

    frame1.jpg frame2.jpg  ...
    
    • llogan
      llogan about 6 years
      Show the actual ffmpeg command you used and the complete console output.
    • R S
      R S about 6 years
      @LordNeckbeard done.
    • llogan
      llogan about 6 years
      What are the input files named? It's not finding them. Also, -s WxH is invalid: with -s you need to provide numbers, such as -s 1280x720 (or omit -s).
    • R S
      R S about 6 years
      @LordNeckbeard updated
    • R S
      R S about 6 years
      @LordNeckbeard it seems it works now, I had to write frame* instead of frame-*.