#!/usr/bin/env bash
#sourcePath="/D/视频/2017年51CTO学院SpringCloud公开课/"
sourcePath="/d/"
targetPath=/d/app/ffmpeg-20190330-5282cba-win64-static/bin/
cd ${sourcePath}
for item in `ls $*|tr " " "?_"`
do
item=`tr "?_" " " <<<${item}`
declare len=${#item};
declare type=${item:${len}-3:${len}}
if [[ ${type} = "avi" ]]
then
echo "$sourcePath/$item"
# cp "${sourcePath}/$item" ${targetPath}
ffmpeg -i "${targetPath}/$item" "${item/%avi/mp4}"
fi
done
"C:\Program Files\Git\bin\bash.exe" D:\work\bash\src\demo1.sh
/d//02 能力提升-下载.avi
ffmpeg version N-93485-g5282cbae61 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20190212
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 26.100 / 56. 26.100
libavcodec 58. 47.106 / 58. 47.106
libavformat 58. 26.101 / 58. 26.101
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 48.100 / 7. 48.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, avi, from 'D:/app/ffmpeg-20190330-5282cba-win64-static/bin/02 能力提升-下载.avi':
Metadata:
encoder : Lavf58.17.101
Duration: 00:36:42.63, start: 0.000000, bitrate: 502 kb/s
Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 1920x1080, 360 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000220f4eb0280] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000220f4eb0280] profile Progressive High, level 4.0, 4:2:0, 8-bit
[libx264 @ 00000220f4eb0280] 264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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=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=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, to '02 能力提升-下载.mp4':
Metadata:
encoder : Lavf58.26.101
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080, q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
Metadata:
encoder : Lavc58.47.106 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.47.106 aac
More than 1000 frames duplicated
More than 10000 frames duplicated
frame=66015 fps=131 q=-1.0 Lsize= 151318kB time=00:36:42.60 bitrate= 562.8kbits/s dup=32970 drop=0 speed=4.37x
video:114562kB audio:34391kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.587666%
[libx264 @ 00000220f4eb0280] frame I:278 Avg QP:14.14 size:195387
[libx264 @ 00000220f4eb0280] frame P:16734 Avg QP:18.76 size: 3227
[libx264 @ 00000220f4eb0280] frame B:49003 Avg QP:31.39 size: 183
[libx264 @ 00000220f4eb0280] consecutive B-frames: 0.7% 0.9% 0.6% 97.9%
[libx264 @ 00000220f4eb0280] mb I I16..4: 46.6% 22.1% 31.2%
[libx264 @ 00000220f4eb0280] mb P I16..4: 0.6% 0.5% 0.4% P16..4: 0.9% 0.1% 0.1% 0.0% 0.0% skip:97.4%
[libx264 @ 00000220f4eb0280] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.7% 0.0% 0.0% direct: 0.0% skip:99.3% L0:41.3% L1:58.4% BI: 0.4%
[libx264 @ 00000220f4eb0280] 8x8 transform intra:27.0% inter:49.8%
[libx264 @ 00000220f4eb0280] coded y,uvDC,uvAC intra: 27.2% 31.9% 26.4% inter: 0.1% 0.2% 0.1%
[libx264 @ 00000220f4eb0280] i16 v,h,dc,p: 55% 44% 0% 0%
[libx264 @ 00000220f4eb0280] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 56% 16% 25% 1% 1% 1% 1% 1% 1%
[libx264 @ 00000220f4eb0280] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 37% 10% 3% 4% 4% 4% 3% 5%
[libx264 @ 00000220f4eb0280] i8c dc,h,v,p: 62% 25% 11% 2%
[libx264 @ 00000220f4eb0280] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000220f4eb0280] ref P L0: 76.4% 8.9% 11.3% 3.4% 0.0%
[libx264 @ 00000220f4eb0280] ref B L0: 69.1% 29.0% 1.8%
[libx264 @ 00000220f4eb0280] ref B L1: 96.4% 3.6%
[libx264 @ 00000220f4eb0280] kb/s:426.06
[aac @ 00000220f4eaf380] Qavg: 283.611
Process finished with exit code 0