How to convert first few seconds of a video to multiple output formats using ffmpeg -


i want convert first few seconds (say 5 seconds) of video multiple output formats using ffmpeg.

when use syntax convert whole video, goes ok:
(to simple, left options default)

ffmpeg -i input.flv output1.mp4 output2.avi 

but when trying first 5 seconds using syntax:

ffmpeg -t 5 -i input.flv output1.mp4 output2.avi 

first output file (i.e ouptput1.mp4) ok , 5 seconds length, second (and next outputs, if present) has size of original file.

this ffmpeg prints out on screen.

d:\ffmpeg\bin>ffmpeg -t 5 -i input.flv output1.mp4 output2.avi ffmpeg version n-40301-gc1fe2db copyright (c) 2000-2012 ffmpeg developers   built on may  3 2012 11:40:38 gcc 4.6.3   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass  --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable -libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libope njpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libth eora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable- libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --e nable-zlib   libavutil      51. 49.100 / 51. 49.100   libavcodec     54. 17.101 / 54. 17.101   libavformat    54.  3.100 / 54.  3.100   libavdevice    53.  4.100 / 53.  4.100   libavfilter     2. 72.104 /  2. 72.104   libswscale      2.  1.100 /  2.  1.100   libswresample   0. 11.100 /  0. 11.100   libpostproc    52.  0.100 / 52.  0.100 input #0, flv, 'input.flv':   duration: 00:00:37.00, start: 0.000000, bitrate: 366 kb/s     stream #0:0: video: flv1, yuv420p, 320x240, 300 kb/s, 29.97 tbr, 1k tbn, 1k tbc     stream #0:1: audio: mp3, 22050 hz, mono, s16, 56 kb/s [buffer @ 01de98c0] w:320 h:240 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param:fl ags=2 [buffer @ 01dea4e0] w:320 h:240 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param:fl ags=2 [libx264 @ 02b067a0] using cpu capabilities: mmx2 cache64 [libx264 @ 02b067a0] profile high, level 1.3 [libx264 @ 02b067a0] 264 - core 120 r2164 da19765 - h.264/mpeg-4 avc codec - cop yleft 2003-2012 - 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=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_c ompat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 ightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 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, 'output1.mp4':   metadata:     encoder         : lavf54.3.100     stream #0:0: video: h264 (![0][0][0] / 0x0021), yuv420p, 320x240, q=-1--1, 3 0k tbn, 29.97 tbc     stream #0:1: audio: aac (@[0][0][0] / 0x0040), 22050 hz, mono, s16, 128 kb/s  output #1, avi, 'output2.avi':   metadata:     isft            : lavf54.3.100     stream #1:0: video: mpeg4 (fmp4 / 0x34504d46), yuv420p, 320x240, q=2-31, 200  kb/s, 29.97 tbn, 29.97 tbc     stream #1:1: audio: mp3 (u[0][0][0] / 0x0055), 22050 hz, mono, s16 stream mapping:   stream #0:0 -> #0:0 (flv -> libx264)   stream #0:1 -> #0:1 (mp3 -> libvo_aacenc)   stream #0:0 -> #1:0 (flv -> mpeg4)   stream #0:1 -> #1:1 (mp3 -> libmp3lame) press [q] stop, [?] frame=   48 fps=0.0 q=29.0 q=2.4 size=       8kb time=00:00:00.16 bitrate= 399.6 frame=   62 fps= 59 q=29.0 q=2.4 size=      32kb time=00:00:00.63 bitrate= 408.8 frame=   73 fps= 46 q=29.0 q=3.5 size=      57kb time=00:00:01.00 bitrate= 466.1 frame=  104 fps= 50 q=29.0 q=3.5 size=      87kb time=00:00:02.03 bitrate= 349.7 frame=  134 fps= 52 q=29.0 q=3.6 size=     113kb time=00:00:03.03 bitrate= 303.9 ***frame=  150 fps= 49 q=29.0 q=2.4 size=     126kb time=00:00:03.57 bitrate= 289.3 frame=  150 fps= 42 q=29.0 q=8.8 size=     126kb time=00:00:03.57 bitrate= 289.3 frame=  150 fps= 37 q=29.0 q=6.9 size=     126kb time=00:00:03.57 bitrate= 289.3 frame=  150 fps= 33 q=29.0 q=9.7 size=     126kb time=00:00:03.57 bitrate= 289.3 frame=  150 fps= 29 q=29.0 q=6.0 size=     126kb time=00:00:03.57 bitrate= 289.3 frame=  150 fps= 27 q=29.0 q=11.2 size=     126kb time=00:00:03.57 bitrate= 289.*** frame=  150 fps= 24 q=29.0 lq=11.0 size=     171kb time=00:00:04.93 bitrate= 283 .7kbits/s video:1282kb audio:225kb global headers:0kb muxing overhead -88.650217% [libx264 @ 02b067a0] frame i:1     avg qp:10.27  size:    74 [libx264 @ 02b067a0] frame p:114   avg qp:23.49  size:   727 [libx264 @ 02b067a0] frame b:35    avg qp:29.30  size:   124 [libx264 @ 02b067a0] consecutive b-frames: 68.0%  2.7%  0.0% 29.3% [libx264 @ 02b067a0] mb  i16..4: 100.0%  0.0%  0.0% [libx264 @ 02b067a0] mb p  i16..4:  2.1%  3.2%  0.1%  p16..4: 19.2%  5.1%  3.6%  0.0%  0.0%    skip:66.6% [libx264 @ 02b067a0] mb b  i16..4:  0.2%  0.5%  0.0%  b16..8:  9.6%  1.2%  0.4%  direct: 0.6%  skip:87.4%  l0:46.1% l1:42.5% bi:11.4% [libx264 @ 02b067a0] 8x8 transform intra:51.7% inter:78.4% [libx264 @ 02b067a0] coded y,uvdc,uvac intra: 29.8% 44.5% 10.3% inter: 8.9% 10.3 % 2.2% [libx264 @ 02b067a0] i16 v,h,dc,p: 52% 31% 16%  1% [libx264 @ 02b067a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 25% 45%  1%  0%  1%  0%  1%  3% [libx264 @ 02b067a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 48% 23%  2%  1%  2%  3%  2%  1% [libx264 @ 02b067a0] i8c dc,h,v,p: 54% 26% 16%  3% [libx264 @ 02b067a0] weighted p-frames: y:2.6% uv:0.9% [libx264 @ 02b067a0] ref p l0: 79.8%  7.0%  9.6%  3.6%  0.0% [libx264 @ 02b067a0] ref b l0: 92.5%  6.7%  0.8% [libx264 @ 02b067a0] ref b l1: 96.8%  3.2% [libx264 @ 02b067a0] kb/s:139.51  d:\ffmpeg\bin> 

how correct syntax output files same size?

isn't bug ffmpeg? (note last lines of conversion progress, timestamps same)

thanks in advance.

you need add output options each output:

ffmpeg -i input.flv -t 5 output1.mp4 -t 5 output2.avi 

consider adding additional option output quality--especially avi libx264, if available, default mp4 , default options libx264 sane.

ffmpeg -i input.flv -t 5 output1.mp4 -t 5 -qscale 3 output2.avi 

see ffmpeg: ultimate video , audio manipulation tool more information on -qscale (also called -q:v).


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -