82051

ffmpeg slideshow video from images creating empty mp4

Question:

I'm trying to use ffmpeg to create an .mp4 from a set of .JPG files. This is the ffmpeg line I'm using:

ffmpeg -framerate 1/5 -i image-%03d.JPG output.mp4

which returns:

ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 5.2.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib 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 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 [mjpeg @ 04ee8ca0] Changeing bps to 8 Input #0, image2, from 'image-%03d.JPG': Duration: 00:01:05.00, start: 0.000000, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 4608x3072, 0.20 tbr, 0.20 tbn, 0.20 tbc File 'output.mp4' already exists. Overwrite ? [y/N] y No pixel format specified, yuvj422p for H.264 encoding chosen. Use -pix_fmt yuv420p for compatibility with outdated media players. [libx264 @ 04ef4a40] frame MB size (288x192) > level limit (36864) [libx264 @ 04ef4a40] DPB size (4 frames, 221184 mbs) > level limit (3 frames, 184320 mbs) [libx264 @ 04ef4a40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2 [libx264 @ 04ef4a40] profile High 4:2:2, level 5.2, 4:2:2 8-bit [libx264 @ 04ef4a40] 264 - core 148 r2638 7599210 - 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=1 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 'output.mp4': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj422p(pc), 4608x3072, q=-1--1, 0.20 fps, 16384 tbn, 0.20 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= 13 fps=0.9 q=-1.0 Lsize= 18249kB time=00:00:55.00 bitrate=2718.2kbits/s video:18249kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.005057% [libx264 @ 04ef4a40] frame I:1 Avg QP:13.94 size:1564617 [libx264 @ 04ef4a40] frame P:12 Avg QP:13.68 size:1426766 [libx264 @ 04ef4a40] mb I I16..4: 2.6% 79.2% 18.2% [libx264 @ 04ef4a40] mb P I16..4: 2.2% 82.9% 14.6% P16..4: 0.1% 0.0% 0.0% 0.0% 0.0% skip: 0.2% [libx264 @ 04ef4a40] 8x8 transform intra:82.9% inter:79.9% [libx264 @ 04ef4a40] coded y,uvDC,uvAC intra: 95.0% 80.5% 67.2% inter: 33.6% 27.6% 11.4% [libx264 @ 04ef4a40] i16 v,h,dc,p: 16% 9% 5% 69% [libx264 @ 04ef4a40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 20% 24% 6% 8% 6% 8% 6% 10% [libx264 @ 04ef4a40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 22% 10% 8% 11% 8% 11% 6% 9% [libx264 @ 04ef4a40] i8c dc,h,v,p: 52% 20% 20% 7% [libx264 @ 04ef4a40] Weighted P-Frames: Y:8.3% UV:8.3% [libx264 @ 04ef4a40] ref P L0: 64.6% 9.0% 11.8% 5.8% 8.8% [libx264 @ 04ef4a40] kb/s:2299.79

and a output.mp4. When I run this file, it ends immediately without showing any images. I don't see any errors or problems in the code, so I'm not sure what I'm doing wrong. Do I need to increase the video framerate or something else?

Answer1:

Some players have troubles with low framerates. Also, the pixel format may not be supported by the player.

Use

ffmpeg -framerate 1/5 -i image-%03d.JPG -r 5 -pix_fmt yuv420p output.mp4

Recommend

  • Convert all images in directory to .mp4 using ffmpeg and a timestamp order
  • Gstreamer does not sink to named pipe
  • opencv - videowriter control bitrate
  • How change a number to Scientific Number and get the minimum value (Scientific Number format) [dupli
  • Android video not valid for streaming
  • m2crypto: python 2.7 compatibility and which version of OpenSSL to use?
  • How to set up a java program in IDEone
  • why does std::numeric_limits::min() differ in behavior when streamed to output with different functi
  • AngularJS ng-option get index
  • Lib/API for create small gif from video?
  • Stream webcam via. Wowza streaming server
  • Access web cam using vb.net
  • Javascript fade in fade out div with youtube video
  • What RDF patterns can be used to represent components and the percentage they make up?
  • static pre-calculation optimization in clang
  • Prevent OutOfMemoryException With AForge and Graphics.FromImage.DrawImage
  • “Movie Format Not Supported” on iPhone with YouTube player in a WebView
  • How to make local USB port to work with Azure virtual machine
  • How to store pointer to S3 objects in Amazon SimpleDB?
  • Open Video file in VLC through Python
  • Disable Application from sleeping in Windows 8 Metro
  • InputDispatcher Error
  • Background image does not show on iPhone/iPad
  • How to create a jQuery price slider
  • iPhone: 5 seconds video capture
  • Publishing HTML Field Control Converts Relative URL to Absolute URL
  • Youtube Video Player Fullscreen click event
  • Add a div to replace Video after Video Plays Through
  • Are there any supported high bit-depth video or image formats in DirectShow
  • Converting raw frames into webm live stream
  • Java: java.util.ConcurrentModificationException
  • Boost binary serialization doesn't work occasionally. The parsed data is corrupted sometimes
  • Appium MobileElement swipe returns unknown server error
  • SIP API media codecs
  • Streaming screenshots over WebRTC as a video stream from iOS
  • Building Qt project for C++11 standard
  • Play WS (2.2.1): post/put large request
  • Bad request using file_get_contents for PUT request in PHP
  • RestKit - RKRequestDelegate does not exist
  • Memory offsets in inline assembly