標題真不是誇張,這幾天在整理視頻相關的處理流程,爲了得到一些性能數據,打算在本身的MacBook Pro 上面裝ffmepg,這一折騰四、5天就過去了。有些問題,在解決以後就豁然開朗了,沒有解決以前,真的是百思不得其解,中間就好像隔着一層紗同樣。如今將這幾天的經歷記錄下來,一是方便本身後面查看,二是但願節省你們的時間。html
個人Mac OS版本是macOS Catalina 10.15.1,Xcode版本是11.1,安裝了Command Line Tools for Xcode 11 ,處理器是2 GHz 四核Intel Core i7,內存是8 GB 1600 MHz DDR3。git
首先須要說明一下,網上有些資料多是好久以前寫的,對應的Mac OS版本也比較早,之前能用的步驟的,如今可能就不行了。下面列舉幾個在個人機器上面不適用的場景,如有其餘人也遇到了,能夠參照一下,有時候能夠根據命令的執行錯誤信息去Google或者百度到解決辦法,有時候也可能會被帶到溝裏面去(我就是被帶到溝裏好幾天了)。github
brew install ffmpeg --with-chromaprint --with-fdk-aac --with-fontconfig --with-freetype --with-frei0r --with-game-music-emu --with-libass --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-librsvg --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-rubberband --with-sdl2 --with-snappy --with-speex --with-tesseract --with-theora --with-tools --with-two-lame --with-wavpack --with-webp --with-x265 --with-xz --with-zeromq --with-zim
複製代碼
ffmpeg -y -c:a libfdk_aac -c:v libx264 -i input_file_name.mp4 -c:v libvpx-vp9 -c:a libvorbis output_file_name.webm
複製代碼
ffmpeg -y -acodec libfdk_aac -vcodec libx264 -i input_file_name.mp4 -c:v libvpx-vp9 -c:a libvorbis output_file_name.webm
複製代碼
官方文檔通常會有人去維護,出錯或者不兼容的可能性較低,出現問題後,通常首先須要想到去官方文檔(MacOS ffmpeg 官方文檔)查看解決辦法。我是搜了一下網上的參考資料,後面被折騰了好幾天,實在沒有辦法了,又去仔細看了一下官方文檔。上面介紹了三種方法,一是經過HomeBrew安裝,二是經過編譯好的靜態庫,三是經過ffmpeg源碼安裝。本文重點將經過HomeBrew的方式進行安裝,且通過實踐肯定是可行的,具體以下。 web
Mac裏面經常使用的命令行包管理工具,經過以下命令執行安裝Homebrewruby
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
複製代碼
執行bash
brew install ffmpeg
複製代碼
或者執行均可以,惟一區別是下面語句安裝的是最新版本。app
brew install ffmpeg --HEAD
複製代碼
二者都會檢測ffmpeg的依賴包並自動安裝上,請耐心等待,能夠用ps -ef | grep ffmpeg 看一下最新進展。上面兩步都沒有問題,好多博客也都這麼寫的,可是須要看清官方的下面表述「Since v2.0, Homebrew does not offer options for its core formulae anymore. Users who want to build ffmpeg with additional libraries (including non-free ones) need to use so-called taps from third party repositories. These repositories are not maintained by Homebrew」,簡單說一下就是「從brew的2.0版本開始,brew再也不提供針對ffmepg的options的一鍵關聯安裝了,若是須要將options和ffmpeg關聯起來的話,須要採用第三方的options倉庫」。個人brew版本以下,因此僅僅經過上面兩步來安裝ffmepg,是關聯不了諸如x264,vp9等視頻編解碼器的。若是有同窗也是這種狀況,須要注意一下。ssh
Homebrew 2.1.15
Homebrew/homebrew-core (git revision c10ec; last commit 2019-11-02)
Homebrew/homebrew-cask (git revision bd0e9; last commit 2019-11-02)
複製代碼
有兩個倉庫,分別是homebrew-ffmpeg和varenc/homebrew-ffmpeg,我用的是第一個,有興趣的同窗能夠用第二個嘗試一下。curl
1)執行ide
brew tap homebrew-ffmpeg/ffmpeg
複製代碼
2)執行
brew install homebrew-ffmpeg/ffmpeg/ffmpeg
複製代碼
3)執行以下命令,看此倉庫支持哪些options。
brew options homebrew-ffmpeg/ffmpeg/ffmpeg
複製代碼
4)根據第3)步獲得的options,替換下面命令中的option,而後執行
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-<option1> --with-<option2> ...
複製代碼
執行如上幾個步驟後,就成功的安裝好ffmepg及其依賴包,同時將ffmepg和許多編解碼庫關聯起來了。
以4K網站上面的一個4K視頻puppies-bath-in-4k爲例 一、抽幀,每20秒抽一幀,操做耗時在34.87秒左右。
JAMESWHALE-MB2:Downloads james$ ffmpeg -i PUPPIES_BATH_IN_4K_Original_H.264_AAC.mp4 -f image2 -vf fps=fps=1/20 puppies_%d.png
ffmpeg version git-2019-11-01-53c21c2 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-53c21c2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 35.101 / 56. 35.101
libavcodec 58. 60.100 / 58. 60.100
libavformat 58. 33.100 / 58. 33.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 66.100 / 7. 66.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'PUPPIES_BATH_IN_4K_Original_H.264_AAC.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-09-21T01:14:45.000000Z
Duration: 00:02:29.63, start: 0.000000, bitrate: 21244 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 4096x2304, 21049 kb/s, 23.98 fps, 24 tbr, 48 tbn, 48 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2012-09-21T01:14:45.000000Z
handler_name : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
Output #0, image2, to 'puppies_%d.png':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf58.33.100
Stream #0:0(und): Video: png, rgb24, 4096x2304, q=2-31, 200 kb/s, 0.05 fps, 0.05 tbn, 0.05 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
encoder : Lavc58.60.100 png
frame= 7 fps=0.2 q=-0.0 Lsize=N/A time=00:02:20.00 bitrate=N/A speed=3.68x
video:41191kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
複製代碼
二、調整碼率和尺寸,操做耗時在77.43秒左右,文件大小從400MB左右減小到15MB左右,分辨率從4K調整爲1280*720,減輕手機等無線設備的帶寬和流量壓力。
JAMESWHALE-MB2:Downloads james$ ffmpeg -i PUPPIES_BATH_IN_4K_Original_H.264_AAC.mp4 -crf 32 -b 0.5M -minrate 0.5M -maxrate 1M -bufsize 1M -vf scale=1280:720 PUPPIES_BATH_IN_1280_720p.mp4
ffmpeg version git-2019-11-01-53c21c2 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-53c21c2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 35.101 / 56. 35.101
libavcodec 58. 60.100 / 58. 60.100
libavformat 58. 33.100 / 58. 33.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 66.100 / 7. 66.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'PUPPIES_BATH_IN_4K_Original_H.264_AAC.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-09-21T01:14:45.000000Z
Duration: 00:02:29.63, start: 0.000000, bitrate: 21244 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 4096x2304, 21049 kb/s, 23.98 fps, 24 tbr, 48 tbn, 48 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2012-09-21T01:14:45.000000Z
handler_name : IsoMedia File Produced by Google, 5-11-2011
Please use -b:a or -b:v, -b is ambiguous
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7f9a43016c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7f9a43016c00] profile High, level 3.1
[libx264 @ 0x7f9a43016c00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=32.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1000 vbv_bufsize=1000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'PUPPIES_BATH_IN_1280_720p.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf58.33.100
Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1280x720, q=-1--1, 500 kb/s, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
encoder : Lavc58.60.100 libx264
Side data:
cpb: bitrate max/min/avg: 1000000/0/500000 buffer size: 1000000 vbv_delay: N/A
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2012-09-21T01:14:45.000000Z
handler_name : IsoMedia File Produced by Google, 5-11-2011
encoder : Lavc58.60.100 aac
frame= 3591 fps= 48 q=-1.0 Lsize= 14765kB time=00:02:29.60 bitrate= 808.5kbits/s dup=3 drop=0 speed=1.98x
video:12301kB audio:2351kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.772543%
[libx264 @ 0x7f9a43016c00] frame I:32 Avg QP:28.63 size: 17804
[libx264 @ 0x7f9a43016c00] frame P:978 Avg QP:32.61 size: 6742
[libx264 @ 0x7f9a43016c00] frame B:2581 Avg QP:35.31 size: 2105
[libx264 @ 0x7f9a43016c00] consecutive B-frames: 3.5% 1.2% 2.0% 93.2%
[libx264 @ 0x7f9a43016c00] mb I I16..4: 31.9% 62.0% 6.1%
[libx264 @ 0x7f9a43016c00] mb P I16..4: 7.1% 9.9% 0.5% P16..4: 34.3% 4.3% 1.4% 0.0% 0.0% skip:42.6%
[libx264 @ 0x7f9a43016c00] mb B I16..4: 0.2% 0.5% 0.0% B16..8: 25.5% 1.6% 0.1% direct: 0.4% skip:71.4% L0:39.9% L1:58.9% BI: 1.2%
[libx264 @ 0x7f9a43016c00] 8x8 transform intra:58.1% inter:91.0%
[libx264 @ 0x7f9a43016c00] coded y,uvDC,uvAC intra: 23.9% 36.4% 10.0% inter: 3.9% 5.3% 0.2%
[libx264 @ 0x7f9a43016c00] i16 v,h,dc,p: 23% 40% 8% 29%
[libx264 @ 0x7f9a43016c00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 14% 35% 5% 6% 7% 6% 6% 5%
[libx264 @ 0x7f9a43016c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 20% 23% 6% 7% 7% 6% 5% 3%
[libx264 @ 0x7f9a43016c00] i8c dc,h,v,p: 70% 15% 11% 3%
[libx264 @ 0x7f9a43016c00] Weighted P-Frames: Y:4.2% UV:3.7%
[libx264 @ 0x7f9a43016c00] ref P L0: 60.8% 15.5% 18.1% 5.5% 0.1%
[libx264 @ 0x7f9a43016c00] ref B L0: 91.6% 6.5% 1.9%
[libx264 @ 0x7f9a43016c00] ref B L1: 97.6% 2.4%
[libx264 @ 0x7f9a43016c00] kb/s:673.46
[aac @ 0x7f9a43018400] Qavg: 237.150
複製代碼
三、將mpeg4制式轉成webm格式,源音視頻編碼是不用寫的,ffmepg能夠本身讀取(例如,這裏的視頻編碼是h.264,音頻編碼是aac),寫了以後反而會報Unknown decoder 'libx264'錯誤。能夠指定目標編碼,若不指定,ffmepg會根據輸出文件名後綴採用合適的音視頻編碼,例如,這裏的輸出文件名後綴是.webm, 則制式採用webm格式,視頻編碼用vp9,音頻編碼用opus。vp9還真挺厲害,在h.264基礎上,又壓縮掉了70%(400MB->107MB)。
JAMESWHALE-MB2:Downloads james$ ffmpeg -i PUPPIES_BATH_IN_4K_Original_H.264_AAC.mp4 PUPPIES_BATH_IN_4K_Original_H.264_AAC.webm
ffmpeg version git-2019-11-01-53c21c2 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-53c21c2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 35.101 / 56. 35.101
libavcodec 58. 60.100 / 58. 60.100
libavformat 58. 33.100 / 58. 33.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 66.100 / 7. 66.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'PUPPIES_BATH_IN_4K_Original_H.264_AAC.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-09-21T01:14:45.000000Z
Duration: 00:02:29.63, start: 0.000000, bitrate: 21244 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 4096x2304, 21049 kb/s, 23.98 fps, 24 tbr, 48 tbn, 48 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
creation_time : 2012-09-21T01:14:45.000000Z
handler_name : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libvpx-vp9 @ 0x7fc0ce010600] v1.8.1
[libvpx-vp9 @ 0x7fc0ce010600] Neither bitrate nor constrained quality specified, using default CRF of 32
[libopus @ 0x7fc0ce013c00] No bit rate set. Defaulting to 96000 bps.ate= -0.0kbits/s speed=N/A
Output #0, webm, to 'PUPPIES_BATH_IN_4K_Original_H.264_AAC.webm':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf58.33.100
Stream #0:0(und): Video: vp9 (libvpx-vp9), yuv420p(progressive), 4096x2304, q=-1--1, 24 fps, 1k tbn, 24 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
encoder : Lavc58.60.100 libvpx-vp9
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(und): Audio: opus (libopus), 48000 Hz, stereo, flt, 96 kb/s (default)
Metadata:
creation_time : 2012-09-21T01:14:45.000000Z
handler_name : IsoMedia File Produced by Google, 5-11-2011
encoder : Lavc58.60.100 libopus
frame= 3588 fps=0.3 q=0.0 Lsize= 104601kB time=00:02:29.61 (這個不是耗時)bitrate=5727.3kbits/s speed=0.0116x
video:102527kB audio:1994kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.076851%
複製代碼
四、將mpeg4制式轉成webm制式,源音視頻編碼仍然從輸入文件獲取,此次明確指定目標視頻編碼爲vp8,目標音頻編碼沒有明確指定,ffmpeg根據輸出文件後綴.webm默認採用opus音頻編碼。vp8在h.264基礎上,又壓縮掉了20%左右(15.1MB->12.1MB),操做耗時在599.15秒左右。
JAMESWHALE-MB2:Downloads james$ ffmpeg -i PUPPIES_BATH_IN_1280_720p.mp4 -vcodec vp8 -crf 32 -b 0.5M -minrate 0.5M -maxrate 1M -bufsize 1M PUPPIES_BATH_IN_1280_720p.webm
ffmpeg version git-2019-11-01-53c21c2 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-53c21c2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 35.101 / 56. 35.101
libavcodec 58. 60.100 / 58. 60.100
libavformat 58. 33.100 / 58. 33.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 66.100 / 7. 66.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'PUPPIES_BATH_IN_1280_720p.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.33.100
Duration: 00:02:29.63, start: 0.000000, bitrate: 808 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 673 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : IsoMedia File Produced by Google, 5-11-2011
Please use -b:a or -b:v, -b is ambiguous
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> vp8 (libvpx))
Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libopus @ 0x7fa68c002800] No bit rate set. Defaulting to 96000 bps.
[libvpx @ 0x7fa68c001600] v1.8.1
Output #0, webm, to 'PUPPIES_BATH_IN_1280_720p.webm':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.33.100
Stream #0:0(und): Video: vp8 (libvpx), yuv420p, 1280x720, q=-1--1, 500 kb/s, 24 fps, 1k tbn, 24 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.60.100 libvpx
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 1000000 vbv_delay: N/A
Stream #0:1(und): Audio: opus (libopus), 48000 Hz, stereo, flt, 96 kb/s (default)
Metadata:
handler_name : IsoMedia File Produced by Google, 5-11-2011
encoder : Lavc58.60.100 libopus
frame= 3591 fps=6.0 q=0.0 Lsize= 11812kB time=00:02:29.61 bitrate= 646.7kbits/s speed=0.249x
video:9750kB audio:1984kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.665825%
複製代碼
遇到問題不能怕,即便通過了不少天的折磨,仍然須要保持耐心和清醒的頭腦,問題解決以後的成就感是對過程當中付出的最大回報。