這是歷史版本頁面 — 看 FFmpeg (32-bit) 最新版本

影片轉檔老是失敗?FFmpeg 指令能做什麼

FFmpeg (32-bit) 軟體圖示 FFmpeg (32-bit) 3.3.1 (32-bit) 資料更新 2017-05-21 閱讀約 5 分鐘

你大概遇過這種狀況:從網路上下載的影片,播放器不認得;朋友傳來的檔案,手機開了只有聲音沒有畫面;或者想把一段影片剪成幾秒的短片,卻找不到一個不浮水印、不限制長度的工具。你只是想趕快把檔案處理好,結果光是找軟體、裝軟體、試用、被廣告干擾,就耗掉整個晚上。

一般人習慣找有視窗的轉檔程式,但免費的常常限制格式或輸出長度,付費的又不知道值不值得。更別說一次要轉幾十個檔案時,一個一個點選、等待、再設定,重複到讓人懷疑人生。這類工具真正的切入點,是讓你把「轉檔」這件事變成一行指令:輸入檔案、指定輸出格式、按下執行,剩下的交給程式跑完。它不提供華麗介面,但換來的是精準控制和批次處理的能力。

01FFmpeg 到底能做什麼?

它是一套命令列多媒體工具,涵蓋轉檔、解碼、編碼、串流、濾波和播放。白話來說,常見的影片格式轉換、從影片抽出音訊、調整解析度或位元率、合併多段影片、截取片段,都在它的處理範圍內。它同時提供 ffprobe 這支工具,可以查看檔案的詳細編碼資訊,例如使用哪種編碼格式、解析度、影格率等。

02轉檔之後畫質會不會變差?

這取決於你設定的編碼參數。FFmpeg 內含 libswscale 和 libswresample,負責影像縮放、色彩空間轉換和音訊重取樣,這些處理都有最佳化。但輸出品質主要還是看你指定的編碼器、位元率和解析度。如果只是把 AVI 轉成 MP4,沒有特別調整參數,預設值通常能維持一定水準;若要追求高畫質,需要自己設定較高的位元率。

03能不能一次處理很多檔案?

可以,這是命令列工具的強項。你可以用迴圈指令批次處理整個資料夾的檔案,例如把所有 .mkv 檔轉成 .mp4,或一次抽取多個影片的音軌。不需要逐一開啟、另存新檔。只要指令寫對,它會依序處理完所有檔案。這對需要大量轉檔的人來說,省下的時間很可觀。

04合併影片或剪接片段可以嗎?

可以。合併影片需要先建立一個清單檔,列出所有要合併的檔案路徑,再用指令指定這個清單,它就會依序串接。剪接片段則是用 -ss 和 -t 參數指定開始時間和持續時間,例如從第 10 秒開始取 5 秒鐘的片段。這些操作都不需要重新編碼,處理速度很快。

05怎麼知道一個影片的詳細資訊?

用內建的 ffprobe 工具。只要輸入指令加上檔案路徑,它會列出完整的串流資訊,包括影片使用的編碼格式、解析度、影格率、位元率,以及音訊的取樣率、聲道數等。這在確認某個檔案到底能不能播、或為什麼轉檔失敗時很有用,因為問題常常出在來源檔案的編碼格式。

06不會寫程式的人能用嗎?

能用,但需要花時間學指令。它沒有圖形介面,所有操作都靠打字,所以你得先理解基本指令結構,例如輸入檔、輸出檔、參數怎麼排列。官方文件對某些進階功能說明不多,遇到問題時多半得靠自己搜尋或看論壇討論。如果完全不想碰指令,這套軟體對你來說門檻會比較高。

07只是偶爾轉個檔,適合用嗎?

如果你的需求是「一個月轉一次檔、不想記指令」,那它可能不是最省事的選擇。安裝後還需要手動設定系統 PATH,才能在任何路徑下直接執行指令。偶爾用一次的人,光是重新回想指令怎麼寫,可能就比用一般轉檔軟體還久。它比較適合願意花一次時間學、之後長期使用的人。

