1

I have a sequence of .png files, and I am trying to convert them into a movie. The problem is that when I try and convert it to avi format, ffmpeg says "chunk too big":.

I am running the command:

ffmpeg -f image2 -i images%d.png -vcodec libx264 -preset veryslow -crf 22 -threads 0 output_video.avi

How do I fix it so that I get a movie that works with PowerPoint? I've gone through trying various encoding schemes, and referred to: Lossless universal video format for the initial command.

Log:

fmpeg version 2.7.1 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
libavutil      54. 27.100 / 54. 27.100
libavcodec     56. 41.100 / 56. 41.100
libavformat    56. 36.100 / 56. 36.100
libavdevice    56.  4.100 / 56.  4.100
libavfilter     5. 16.101 /  5. 16.101
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  2.100 /  1.  2.100
libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from 'images%d.png':
Duration: 00:00:12.00, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 927x1152, 25 fps, 25 tbr, 25 tbn, 25 tbc
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fed82138e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7fed82138e00] profile High 4:4:4 Predictive, level 5.0, 4:4:4 8-bit
Output #0, avi, to 'output_video.avi':
Metadata:
ISFT            : Lavf56.36.100
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 927x1152, q=-1--1, 25 fps, 25 tbn, 25 tbc
Metadata:
  encoder         : Lavc56.41.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))

> Press [q] to stop, [?] for help
[png @ 0x7fed82e89e00] chunk too big  92kB time=00:00:07.12 bitrate= 106.2kbits/s    
frame=  299 fps= 61 q=-1.0 Lsize=     202kB time=00:00:11.88 bitrate= 139.1kbits/s    
video:189kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.723067%
[libx264 @ 0x7fed82138e00] frame I:2     Avg QP:17.68  size: 46814
[libx264 @ 0x7fed82138e00] frame P:46    Avg QP:18.10  size:  1270
[libx264 @ 0x7fed82138e00] frame B:251   Avg QP:17.13  size:   166
[libx264 @ 0x7fed82138e00] consecutive B-frames:  0.7%  0.7%  2.0%  6.7%  6.7% 18.1% 18.7% 37.5%  9.0%
[libx264 @ 0x7fed82138e00] mb I  I16..4: 20.3% 59.4% 20.3%
[libx264 @ 0x7fed82138e00] mb P  I16..4:  0.1%  0.1%  0.2%  P16..4:  0.5%  0.1%  0.1%  0.0%  0.0%    skip:99.0%
[libx264 @ 0x7fed82138e00] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8:  1.4%  0.0%  0.0%  direct: 0.0%  skip:98.5%  L0:65.2% L1:34.6% BI: 0.2%
[libx264 @ 0x7fed82138e00] 8x8 transform intra:57.2% inter:5.1%
[libx264 @ 0x7fed82138e00] direct mvs  spatial:97.2% temporal:2.8%
[libx264 @ 0x7fed82138e00] coded y,u,v intra: 12.5% 5.2% 5.1% inter: 0.0% 0.0% 0.0%
[libx264 @ 0x7fed82138e00] i16 v,h,dc,p: 69% 28%  3%  0%
[libx264 @ 0x7fed82138e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 65%  6% 29%  0%  0%  0%  0%  0%  0%
[libx264 @ 0x7fed82138e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 20% 19%  3%  4%  4%  4%  4%  5%
[libx264 @ 0x7fed82138e00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fed82138e00] ref P L0: 53.9%  2.6% 28.5%  5.2%  3.1%  2.8%  1.2%  0.8%  0.5%  0.3%  0.1%  0.2%  0.2%  0.2%  0.2%  0.1%
[libx264 @ 0x7fed82138e00] ref B L0: 42.7% 19.9%  7.0%  5.6%  3.7%  3.7%  2.7%  2.7%  2.1%  2.7%  2.1%  2.2%  1.7%  1.0%  0.2%
[libx264 @ 0x7fed82138e00] ref B L1: 94.7%  5.3%
[libx264 @ 0x7fed82138e00] kb/s:129.51
0

If you need it to be AVI, then try

ffmpeg -f image2 -i images%d.png -vf scale=928x1152,setsar=1 -c:v libx264 -pix_fmt yuv420p -profile:v main -coder 0 -preset veryslow -crf 22 -threads 0 output_video.avi

But try MP4 first

ffmpeg -f image2 -i images%d.png -vf scale=928x1152,setsar=1 -c:v libx264 -pix_fmt yuv420p -profile:v main -coder 0 -preset veryslow -crf 22 -threads 0 output_video.mp4

FFmpeg will assume a framerate of 25 for the image sequence (and thus preserve it in the output). You can change that by adding -framerate N before -i where N is your sequence framerate.

  • Running into issue saying "Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height". Looking into trying to adjust bit rate, rate, width, or height. – and0rsk Jan 13 '16 at 7:36
  • Try revised command. Your dimensions should be multiple of 2. – Gyan Jan 13 '16 at 7:41
  • Well done. This looks like it fixed the problem of the output however. Chunk is still reading too big but the scale set correctly and the -pix_fmt seems to have made a huge difference. Still verifying... – and0rsk Jan 13 '16 at 7:46
  • That chunk error is due to the 179th PNG file, not in the ffmpeg output. – Gyan Jan 13 '16 at 7:50
  • I will award you the answer. Thanks. One quick question: I'm staring at the output and I don't see a single thing about a 179 file. Upon chunk error it produces: [png @ 0x7fed82e89e00] chunk too big 92kB time=00:00:07.12 bitrate= 106.2kbits/s I don't see any 179. How did you know? – and0rsk Jan 13 '16 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.