[FFmpeg-user] single frame duration with concat

lorenzo angeli lorenzo.angeli at efestolab.uk
Fri Jun 5 10:24:00 CEST 2015


Hi Sorry for going back to this, but there's a behaviour I'm not quite
getting.

if I set the filter as : [in]trim=start_frame=0:end_frame=1[out]
it doesn't insert anything at the beginning.

if I set the filter as : [in]trim=start_frame=0:end_frame=2[out]

It does insert two frames at the beginning.... rather than 1 as I would
expect.
Is there anything I'm doing wrong here ?

Thanks.
L.

here the full output with end_frame=1:

ffmpeg -thread_queue_size 512 -hwaccel auto -threads 0 -y -start_number 1
-i /home/efesto/Desktop/frames/foo.%4d.exr -t 1 -loop 1 -i
/home/efesto/devel/efesto/efesto-submit/resource/profile/default.jpg -i
/home/efesto/devel/efesto/efesto-submit/resource/profile/efesto_logo.png
-c:v libx264 -crf 18 -preset slow -strict -2 -movflags faststart -pix_fmt
yuv420p -filter_complex
"[0:v]null,scale=1920:1080[clip];[1:v]null,scale=1920:1080[slate];[slate]trim=start_frame=0:end_frame=1[slate];[slate][clip]concat=n=2:v=1,
scale=1920:1080, fps=24.0, setdar=16:9[v]" -map [v]
/home/efesto/Desktop/out.mov
ffmpeg version N-72356-g8aa9853 Copyright (c) 2000-2015 the FFmpeg
developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/home/efesto/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/efesto/ffmpeg_build/include
--extra-ldflags=-L/home/efesto/ffmpeg_build/lib --bindir=/home/efesto/bin
--enable-gpl --enable-libass --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264
--enable-nonfree
  libavutil      54. 25.100 / 54. 25.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 33.101 / 56. 33.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from '/home/efesto/Desktop/frames/foo.%4d.exr':
  Duration: 00:00:02.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: exr, rgb48le, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps,
25 tbr, 25 tbn, 25 tbc
Input #1, image2, from
'/home/efesto/devel/efesto/efesto-submit/resource/profile/default.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 52884 kb/s
    Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #2, png_pipe, from
'/home/efesto/devel/efesto/efesto-submit/resource/profile/efesto_logo.png':
  Duration: N/A, bitrate: N/A
    Stream #2:0: Video: png, rgba(pc), 200x221 [SAR 3543:3543 DAR 200:221],
25 tbr, 25 tbn, 25 tbc
[Parsed_setdar_8 @ 0x214dd20] num:den syntax is deprecated, please use
num/den or named options instead
[swscaler @ 0x21003a0] deprecated pixel format used, make sure you did set
range correctly
[libx264 @ 0x2149ca0] using SAR=1/1
[libx264 @ 0x2149ca0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x2149ca0] profile High, level 5.0
[libx264 @ 0x2149ca0] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1
ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 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=2
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3
weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40
intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mov, to '/home/efesto/Desktop/out.mov':
  Metadata:
    encoder         : Lavf56.33.101
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
    Metadata:
      encoder         : Lavc56.41.100 libx264
Stream mapping:
  Stream #0:0 (exr) -> null
  Stream #1:0 (mjpeg) -> null
  setdar -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[exr @ 0x4bc0700] Found more than one compression attribute.
    Last message repeated 9 times
[exr @ 0x4bc0700] Found more than one compression attribute.itrate=N/A
    Last message repeated 14 times
[exr @ 0x4bc0700] Found more than one compression attribute.itrate=N/A
    Last message repeated 13 times
[exr @ 0x4bc0700] Found more than one compression attribute.itrate=N/A
    Last message repeated 1 times