08在 Windows 上安裝會不會很麻煩?

它沒有安裝程式,下載回來是一個 ZIP 壓縮檔,需要先解壓縮,再把資料夾路徑加到系統 PATH 環境變數。之後打開命令提示字元才能直接使用。官方建議用 7-Zip 解壓縮。整個過程不算複雜,但對不熟悉環境變數的人來說,第一次設定會需要查一下教學。

09想要有視窗介面的人適合嗎?

不適合。這套軟體本質上是命令列工具,沒有官方圖形介面。如果你習慣用滑鼠點選、看預覽視窗,它會讓你覺得很挫折。雖然網路上有人另外包裝了圖形介面版本,但那不是官方產品,功能也可能不完整。需要視覺化操作的人,應該找其他有 GUI 的轉檔軟體。

10這套軟體有持續在更新嗎?

有。它的版本紀錄顯示近期仍有多次更新,開發團隊維持著穩定的發布節奏。這對多媒體格式來說很重要,因為新的編碼格式和容器格式不斷出現,持續更新代表它能跟上最新的格式支援。如果你處理的檔案來源很多元,這點可以放心。

11跟其他轉檔軟體比,FFmpeg 的優勢在哪?

它的優勢在於格式支援範圍極廣,從老舊的格式到最新的編碼都有對應的解碼器和編碼器,而且完全免費、開源。命令列介面雖然學習成本高,但換來的是精確控制和批次處理能力。如果你需要處理的檔案格式很冷門,或需要大量自動化轉檔,它會比一般圖形介面軟體更有彈性。

下載與官方連結

前往官方網站 下載 FFmpeg (32-bit)

ffmpeg-3.3.1-win32-static.zip · 41.51 MB · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

