[FFmpeg-user] image2 examples missing `-f image2`, can that be right?

Jim DeLaHunt from.ffmpeg-user at jdlh.com
Sun Jan 7 22:55:20 EET 2018


On 2018-01-07 11:01, Moritz Barsnick wrote:

> On Sat, Jan 06, 2018 at 23:08:32 -0800, Jim DeLaHunt wrote:
>> ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
>> ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
>> ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
>>
>> Those examples lack a `-f image2` option. I would expect that option to
>> be there; after all, isn't the image2 format exactly what this section
>> is trying to explain?
> Do the examples work for you or do they not?
I hadn't tried when I asked my question. I used a couple of PNG still 
frames with one of the examples, and sure enough, it works without error 
[2].
> I *believe* the detail that is missed in the documentation is that the
> use of a pattern "implies" the image2 demuxer (or muxer, if used as
> output). Apparently with such a high priority that I can't even open a
> single image named "%03d.jpg" without the image2 demuxer jumping in and
> trying to resolve that pattern. ;-)
>
> In other words: For those three examples, "-f image2" just isn't
> required. It's optional, but pointing that out *might* be nice.
Oh, wow. I think that is significant information, and it should be 
included in the documentation.

On 2018-01-07 11:05, Moritz Barsnick wrote:
> Honestly, when debugging stuff and in doubt, just try it first.

Harrumph. "Just try it first" is practical advice for this project, it 
seems. But I am still unsatisfied with the documentation. My philosophy 
of documentation is that it should be an explanation and a help, not a 
riddle.

I've filed a ticket noting some deficiencies in the documentation, 
including that there's no mention that use of a pattern in an input file 
name implies `-f image2`, and that the examples which lack `-f image2` 
do not point out that this is correct and why it works, and that there 
are no examples which include `-f image2`. See [1].

Thank you for the clarification, Moritz!
       —Jim DeLaHunt, Vancouver, Canada

[1] <https://trac.ffmpeg.org/ticket/6950#ticket>
[2]

% ffmpeg -framerate 10 -i 'blue_%d.png' out.mkv

ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers

   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)

   configuration: --prefix=/opt/local --enable-swscale --enable-avfilter 
--enable-avresample --enable-libmp3lame --enable-libvorbis 
--enable-libopus --enable-librsvg --enable-libtheora 
--enable-libopenjpeg --enable-libmodplug --enable-libvpx 
--enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray 
--enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype 
--enable-libfribidi --disable-indev=jack --enable-opencl 
--disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox 
--enable-sdl2 --mandir=/opt/local/share/man --enable-shared 
--enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm 
--enable-libx265 --enable-gpl --enable-postproc --enable-libx264 
--enable-libxvid

   libavutil      55. 78.100 / 55. 78.100

   libavcodec     57.107.100 / 57.107.100

   libavformat    57. 83.100 / 57. 83.100

   libavdevice    57. 10.100 / 57. 10.100

   libavfilter     6.107.100 /  6.107.100

   libavresample   3.  7.  0 /  3.  7.  0

   libswscale      4.  8.100 /  4.  8.100

   libswresample   2.  9.100 /  2.  9.100

   libpostproc    54.  7.100 / 54.  7.100

Input #0, image2, from 'blue_%d.png':

   Duration: 00:00:00.20, start: 0.000000, bitrate: N/A

     Stream #0:0: Video: png, pal8(pc), 212x318, 10 tbr, 10 tbn, 10 tbc

Stream mapping:

   Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))

Press [q] to stop, [?] for help

[libx264 @ 0x7fe883013c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 
SSE4.2 AVX FMA3 AVX2 LZCNT BMI2

[libx264 @ 0x7fe883013c00] profile High 4:4:4 Predictive, level 1.2, 
4:4:4 8-bit

[libx264 @ 0x7fe883013c00] 264 - core 148 - H.264/MPEG-4 AVC codec - 
Copyleft 2003-2017 - 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=4 threads=10 
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=10 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, matroska, to 'out.mkv':

   Metadata:

     encoder         : Lavf57.83.100

     Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 
212x318, q=-1--1, 10 fps, 1k tbn, 10 tbc

     Metadata:

       encoder         : Lavc57.107.100 libx264

     Side data:

       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1

frame=    2 fps=0.0 q=-1.0 Lsize=       2kB time=00:00:00.10 bitrate= 
143.7kbits/s speed=3.06x

video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB 
muxing overhead: 78.543304%

[libx264 @ 0x7fe883013c00] frame I:1     Avg QP:11.06  size:   148

[libx264 @ 0x7fe883013c00] frame P:1     Avg QP:20.45  size:   193

[libx264 @ 0x7fe883013c00] mb I  I16..4:  0.7% 98.2%  1.1%

[libx264 @ 0x7fe883013c00] mb P  I16..4:  0.0%  0.0%  0.7%  P16..4:  
0.7%  0.0%  0.0%  0.0%  0.0%    skip:98.6%

[libx264 @ 0x7fe883013c00] 8x8 transform intra:97.5% inter:0.0%

[libx264 @ 0x7fe883013c00] coded y,u,v intra: 0.7% 0.7% 0.4% inter: 0.3% 
0.3% 0.2%

[libx264 @ 0x7fe883013c00] i16 v,h,dc,p:  0% 50% 50%  0%

[libx264 @ 0x7fe883013c00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46%  0% 54%  
0%  0%  0%  0%  0%  0%

[libx264 @ 0x7fe883013c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38%  9% 46%  
4%  0%  1%  1%  1%  0%

[libx264 @ 0x7fe883013c00] Weighted P-Frames: Y:0.0% UV:0.0%

[libx264 @ 0x7fe883013c00] kb/s:13.64

% ls -l out.mkv
-rw-r--r--  1 myuser  staff  1814  7 Jan 11:41 out.mkv


-- 
     --Jim DeLaHunt, jdlh at jdlh.com     http://blog.jdlh.com/ 
(http://jdlh.com/)
       multilingual websites consultant

       355-1027 Davie St, Vancouver BC V6E 4L2, Canada
          Canada mobile +1-604-376-8953



More information about the ffmpeg-user mailing list