[FFmpeg-user] Guidance on converting images to video

Joseph L. Casale jcasale at activenetwerx.com
Sun Oct 11 00:24:26 CEST 2015


Hi Lou,

>> With some of my attempts to encode with compression, the output
>> becomes composed of segments which simply stall as if it were skipping
>> frames, whereas the following seems like a start:
>
>I don't quite understand what you are saying.

On several of my attempts where images were captured from
people walking, after encoding with compression I would see
several seconds of the same frame, then a sudden jump. It
was very choppy when using VLC to play back. Based on the
reply from Moritz, I tried Windows Media Player and it was
ok (sorry about missing the boat on that one). So, final cli used
below with the output is actually good.

>>   ffmpeg -framerate 5 -i %05d-capture.jpg -c:v libx264 -preset veryfast
>>   output.mp4
>
> Complete console output missing.

Ugh, I realize I pasted the wrong syntax that I had used. This
produced quality that was too low.

The output from the following attempt produced decent results but
this takes too long and obviously I am doing something wrong if VLC
can't play it and only Windows Media Player seems to play it smoothly?
Is there a codec more suitable for converting JPEG source most efficiently
to a video. I do not have an existing codec requirement, I can use
anything that will help. My goal would be to get processing down to
2 minutes with decent quality. In short order we will be upping the
resolution which will only make things worse.

Thanks a lot for the help,
jlc


# time ffmpeg -y -framerate 5 -i %05d-capture.jpg -codec libx264 /tmp/out4.mp4
ffmpeg version 2.1.5 Copyright (c) 2000-2014 the FFmpeg developers
  built on Feb 14 2015 15:55:55 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --disable-htmlpages --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from '%05d-capture.jpg':
  Duration: 00:09:59.40, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 352x240 [SAR 1:1 DAR 22:15], 5 fps, 5 tbr, 5 tbn, 5 tbc
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x1bc3e80] using SAR=1/1
[libx264 @ 0x1bc3e80] using cpu capabilities: none!
[libx264 @ 0x1bc3e80] profile High, level 1.2
[libx264 @ 0x1bc3e80] 264 - core 138 r2363 c628e3b - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - 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=12 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=5 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 '/tmp/out4.mp4':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p, 352x240 [SAR 1:1 DAR 22:15], q=-1--1, 10240 tbn, 5 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> libx264)
Press [q] to stop, [?] for help
frame= 2997 fps= 68 q=-1.0 Lsize=   19630kB time=00:09:59.00 bitrate= 268.5kbits/s
video:19594kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.184510%
[libx264 @ 0x1bc3e80] frame I:12    Avg QP:16.18  size: 32926
[libx264 @ 0x1bc3e80] frame P:1479  Avg QP:18.99  size: 10129
[libx264 @ 0x1bc3e80] frame B:1506  Avg QP:26.17  size:  3113
[libx264 @ 0x1bc3e80] consecutive B-frames:  0.7% 95.8%  3.5%  0.0%
[libx264 @ 0x1bc3e80] mb I  I16..4:  0.0% 99.4%  0.6%
[libx264 @ 0x1bc3e80] mb P  I16..4:  0.0%  0.3%  0.0%  P16..4: 23.3% 30.6% 45.8%  0.0%  0.0%    skip: 0.0%
[libx264 @ 0x1bc3e80] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 14.0% 13.8% 16.9%  direct:23.3%  skip:32.0%  L0:52.1% L1:20.9% BI:27.0%
[libx264 @ 0x1bc3e80] 8x8 transform intra:96.0% inter:98.5%
[libx264 @ 0x1bc3e80] coded y,uvDC,uvAC intra: 99.9% 97.2% 76.1% inter: 71.4% 78.4% 52.0%
[libx264 @ 0x1bc3e80] i16 v,h,dc,p:  0%  0% 100%  0%
[libx264 @ 0x1bc3e80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 17% 25%  3%  9%  5% 12%  4% 10%
[libx264 @ 0x1bc3e80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 15% 16%  4% 11%  7% 11%  9% 10%
[libx264 @ 0x1bc3e80] i8c dc,h,v,p: 58% 20% 15%  8%
[libx264 @ 0x1bc3e80] Weighted P-Frames: Y:0.4% UV:0.0%
[libx264 @ 0x1bc3e80] ref P L0: 33.5%  7.4% 32.4% 26.6%  0.1%
[libx264 @ 0x1bc3e80] ref B L0: 56.3% 43.2%  0.5%
[libx264 @ 0x1bc3e80] ref B L1: 98.4%  1.6%
[libx264 @ 0x1bc3e80] kb/s:267.78

real    0m44.273s
user    4m50.858s
sys     0m4.477s


More information about the ffmpeg-user mailing list