Search code examples
imagevideoffmpegmp4prezi

Images to video in Prezi format


I have five *.jpeg image files: m01.jpeg to m05.jpeg.

I'd like to make a video of a sequence of these five images and upload it to Prezi to use in a presentation.

FFMPEG seems to be the tool for the job here. I am generating a video using the following command:

ffmpeg -r 2 -i m%02d.jpeg -pix_fmt yuvj420p myvideo.mp4

This generates a video that I can play fine locally. Unfortunately, when I try to upload the video to Prezi, I always get the following error...

"Technical details: id: 2110 the reason is: Event [Event type="stateChange" bubbles=false cancelable=false eventPhase=2]"

...which isn't particularly informative.

If I upload a sample MP4 from the web to Prezi, it works fine.

My question: Does anybody know what I need to give FFMPEG as parameters here so that it will generate a Prezi-compatible video from these images?

EDIT: As requested, here's the complete console output for FFMPEG. Unfortunately there are no glaring warnings or errors that I can see.

sam@x220sm:~/tmp$ ffmpeg -r 2 -i m%02d.jpeg -pix_fmt yuvj420p myvideo.mp4
ffmpeg version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
  configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mjpeg @ 0xd8e620] Changeing bps to 8
Input #0, image2, from 'm%02d.jpeg':
  Duration: 00:00:00.20, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 800x600 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0xd910c0] using SAR=1/1
[libx264 @ 0xd910c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0xd910c0] profile High, level 3.1
[libx264 @ 0xd910c0] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'myvideo.mp4':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 800x600 [SAR 1:1 DAR 4:3], q=-1--1, 2 fps, 16384 tbn, 2 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=    5 fps=0.0 q=-1.0 Lsize=    1170kB time=00:00:01.50 bitrate=6390.8kbits/s    
video:1169kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.073660%
[libx264 @ 0xd910c0] frame I:1     Avg QP:25.54  size:289842
[libx264 @ 0xd910c0] frame P:4     Avg QP:20.54  size:226716
[libx264 @ 0xd910c0] mb I  I16..4:  0.0%  0.2% 99.8%
[libx264 @ 0xd910c0] mb P  I16..4: 16.8% 23.8% 59.4%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip: 0.0%
[libx264 @ 0xd910c0] 8x8 transform intra:19.1% inter:0.0%
[libx264 @ 0xd910c0] coded y,uvDC,uvAC intra: 84.5% 85.6% 79.2% inter: 50.0% 100.0% 100.0%
[libx264 @ 0xd910c0] i16 v,h,dc,p: 95%  1%  4%  0%
[libx264 @ 0xd910c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  6%  8% 38%  7%  7%  6% 11%  9%  9%
[libx264 @ 0xd910c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8%  9% 23%  9%  9%  8% 14%  9% 11%
[libx264 @ 0xd910c0] i8c dc,h,v,p: 72% 10%  5% 13%
[libx264 @ 0xd910c0] Weighted P-Frames: Y:50.0% UV:50.0%
[libx264 @ 0xd910c0] ref P L0: 50.0% 50.0%
[libx264 @ 0xd910c0] kb/s:3829.46

Solution

  • Make sure to use a "standard" frame rate and a compatible chroma subsampling scheme:

    ffmpeg -framerate 2 -i m%02d.jpeg -r 25 -pix_fmt yuv420p -profile:v baseline -movflags +faststart output.mp4
    

    Options:

    • -framerate 2 Set input frame rate to 2. Note that the image demuxer uses -framerate instead of -r.

    • -r 25 Set the output frame rate to 25.

    • -pix_fmt yuv420p Ensures 4:2:0 chroma subsampling.

    • -profile:v baseline Use Baseline H.264 profile. Possibly not needed for Prezi.

    • -movflags +faststart For playback via progressive download–allows video to begin playback before file is completely downloaded. Possibly not needed for Prezi, but does not harm anything to include it.