[mov @ 0x214f9c0] Starting second pass: moving the moov atom to the
beginning of the file
frame=   48 fps= 18 q=-1.0 Lsize=      61kB time=00:00:01.91 bitrate=
260.0kbits/s
video:59kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 2.240607%
[libx264 @ 0x2149ca0] frame I:1     Avg QP:11.93  size:  6381
[libx264 @ 0x2149ca0] frame P:20    Avg QP:17.14  size:  1537
[libx264 @ 0x2149ca0] frame B:27    Avg QP:22.48  size:   856
[libx264 @ 0x2149ca0] consecutive B-frames: 18.7% 12.5% 18.7% 50.0%
[libx264 @ 0x2149ca0] mb I  I16..4: 66.1% 23.2% 10.7%
[libx264 @ 0x2149ca0] mb P  I16..4:  0.1%  0.1%  0.3%  P16..4:  1.2%  0.3%
0.7%  0.0%  0.0%    skip:97.4%
[libx264 @ 0x2149ca0] mb B  I16..4:  0.0%  0.0%  0.1%  B16..8:  1.1%  0.4%
0.1%  direct: 0.0%  skip:98.3%  L0:53.9% L1:43.8% BI: 2.3%
[libx264 @ 0x2149ca0] 8x8 transform intra:22.2% inter:10.1%
[libx264 @ 0x2149ca0] direct mvs  spatial:81.5% temporal:18.5%
[libx264 @ 0x2149ca0] coded y,uvDC,uvAC intra: 5.1% 1.8% 1.5% inter: 0.2%
0.0% 0.0%
[libx264 @ 0x2149ca0] i16 v,h,dc,p: 37% 61%  2%  0%
[libx264 @ 0x2149ca0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 44% 36% 10%  9%  0%
0%  0%  0%  0%
[libx264 @ 0x2149ca0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 62% 15% 16%  2%  1%
1%  1%  2%  1%
[libx264 @ 0x2149ca0] i8c dc,h,v,p: 24% 73%  2%  0%
[libx264 @ 0x2149ca0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x2149ca0] ref P L0: 59.8%  0.7% 17.1%  8.0%  5.3%  9.1%
[libx264 @ 0x2149ca0] ref B L0: 52.9% 24.3% 14.8%  8.0%
[libx264 @ 0x2149ca0] ref B L1: 85.1% 14.9%
[libx264 @ 0x2149ca0] kb/s:240.92



and this is for end_frame set to 2:

ffmpeg -thread_queue_size 512 -hwaccel auto -threads 0 -y -start_number 1
-i /home/efesto/Desktop/frames/foo.%4d.exr -t 1 -loop 1 -i
/home/efesto/devel/efesto/efesto-submit/resource/profile/default.jpg -i
/home/efesto/devel/efesto/efesto-submit/resource/profile/efesto_logo.png
-c:v libx264 -crf 18 -preset slow -strict -2 -movflags faststart -pix_fmt
yuv420p -filter_complex
"[0:v]null,scale=1920:1080[clip];[1:v]null,scale=1920:1080[slate];[slate]trim=start_frame=0:end_frame=2[slate];[slate][clip]concat=n=2:v=1,
scale=1920:1080, fps=24.0, setdar=16:9[v]" -map [v]
/home/efesto/Desktop/out.mov
ffmpeg version N-72356-g8aa9853 Copyright (c) 2000-2015 the FFmpeg
developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/home/efesto/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/efesto/ffmpeg_build/include
--extra-ldflags=-L/home/efesto/ffmpeg_build/lib --bindir=/home/efesto/bin
--enable-gpl --enable-libass --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264
--enable-nonfree
  libavutil      54. 25.100 / 54. 25.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 33.101 / 56. 33.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from '/home/efesto/Desktop/frames/foo.%4d.exr':
  Duration: 00:00:02.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: exr, rgb48le, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps,
25 tbr, 25 tbn, 25 tbc
Input #1, image2, from
'/home/efesto/devel/efesto/efesto-submit/resource/profile/default.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 52884 kb/s
    Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #2, png_pipe, from
'/home/efesto/devel/efesto/efesto-submit/resource/profile/efesto_logo.png':
  Duration: N/A, bitrate: N/A
    Stream #2:0: Video: png, rgba(pc), 200x221 [SAR 3543:3543 DAR 200:221],
25 tbr, 25 tbn, 25 tbc
[Parsed_setdar_8 @ 0x28d1d20] num:den syntax is deprecated, please use
num/den or named options instead
[swscaler @ 0x28843a0] deprecated pixel format used, make sure you did set
range correctly
[libx264 @ 0x28cdca0] using SAR=1/1
[libx264 @ 0x28cdca0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x28cdca0] profile High, level 5.0
[libx264 @ 0x28cdca0] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1
ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 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=2
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3
weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40
intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mov, to '/home/efesto/Desktop/out.mov':
  Metadata:
    encoder         : Lavf56.33.101
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
    Metadata:
      encoder         : Lavc56.41.100 libx264
Stream mapping:
  Stream #0:0 (exr) -> null
  Stream #1:0 (mjpeg) -> null
  setdar -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[exr @ 0x33d9560] Found more than one compression attribute.
    Last message repeated 7 times
[exr @ 0x33d9560] Found more than one compression attribute.itrate=N/A
    Last message repeated 14 times
[exr @ 0x33d9560] Found more than one compression attribute.itrate=N/A
    Last message repeated 13 times
[exr @ 0x33d9560] Found more than one compression attribute.itrate=N/A
    Last message repeated 3 times
[mov @ 0x28d39c0] Starting second pass: moving the moov atom to the
beginning of the file
frame=   50 fps= 17 q=-1.0 Lsize=     233kB time=00:00:02.00 bitrate=
954.5kbits/s
video:232kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.582126%
[libx264 @ 0x28cdca0] frame I:2     Avg QP:13.96  size: 91258
[libx264 @ 0x28cdca0] frame P:20    Avg QP:18.39  size:  1499
[libx264 @ 0x28cdca0] frame B:28    Avg QP:22.54  size:   859
[libx264 @ 0x28cdca0] consecutive B-frames: 20.0% 12.0% 12.0% 56.0%
[libx264 @ 0x28cdca0] mb I  I16..4: 39.0% 49.4% 11.6%
[libx264 @ 0x28cdca0] mb P  I16..4:  0.1%  0.1%  0.2%  P16..4:  2.1%  0.3%
0.2%  0.0%  0.0%    skip:97.0%
[libx264 @ 0x28cdca0] mb B  I16..4:  0.1%  0.0%  0.1%  B16..8:  1.2%  0.4%
0.1%  direct: 0.0%  skip:98.2%  L0:50.1% L1:48.0% BI: 1.9%
[libx264 @ 0x28cdca0] 8x8 transform intra:47.4% inter:20.0%
[libx264 @ 0x28cdca0] direct mvs  spatial:82.1% temporal:17.9%
[libx264 @ 0x28cdca0] coded y,uvDC,uvAC intra: 46.8% 20.7% 7.0% inter: 0.2%
0.3% 0.0%
[libx264 @ 0x28cdca0] i16 v,h,dc,p: 44% 47%  3%  5%
[libx264 @ 0x28cdca0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  5%  6% 16% 16% 12%
12% 12%  9% 12%
[libx264 @ 0x28cdca0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 10% 10%  9% 10%
7%  9%  8% 12%
[libx264 @ 0x28cdca0] i8c dc,h,v,p:  7% 77%  9%  7%
[libx264 @ 0x28cdca0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x28cdca0] ref P L0: 67.3%  0.2% 13.1%  6.0%  7.6%  5.8%
[libx264 @ 0x28cdca0] ref B L0: 51.9% 24.8% 15.9%  7.3%
[libx264 @ 0x28cdca0] ref B L1: 89.7% 10.3%
[libx264 @ 0x28cdca0] kb/s:908.33


More information about the ffmpeg-user mailing list