[FFmpeg-user] concatenate png files for different durations?
Spencer Graves
spencer.graves at prodsyse.com
Sun Mar 16 23:48:10 CET 2014
On 3/16/2014 2:45 PM, Lou wrote:
> On Sun, 16 Mar 2014 14:35:54 -0700
> Spencer Graves <spencer.graves at prodsyse.com> wrote:
>
>> Thanks for the reply. Unfortunately, I've been unable so far to
>> make it work. Consider the following:
>>
>>
>> >ffmpeg -y concat -i concat1.txt tst2e.mp4
> Your forgot -f as in:
>
> ffmpeg -y -f concat -i concat1.txt tst2e.mp4
Thanks. That got me past that stupidity.
Now I'm back with my original problem: I'm unable to control the
duration of the individual images. Attached is a toy example, 34 KB
total, that is supposed to play the images as follows:
file tst0.png
duration 1
file tst1.png
duration 6
file tst2.png
duration 1
file tst3.png
duration 3
file tst4.png
duration 1
However, tst0 plays for less than a second, tst1 plays for ~1
second (not 6 as requested), tst2 plays for ~5 seconds (not 1), tst3
plays for ~1 second (not 3), and tst4 runs ~2 seconds, not 1 (on my
Windows 7 machine). Below please find the command that produced the
attached tst2g.mp4 using "concat3.txt" containing the above
file-duration specifications.
Suggestions?
Spencer
p.s. Thanks again very much for the help. Beyond this toy example, I
currently plan to produce 1500 png files and mate them with a 60-second
mp2 audio file at 25 frames per second. If ffmpeg has problems with a
few frames at the beginning and end, the result may not be noticeable.
However, if there is too much variability in the time devoted to each
frame (apart from a few at the start and end), I will have more problems
to solve.
>ffmpeg -y -f concat -i concat3.txt -pix_fmt yuv420p tst2g.mp4
ffmpeg version N-61163-gd1122b7 Copyright (c) 2000-2014 the FFmpeg
developers
built on Mar 7 2014 22:01:29 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca
--enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavp
ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
--enable
-zlib
libavutil 52. 66.101 / 52. 66.101
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.101 / 55. 33.101
libavdevice 55. 11.100 / 55. 11.100
libavfilter 4. 3.100 / 4. 3.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, concat, from 'concat3.txt':
Duration: 00:00:12.00, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: png, pal8, 480x480, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 045be100] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 045be100] profile High, level 3.0
[libx264 @ 045be100] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC
codec - Cop
yleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1
ref=3 deb
lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 m
e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pskip=1 chro
ma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0
decimate=1 i
nterlaced=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=25 scenec
ut=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 'tst2g.mp4':
Metadata:
encoder : Lavf55.33.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021),
yuv420p, 480x48
0, q=-1--1, 12800 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png -> libx264)
Press [q] to stop, [?] for help
frame= 276 fps=0.0 q=-1.0 Lsize= 16kB time=00:00:10.96 bitrate=
12.3kbits
/s dup=271 drop=0
video:12kB audio:0kB subtitle:0 data:0 global headers:0kB muxing
overhead 32.223
881%
[libx264 @ 045be100] frame I:2 Avg QP:20.30 size: 2128
[libx264 @ 045be100] frame P:70 Avg QP:10.40 size: 44
[libx264 @ 045be100] frame B:204 Avg QP:12.67 size: 23
[libx264 @ 045be100] consecutive B-frames: 1.4% 0.0% 0.0% 98.6%
[libx264 @ 045be100] mb I I16..4: 21.0% 74.2% 4.8%
[libx264 @ 045be100] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0%
0.0% 0.0%
0.0% 0.0% skip:99.9%
[libx264 @ 045be100] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3%
0.0% 0.0%
direct: 0.0% skip:99.7% L0:69.7% L1:30.3% BI: 0.0%
[libx264 @ 045be100] 8x8 transform intra:73.8% inter:0.0%
[libx264 @ 045be100] coded y,uvDC,uvAC intra: 2.8% 2.7% 2.6% inter: 0.0%
0.0% 0.
0%
[libx264 @ 045be100] i16 v,h,dc,p: 54% 31% 16% 0%
[libx264 @ 045be100] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 78% 7% 16% 0% 0%
0% 0%
0% 0%
[libx264 @ 045be100] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 51% 22% 16% 1% 1%
2% 2%
1% 2%
[libx264 @ 045be100] i8c dc,h,v,p: 97% 1% 1% 0%
[libx264 @ 045be100] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 045be100] ref P L0: 74.0% 2.0% 24.0%
[libx264 @ 045be100] ref B L0: 33.0% 67.0%
[libx264 @ 045be100] kb/s:8.70
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
--
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph: 408-655-4567
web: www.structuremonitoring.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst0.png
Type: image/png
Size: 2017 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140316/2455b0b0/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst4.png
Type: image/png
Size: 3140 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140316/2455b0b0/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst1.png
Type: image/png
Size: 2056 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140316/2455b0b0/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst2.png
Type: image/png
Size: 3133 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140316/2455b0b0/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst3.png
Type: image/png
Size: 3134 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140316/2455b0b0/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst2g.mp4
Type: video/mp4
Size: 16844 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140316/2455b0b0/attachment.mp4>
More information about the ffmpeg-user
mailing list