- libswscale/tests/swscale: Fix uninitialized variables
- avcodec/ffv1dec: Fix runtime error: signed integer overflow: 1550964438 + 1550964438 cannot be represented in type 'int'
- avcodec/webp: Fix signedness in prefix_code check
- avcodec/svq3: Fix runtime error: signed integer overflow: 169 * 12717677 cannot be represented in type 'int'
- avcodec/mlpdec: Check that there is enough data for headers
- avcodec/ac3dec: Keep track of band structure
- avcodec/webp: Add missing input padding
- avcodec/aacdec_fixed: Fix runtime error: left shift of negative value -1
- avcodec/aacsbr_template: Do not change bs_num_env before its checked
- avcodec/scpr: Fix multiple runtime error: index 256 out of bounds for type 'unsigned int [256]'
- avcodec/mlp: Fix multiple runtime error: left shift of negative value -1
- avcodec/xpmdec: Fix multiple pointer/memory issues
- avcodec/vp8dsp: vp7_luma_dc_wht_c: Fix multiple runtime error: signed integer overflow: -1366381240 + -1262413604 cannot be represented in type 'int'
- avcodec/avcodec: Limit the number of side data elements per packet
- avcodec/texturedsp: Fix runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
- avcodec/g723_1dec: Fix runtime error: left shift of negative value -1
- avcodec/wmv2dsp: Fix runtime error: signed integer overflow: 181 * -17047030 cannot be represented in type 'int'
- avcodec/diracdec: Fix Assertion frame->buf[0] failed at libavcodec/decode.c:610
- avcodec/msmpeg4dec: Check for cbpy VLC errors
- avcodec/cllc: Check num_bits
- avcodec/cllc: Factor VLC_BITS/DEPTH out, do not use repeated literal numbers
- avcodec/scpr: Check y in first line loop in decompress_i()
- avcodec/dvbsubdec: Check entry_id
- avcodec/aacdec_fixed: Fix multiple shift exponent 33 is too large for 32-bit type 'int'
- avcodec/mpeg12dec: Fixes runtime error: division by zero
- avcodec/pixlet: Fix runtime error: signed integer overflow: 436207616 * -5160230545260541 cannot be represented in type 'long'
- avcodec/webp: Always set pix_fmt
- avfilter/vf_uspp: Fix currently unused input frame dimensions
- avcodec/truemotion1: Fix multiple runtime error: left shift of negative value -1
- avcodec/eatqi: Fix runtime error: signed integer overflow: 4466147 * 1075 cannot be represented in type 'int'
- avcodec/dss_sp: Fix runtime error: signed integer overflow: 2147481189 + 4096 cannot be represented in type 'int'
- avformat/wavdec: Check chunk_size
- avcodec/cavs: Check updated MV
- avcodec/y41pdec: Fix width in input buffer size check
- avcodec/svq3: Fix multiple runtime error: signed integer overflow: -237341 * 24552 cannot be represented in type 'int'
- avcodec/texturedsp: Fix runtime error: left shift of 218 by 24 places cannot be represented in type 'int'
- avcodec/lagarith: Check scale_factor
- avcodec/lagarith: Fix runtime error: left shift of negative value -1
- avcodec/takdec: Fix multiple runtime error: left shift of negative value -1
- avcodec/indeo2: Check for invalid VLCs
- avcodec/g723_1dec: Fix several integer related cases of undefined behaviour
- avcodec/htmlsubtitles: Check for string truncation and return error
- avcodec/bmvvideo: Fix runtime error: left shift of 137 by 24 places cannot be represented in type 'int'
- avcodec/dss_sp: Fix multiple runtime error: signed integer overflow: -15699 * -164039 cannot be represented in type 'int'
- avcodec/dvbsubdec: check region dimensions
- avcodec/vp8dsp: Fixes: runtime error: signed integer overflow: 1330143360 -1023040530 cannot be represented in type 'int'
- avcodec/hqxdsp: Fix multiple runtime error: signed integer overflow: 248220 * 21407 cannot be represented in type 'int' in idct_col()
- avcodec/cavsdec: Check sym_factor
- avcodec/cdxl: Check format for BGR24
- avcodec/ffv1dec: Fix copying planes of paletted formats
- avcodec/wmv2dsp: Fix runtime error: signed integer overflow: 181 * -12156865 cannot be represented in type 'int'
- avcodec/xwddec: Check bpp more completely
- avcodec/aacdec_template: Do not decode 2nd PCE if it will lead to failure
- avcodec/s302m: Fix left shift of 8 by 28 places cannot be represented in type 'int'
- avcodec/eamad: Fix runtime error: signed integer overflow: 49674 * 49858 cannot be represented in type 'int'
- avcodec/g726: Fix runtime error: left shift of negative value -2
- avcodec/magicyuv: Check len to be supported
- avcodec/ra144: Fix runtime error: left shift of negative value -798
- avcodec/mss34dsp: Fix multiple signed integer overflow
- avcodec/targa_y216dec: Fix width type
- avcodec/texturedsp: Fix multiple runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
- avcodec/ivi_dsp: Fix multiple left shift of negative value -2
- avcodec/svq3: Fix multiple runtime error: signed integer overflow: 44161 * 61694 cannot be represented in type 'int'
- avcodec/msmpeg4dec: Correct table depth
- avcodec/dds: Fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
- avcodec/cdxl: Check format parameter
- avutil/softfloat: Fix overflow in av_div_sf()
- avcodec/hq_hqa: Fix runtime error: left shift of negative value -207
- avcodec/mss3: Change types in rac_get_model_sym() to match the types they are initialized from
- avcodec/shorten: Check k in get_uint()
- avcodec/webp: Fix null pointer dereference
- avcodec/dfa: Fix signed integer overflow: -2147483648 1 cannot be represented in type 'int'
- avcodec/g723_1: Fix multiple runtime error: left shift of negative value
- avcodec/mimic: Fix runtime error: left shift of negative value -1
- avcodec/clearvideo: Fix multiple runtime error: left shift of negative value -1024
- avcodec/fic: Fix multiple left shift of negative value -15
- avcodec/mlpdec: Fix runtime error: left shift of negative value -22
- avcodec/snowdec: Check qbias
- avutil/softfloat: Fix multiple runtime error: left shift of negative value -8
- avcodec/aacsbr_template: Do not leave bs_num_env invalid
- avcodec/mdec: Fix signed integer overflow: 28835400 * 83 cannot be represented in type 'int'
- avcodec/dfa: Fix off by 1 error
- avcodec/nellymoser: Fix multiple left shift of negative value -8591
- avcodec/cdxl: Fix signed integer overflow: 14243456 * 164 cannot be represented in type 'int'
- avcodec/g722: Fix multiple runtime error: left shift of negative value -1
- avcodec/dss_sp: Fix multiple left shift of negative value -466
- avcodec/wnv1: Fix runtime error: left shift of negative value -1
- avcodec/tiertexseqv: set the fixed dimenasions, do not depend on the demuxer doing so
- avcodec/mjpegdec: Fix runtime error: signed integer overflow: -24543 * 2031616 cannot be represented in type 'int'
- avcodec/cavsdec: Fix undefined behavior from integer overflow
- avcodec/dvdsubdec: Fix runtime error: left shift of 242 by 24 places cannot be represented in type 'int'
- libavcodec/mpeg4videodec: Convert sprite_offset to 64bit
- avcodec/pngdec: Use ff_set_dimensions()
- avcodec/msvideo1: Check buffer size before re-getting the frame
- avcodec/h264_cavlc: Fix undefined behavior on qscale overflow
- avcodec/dcadsp: Fix runtime error: signed integer overflow
- avcodec/svq3: Reject dx/dy beyond 16bit
- avcodec/svq3: Increase offsets to prevent integer overflows
- avcodec/indeo2: Check remaining bits in ir2_decode_plane()
- avcodec/vp3: Check remaining bits in unpack_dct_coeffs()
- doc/developer: Add terse documentation of assumed C implementation defined behavior
- avcodec/bmp: Use ff_set_dimensions()
- avcodec/mdec: Fix runtime error: left shift of negative value -127
- avcodec/x86/vc1dsp_init: Fix build failure with --disable-optimizations and clang
- libavcodec/exr : fix float to uint16 conversion for negative float value
- avformat/webmdashenc: Validate the 'streams' adaptation sets parameter
- avformat/webmdashenc: Require the 'adaptation_sets' option to be set
- lavfi/avfiltergraph: only return EOF in avfilter_graph_request_oldest if all sinks EOFed
- ffmpeg: check for unconnected outputs
- avformat/utils: free AVStream.codec properly in free_stream()
- avcodec/options: do a more thorough clean up in avcodec_copy_context()
- avcodec/options: factorize avcodec_copy_context() cleanup code
- ffmpeg: count packets when queued
- avformat/concatdec: fix the h264 annexb extradata check
- avcodec/dnxhd_parser: fix parsing interlaced video, simplify code
- ffmpeg; check return code of avcodec_send_frame when flushing encoders
- avcodec/g723_1dec: Fix LCG type
- avcodec/hqxdsp: Fix runtime error: signed integer overflow: -196264 * 11585 cannot be represented in type 'int'
- avcodec/ac3dec: Fix: runtime error: index -1 out of bounds for type 'INTFLOAT [2]'
- avcodec/mpeg4videodec: Clear sprite wraping on unsupported cases in VOP decode
- avcodec/pixlet: Fixes: runtime error: signed integer overflow: 9203954323419769657 + 29897660706736950 cannot be represented in type 'long'
- avcodec/dds: Fix runtime error: left shift of 210 by 24 places cannot be represented in type 'int'
- avcodec/rscc: Check pixel_size for overflow
- avcodec/fmvc: Check nb_blocks
- avcodec/cllc: Check prefix
- avcodec/webp: Factor update_canvas_size() out
- avcodec/webp: Update canvas size in vp8_lossy_decode_frame() as in vp8_lossless_decode_frame()
- avcodec/snowdec: Check width
- avcodec/flacdec: Return error code instead of 0 for failures
- avcodec/opus_silk: Fix integer overflow and out of array read
- avcodec/aacps: Fix undefined behavior
- avcodec/pixlet: Fix shift exponent 4294967268 is too large for 32-bit type 'int'
- doc/general: fix project name after 2b1a6b1ae