change dimensions videos format via ffmpeg-php to a custom size without stretch -
i use code convert , change dimensions videos format each other...
exec("ffmpeg -i $sourcepath -ar 22050 -ab 32 -f flv -s 1200x800 $uploadpath1 2>&1")
but have poblem...
for example if input video dimensions 600 * 300...output video dimensions 1200*600 without stretch...just black background 1200*600 video inside it...
if u did not underestand mean...i attached pic question explain mean better...
if want embedd small video input in larger video, can use pad
filter in below example put 720x404 video in 1280x720 video top left pixel @ (0,72)
ffmpeg -i in.mp4 -vf pad=1280:720:0:72 out.mp4 ffmpeg version n-58949-g0e575c2 copyright (c) 2000-2013 ffmpeg developers built on dec 9 2013 22:06:49 gcc 4.8.2 (gcc) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 52. 58.100 / 52. 58.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 92.100 / 3. 92.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 libpostproc 52. 3.100 / 52. 3.100 input #0, mov,mp4,m4a,3gp,3g2,mj2, 'in.mp4': metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : lavf54.22.100 duration: 00:05:00.01, start: 0.000000, bitrate: 5250 kb/s stream #0:0(eng): video: h264 (main) (avc1 / 0x31637661), yuv420p(tv), 720x404 [sar 1:1 dar 180:101], 5020 kb/s, 29.97 fps, 29.97 tbr, 29970 tbn, 59.94 tbc (default) metadata: handler_name : videohandler stream #0:1(eng): audio: aac (mp4a / 0x6134706d), 48000 hz, stereo, fltp, 221 kb/s (default) metadata: handler_name : soundhandler file 'out.mp4' exists. overwrite ? [y/n] y [libx264 @ 000000000030f480] using sar=1/1 [libx264 @ 000000000030f480] using cpu capabilities: mmx2 sse2fast ssse3 sse4.2 avx [libx264 @ 000000000030f480] profile high, level 3.1 [libx264 @ 000000000030f480] 264 - core 140 r2377 1ca7bb9 - 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=6 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=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, 'out.mp4': metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : lavf55.22.100 stream #0:0(eng): video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [sar 1:1 dar 16:9], q=-1--1, 11988 tbn, 29.97 tbc (default) metadata: handler_name : videohandler stream #0:1(eng): audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 hz, stereo, s16, 128 kb/s (default) metadata: handler_name : soundhandler stream mapping: stream #0:0 -> #0:0 (h264 -> libx264) stream #0:1 -> #0:1 (aac -> libvo_aacenc)
Comments
Post a Comment