1. 查看視頻信息 2. 截取一段視頻 3. 提高音量 4. 去除水印 5. 批量處理 5.1 使用sh腳本批量去除片頭固定時長片段 5.2 同時處理片頭,片尾的 6. 合並 7. ffmpeg -help
本文主要記錄 使用ffmpeg 處理視頻文件 (去除 片頭廣告)
關於字幕的可參照:https://szosoft.blogspot.com/2019/11/ffmpeg-01-subtitle.html
或者這里:https://www.cnblogs.com/sztom/p/11964797.html
1. 查看視頻信息
$ ffmpeg -i lamp.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'lamp.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.29.100 Duration: 00:11:21.81, start: 0.000000, bitrate: 1637 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1504 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler At least one output file must be specified
2. 截取一段視頻
先看表示時間的選項
- -ss time_offset the start time offset設置開始時間偏移
- -t durationrecord or transcode "duration" seconds of audio/video記錄或轉碼音頻/視頻的“持續時間”秒
- -to time_stoprecord or transcode stop time記錄或轉碼停止時間
注: -to(時間格式) 和 -t(秒數) 選項都是表述持續時間,只是格式不同而已.
截取開始到7分30秒的視頻, 就是去除7分30秒后的所有內容.
$ ffmpeg -ss 00:00:00 -i lamp.mp4 -to 00:07:30 o730.mp4
這樣的標准寫法, 速度會有點慢.
快速去掉第一秒
$ ffmpeg -ss 00:00:01 -i o730-15.mp4 -c copy 0730-16.mp4
參考幫助信息
- -c codeccodec name編解碼器名稱
- -vcodec codecforce video codec ('copy' to copy stream)強制視頻編解碼器(“復制”以復制流)
- -acodec codecforce audio codec ('copy' to copy stream)強制音頻編解碼器(“復制”以復制流)
- -scodec codecforce subtitle codec ('copy' to copy stream)強制字幕編解碼器(“復制”以復制流)
增加了 -c copy 直接復制. 參照上面幫助信息, 也可以分開來寫 -vcodec copy -acodec copy.
(也有后面這樣的寫法: -c:v copy -c:a copy 但這種寫法之對部分文件有效, 對於美劇原始文件(包含更多的元數據,流數據)會報錯.)
快速剪裁視頻前100秒, 這種寫法對於國內翻譯網站編輯過的文件有效.
$ ffmpeg -ss 00:00:00 -i Devs.mp4 -t 100 -c:v copy -c:a copy Deus.mp4
3. 提高音量
-vol volumechange audio volume (256=normal)更改音量(256 =正常)
參考以上幫助信息, 提高音量, 大於256即可. 具體多少合適, 要自己嘗試了.
$ ffmpeg -ss 00:00:00 -i Devs.mp4 -vol 1024 Devs2.mp4
當有幾個文件想要一起循環播放,但不同的文件音量差異很大時,這個就很有用了.
4. 去除水印
-vf filter_graphset video filters設置視頻過濾器
查看相關可用濾鏡
$ ffmpeg -filters |grep logo
T.. delogo V->V Remove logo from input video.
T.. removelogo V->V Remove a TV logo based on a mask image.
去掉指定坐標位置的靜態水印
$ ffmpeg -i Devs.mp4 -vf "delogo=x=1:y=1:w=100:h=30:show=0" Deus.103.mp4
#-vf "delogo=x=1:y=1:w=100:h=30:show=0" 濾鏡位置以視頻左上角為(1,1)坐標; 大小:寬100,高30; show=0 無邊框, show=1 會有綠色邊框.
5. 批量處理
5.1 使用sh腳本批量去除片頭固定時長片段
找到ffmpeg命令文件的位置
$ whereis ffmpeg
ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz
$ which ffmpeg
/usr/bin/ffmpeg
進入視頻文件夾, 保存如下腳本到 ffmpeg-45.sh 文件,
#!/bin/bash #用 for 循環直接獲取當前目錄下的 mp4文件循環處理,去掉開頭45 秒 for i in *.mp4 ; do /usr/bin/ffmpeg -ss 00:00:45 -i $i -c copy /home/mov/$i -y done
執行, 大約復制一遍視頻文件的時間就完成了. 看看結果,沒問題,就可以刪除原文件了.
$ bash ffmpeg-45.sh
5.2 同時處理片頭,片尾的
參考這里: https://blog.csdn.net/wchenjt/article/details/105759542
#!/bin/bash #我這里要切除的開頭和結尾都是 7 秒 beg=7 end=7 #用 for 循環直接獲取當前目錄下的 mp4、mp3、avi 等文件循環處理,單個文件可以去掉 for 循環 for i in (*.mp4,*.mp3,*.avi ); do #將元數據信息臨時保存到 tmp.log 文件中 nohup /usr/local/ffmpeg/bin/ffmpeg -i "$i" > tmp.log #獲取視頻的時長,格式為 00:00:10,10 (時:分:秒,微妙) time="`cat /usr/local/ffmpeg/tmp.log |grep Duration: |awk '{print $2}'|awk -F "," '{print $1}'|xargs`" echo $time #求視頻的總時長,先分別求出小時、分、秒的值,這里不處理微秒,可以忽略 hour="`echo $time |awk -F ":" '{print $1}' `" min="`echo $time |awk -F ":" '{print $2}' `" sec="`echo $time |awk -F ":" '{print $3}'|awk -F "." '{print $1}' `" #echo $hour $min $sec num1=`expr $hour \* 3600` num2=`expr $min \* 60` num3=$sec #計算出視頻的總時長(秒) sum=`expr $num1 + $num2 + $num3` #總時長減去開頭和結尾就是截取后的視頻時長,並且這里不需要再轉回 hour:min:sec 的格式,直接使用結果即可 newtime=`expr $sum - $beg - $end` echo $newtime /usr/local/ffmpeg/bin/ffmpeg -ss 00:00:07 -i $i -t $newtime -c:v copy -c:a copy /data/tmp/$i -y done
6. 合並
-f fmtforce format強制格式
1. 建立list.txt 文件,參照如下記錄要合並的視頻文件列表
file ./d1.mp4 file ./d2.mp4 file ./d3.mp4
2. 合並
$ ffmpeg -f concat -safe 0 -i list.txt -c copy con.mp4
或者用如下一條語句,需要bash
$ ffmpeg -f concat -safe 0 -i <(for f in /mnt/sa10/mv/*.mp4; do echo "file '$f'"; done) -c copy output.mp4
$ ffmpeg -f concat -safe 0 -i <(for f in /mnt/sa10/TDDownload/LinuxDownload/ffmpeg/c/*.mp4; do echo "file '$f'"; done) -c copy output.mp4
選的3個相同格式的文件,且都很小,所以瞬間完成了,不過報了一堆黃色字符信息, 不過沒有錯誤或警告的關鍵字.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x561923876f40] Auto-inserting h264_mp4toannexb bitstream filter Input #0, concat, from '/dev/fd/63': Duration: N/A, start: -0.021333, bitrate: 777 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 648 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: handler_name : SoundHandler Output #0, mp4, to 'output.mp4': Metadata: encoder : Lavf58.29.100 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, q=2-31, 648 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 24k tbc Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mov,mp4,m4a,3gp,3g2,mj2 @ 0x56192387cc40] Auto-inserting h264_mp4toannexb bitstream filter [mp4 @ 0x56192388e780] Non-monotonous DTS in output stream 0:0; previous: 239751, current: 100626; changing to 239752. This may result in incorrect timestamps in the output file.
...
[mp4 @ 0x56192388e780] Non-monotonous DTS in output stream 0:0; previous: 239890, current: 239765; changing to 239891. This may result in incorrect timestamps in the output file. [mov,mp4,m4a,3gp,3g2,mj2 @ 0x56192387a540] Auto-inserting h264_mp4toannexb bitstream filter [mp4 @ 0x56192388e780] Non-monotonous DTS in output stream 0:0; previous: 626151, current: 601136; changing to 626152. This may result in incorrect timestamps in the output file.
...
[mp4 @ 0x56192388e780] Non-monotonous DTS in output stream 0:0; previous: 626176, current: 626161; changing to 626177. This may result in incorrect timestamps in the output file. frame= 1319 fps=0.0 q=-1.0 Lsize= 7318kB time=00:00:48.03 bitrate=1248.2kbits/s speed= 168x video:6593kB audio:693kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.451475%
7. ffmpeg -help
Print help / information / capabilities: | 打印幫助/信息/功能: | |wc -l | |
-L | show license | 演出許可證 | |
-h | -- print basic options | -打印基本選項 | 110 |
-h long | -- print more options | -打印更多選項 | 222 |
-h full | -- print all options (including all format and codec specific options, very long) | 11352 | |
-h type=name | – print all options for the named decoder/encoder/demuxer/muxer/filter/bsf | ||
-version | show version | 顯示版本 | |
-buildconf | show build configuration | 顯示構建配置 | 47 |
-formats | show available formats | 顯示可用格式 | 361 |
-muxers | show available muxers 復用器(mux) | 把不同的流按照某種容器的規則放入容器 | 172 |
-demuxers | show available demuxers 解復用(demux) | 把不同的流從某種容器中解析出來 | 311 |
-devices | show available devices 設備 | 顯示可用設備 | 16 |
-codecs | show available codecs 編解碼器(Codec) | 是對視頻進行壓縮或者解壓縮 | 463 |
-decoders | show available decoders 解碼器 | 顯示可用的解碼器 | 477 |
-encoders | show available encoders 編碼器 | 顯示可用的編碼器 | 199 |
-bsfs | show available bit stream filters | 顯示可用的比特流過濾器 | 35 |
-protocols | show available protocols | 顯示可用的協議 | 64 |
-filters | show available filters 濾鏡 | 顯示可用的過濾器 | 395 |
-pix_fmts | show available pixel formats | 顯示可用的像素格式 | 201 |
-layouts | show standard channel layouts | 顯示標准頻道布局 | 58 |
-sample_fmts | show available audio sample formats | 顯示可用的音頻樣本格式 | 13 |
-colors | show available color names | 顯示可用的顏色名稱 | 141 |
-sources device | list sources of the input device | 列出輸入設備的來源 | |
-sinks device | list sinks of the output device | 列出輸出設備的接收器 | |
-hwaccels | show available HW acceleration methods | 顯示可用的硬件加速方法 |
Global options (affect whole program instead of just one file: | 全局選項(影響整個程序,而不僅僅是一個文件: | |
-loglevel loglevel | set logging level | 設置日志記錄級別 |
-v loglevel | set logging level | 設置日志記錄級別 |
-report | generate a report | 生成報告 |
-max_alloc bytes | set maximum size of a single allocated block | 設置單個分配塊的最大大小 |
-y | overwrite output files | 覆蓋輸出文件 |
-n | never overwrite output files | 永遠不會覆蓋輸出文件 |
-ignore_unknown | Ignore unknown stream types | 忽略未知的流類型 |
-filter_threads | number of non-complex filter threads | 非復雜過濾器線程數 |
-filter_complex_threads | number of threads for -filter_complex | -filter_complex的線程數 |
-stats | print progress report during encoding | 編碼過程中的打印進度報告 |
-max_error_rate maximum error rate | ratio of errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success. | 錯誤率 (0.0: no errors, 1.0: 100% errors), ffmpeg高於該比率將返回錯誤而不是成功。 |
-bits_per_raw_sample | number set the number of bits per raw sample | 數字設置每個原始樣本的位數 |
-vol volume | change audio volume (256=normal) | 更改音量(256 =正常) |
Advanced global options: | 高級全局選項: | |
-cpuflags flags | force specific cpu flags | 強制特定的cpu標志 |
-hide_banner hide_banner | do not show program banner | 不顯示程序橫幅 |
-copy_unknown | Copy unknown stream types | 復制未知的流類型 |
-benchmark | add timings for benchmarking | 添加基准測試時間 |
-benchmark_all | add timings for each task | 為每個任務添加時間 |
-progress url | write program-readable progress information | 編寫程序可讀的進度信息 |
-stdin | enable or disable interaction on standard input | 在標准輸入上啟用或禁用交互 |
-timelimit limit | set max runtime in seconds | 以秒為單位設置最大運行時間 |
-dump | dump each input packet | 轉儲每個輸入數據包 |
-hex | when dumping packets, also dump the payload | 轉儲數據包時,也轉儲有效負載 |
-vsync | video sync method | 視頻同步方式 |
-frame_drop_threshold | frame drop threshold | 丟幀閾值 |
-async | audio sync method | 音頻同步方式 |
-adrift_threshold threshold | audio drift threshold | 音頻漂移閾值 |
-copyts | copy timestamps | 復制時間戳記 |
-start_at_zero | shift input timestamps to start at 0 when using copyts | 使用copyts時,將輸入時間戳轉換為從0開始 |
-copytb mode | copy input stream time base when stream copying | 流復制時復制輸入流的時基 |
-dts_delta_threshold threshold | timestamp discontinuity delta threshold | 時間戳不連續性增量閾值 |
-dts_error_threshold threshold | timestamp error delta threshold | 時間戳錯誤增量閾值 |
-xerror error | exit on error | 錯誤退出 |
-abort_on flags | abort on the specified condition flags | 在指定的條件標志上中止 |
-filter_complex graph_description | create a complex filtergraph | 創建一個復雜的filtergraph |
-lavfi graph_description | create a complex filtergraph | 創建一個復雜的filtergraph |
-filter_complex_script filename | read complex filtergraph description from a file | 從文件中讀取復雜的filtergraph描述 |
-debug_ts | print timestamp debugging info | 打印時間戳調試信息 |
-intra | deprecated use -g 1 | 不推薦使用-g 1 |
-deinterlace | this option is deprecated, use the yadif filter instead | 不建議使用此選項,請改用yadif過濾器 |
-psnr | calculate PSNR of compressed frames | 計算壓縮幀的PSNR |
-vstats | dump video coding statistics to file | 將視頻編碼統計信息轉儲到文件 |
-vstats_file file | dump video coding statistics to file | 將視頻編碼統計信息轉儲到文件 |
-vstats_version | Version of the vstats format to use. | 要使用的vstats格式的版本。 |
-qphist | show QP histogram | 顯示QP直方圖 |
-vc channel | deprecated, use -channel | 不推薦使用,使用-channel |
-tvstd standard | deprecated, use -standard | 不推薦使用,使用-standard |
-isync | this option is deprecated and does nothing | 此選項已棄用,不執行任何操作 |
-sdp_file file | specify a file in which to print sdp information | 指定要在其中打印sdp信息的文件 |
-vaapi_device device | set VAAPI hardware device (DRM path or X11 display name) | 設置VAAPI硬件設備(DRM路徑或X11顯示名稱) |
-init_hw_device args | initialise hardware device | 初始化硬件設備 |
-filter_hw_device device | set hardware device used when filtering | 設置過濾時使用的硬件設備 |
Per-file main options: | 每個文件的主要選項: | |
-f fmt | force format | 強制格式 |
-c codec | codec name | 編解碼器名稱 |
-codec codec | codec name | 編解碼器名稱 |
-pre preset | preset name | 預設名稱 |
-map_metadata outfile[,metadata]:infile[,metadata] | set metadata information of outfile from infile | 設置infile中outfile的元數據信息 |
-t duration | record or transcode "duration" seconds of audio/video | 記錄或轉碼音頻/視頻的“持續時間”秒 |
-to time_stop | record or transcode stop time | 記錄或轉碼停止時間 |
-fs limit_size | set the limit file size in bytes | 設置限制文件大小(以字節為單位) |
-ss time_off | set the start time offset | 設置開始時間偏移 |
-sseof time_off | set the start time offset relative to EOF | 設置相對於EOF的開始時間偏移 |
-seek_timestamp | enable/disable seeking by timestamp with -ss | 使用-ss按時間戳啟用/禁用查找 |
-timestamp time | set the recording timestamp ('now' to set the current time) | 設置錄制時間戳(“現在”設置當前時間) |
-metadata string=string | add metadata | 添加元數據 |
-program title=string:st=number... | add program with specified streams | 添加具有指定流的程序 |
-target type | specify target file type ("vcd", "svcd", "dvd", "dv" or "dv50" with optional prefixes "pal-", "ntsc-" or "film-") | 指定目標文件類型 ("vcd", "svcd", "dvd", "dv" or "dv50" with optional prefixes "pal-", "ntsc-" or "film-") |
-apad | audio pad | 音墊 |
-frames number | set the number of frames to output | 設置要輸出的幀數 |
-filter filter_graph | set stream filtergraph | 設置流filtergraph |
-filter_script filename | read stream filtergraph description from a file | 從文件中讀取流filtergraph描述 |
-reinit_filter | reinit filtergraph on input parameter changes | 輸入參數更改時重新初始化filtergraph |
-discard | discard | 丟棄 |
-disposition | disposition | 部署 |
Advanced per-file options: | 每個文件的高級選項: | |
-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_s | set input stream mapping | 設置輸入流映射 |
-map_channel file.stream.channel[:syncfile.syncstream] | map an audio channel from one stream to another | 將音頻通道從一個流映射到另一個 |
-map_chapters input_file_index | set chapters mapping | 設置章節映射 |
-accurate_seek | enable/disable accurate seeking with -ss | 使用-ss啟用/禁用精確搜索 |
-itsoffset time_off | set the input ts offset | 設置輸入ts的偏移量 |
-itsscale scale | set the input ts scale | 設置輸入ts比例 |
-dframes number | set the number of data frames to output | 設置要輸出的數據幀數 |
-re | read input at native frame rate | 以原始幀速率讀取輸入 |
-shortest | finish encoding within shortest input | 在最短的輸入內完成編碼 |
-bitexact | bitexact mode | 位精確模式 |
-copyinkf | copy initial non-keyframes | 復制初始非關鍵幀 |
-copypriorss | copy or discard frames before start time | 在開始時間之前復制或丟棄幀 |
-tag fourcc/tag | force codec tag/fourcc | 強制編解碼器標簽/ fourcc |
-q q | use fixed quality scale (VBR) | 使用固定質量量表(VBR) |
-qscale q | use fixed quality scale (VBR) | 使用固定質量量表(VBR) |
-profile profile | set profile | 設定個人資料 |
-attach filename | add an attachment to the output file | 將附件添加到輸出文件 |
-dump_attachment filename | extract an attachment into a file | 將附件提取到文件中 |
-stream_loop loop count | set number of times input stream shall be looped | 設置輸入流應循環的次數 |
-thread_queue_size | set the maximum number of queued packets from the demuxer | 設置來自多路分解器的排隊數據包的最大數量 |
-find_stream_info | read and decode the streams to fill missing information with heuristics | 讀取和解碼流以使用啟發式方法填充丟失的信息 |
-autorotate | automatically insert correct rotate filters | 自動插入正確的旋轉濾鏡 |
-muxdelay seconds | set the maximum demux-decode delay | 設置最大多路分解解碼延遲 |
-muxpreload seconds | set the initial demux-decode delay | 設置初始多路分配解碼延遲 |
-time_base ratio | set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5) | 設置輸出流的所需時基提示 (1:24, 1:48000 or 0.04166, 2.0833e-5) |
-enc_time_base ratio | set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). two special values are defined - 0 = use frame rate (video) or sample rate (audio),-1 = match source time base | 設置編碼器所需的時基(1:24, 1:48000 or 0.04166, 2.0833e-5). 定義了兩個特殊值-0 =使用幀率(視頻)或采樣率(音頻),-1 =匹配源時基 |
-bsf bitstream_filters | A comma-separated list of bitstream filters | 以逗號分隔的位流過濾器列表 |
-fpre filename | set options from indicated preset file | 從指示的預設文件設置選項 |
-max_muxing_queue_size packets | maximum number of packets that can be buffered while waiting for all streams to initialize | 等待所有流初始化時可以緩沖的最大數據包數 |
-dcodec codec | force data codec ('copy' to copy stream) | 強制數據編解碼器(“復制”以復制流) |
Video options: | 視頻選項: | |
-vframes number | set the number of video frames to output | 設置要輸出的視頻幀數 |
-r rate | set frame rate (Hz value, fraction or abbreviation) | 設置幀頻(Hz值,分數或縮寫) |
-s size | set frame size (WxH or abbreviation) | 設置幀大小(WxH或縮寫) |
-aspect aspect | set aspect ratio (4:3, 16:9 or 1.3333, 1.7777) | 設置縱橫比(4:3、16:9或1.3333、1.7777) |
-bits_per_raw_sample | number set the number of bits per raw sample | 數字設置每個原始樣本的位數 |
-vn | disable video | 禁用視頻 |
-vcodec codec | force video codec ('copy' to copy stream) | 強制視頻編解碼器(“復制”以復制流) |
-timecode hh:mm:ss[:;.]ff | set initial TimeCode value. | 設置初始TimeCode值。 |
-pass n | select the pass number (1 to 3) | 選擇通行證編號(1至3) |
-vf filter_graph | set video filters | 設置視頻過濾器 |
-ab bitrate | audio bitrate (please use -b:a) | 音頻比特率(請使用-b:a) |
-b bitrate | video bitrate (please use -b:v) | 視頻比特率(請使用-b:v) |
-dn | disable data | 禁用數據 |
Advanced Video options: | 進階影片選項: | |
-pix_fmt format | set pixel format | 設置像素格式 |
-intra | deprecated use -g 1 | 不推薦使用-g 1 |
-rc_override override | rate control override for specific intervals | 特定時間間隔的速率控制優先 |
-passlogfile prefix | select two pass log file name prefix | 選擇兩個通過日志文件名的前綴 |
-deinterlace | this option is deprecated, use the yadif filter instead | 不建議使用此選項,請改用yadif過濾器 |
-psnr | calculate PSNR of compressed frames | 計算壓縮幀的PSNR |
-vstats | dump video coding statistics to file | 將視頻編碼統計信息轉儲到文件 |
-vstats_file file | dump video coding statistics to file | 將視頻編碼統計信息轉儲到文件 |
-vstats_version | Version of the vstats format to use. | 要使用的vstats格式的版本。 |
-intra_matrix matrix | specify intra matrix coeffs | 指定內部矩陣系數 |
-inter_matrix matrix | specify inter matrix coeffs | 指定矩陣間系數 |
-chroma_intra_matrix matrix | specify intra matrix coeffs | 指定內部矩陣系數 |
-top | top=1/bottom=0/auto=-1 field first | top = 1 / bottom = 0 / auto = -1首先 |
-vtag fourcc/tag | force video tag/fourcc | 強制視頻標簽/ fourcc |
-qphist | show QP histogram | 顯示QP直方圖 |
-force_fps | force the selected framerate, disable the best supported framerate selection | 強制選定幀率,禁用最佳支持的幀率選擇 |
-streamid streamIndex:value | set the value of an outfile streamid | 設置輸出文件流ID的值 |
-force_key_frames timestamps | force key frames at specified timestamps | 在指定的時間戳上強制關鍵幀 |
-hwaccel hwaccel name | use HW accelerated decoding | 使用硬件加速解碼 |
-hwaccel_device devicename | select a device for HW acceleration | 選擇用於硬件加速的設備 |
-hwaccel_output_format format | select output format used with HW accelerated decoding | 選擇用於硬件加速解碼的輸出格式 |
-vc channel | deprecated, use -channel | 不推薦使用,使用-channel |
-tvstd standard | deprecated, use -standard | 不推薦使用,使用-standard |
-vbsf video bitstream_filters | deprecated | 不推薦使用 |
-vpre preset | set the video options to the indicated preset | 將視頻選項設置為指示的預設 |
Audio options: | 音頻選項: | |
-aframes number | set the number of audio frames to output | 設置要輸出的音頻幀數 |
-aq quality | set audio quality (codec-specific) | 設置音頻質量(特定於編解碼器) |
-ar rate | set audio sampling rate (in Hz) | 設置音頻采樣率(以Hz為單位) |
-ac channels | set number of audio channels | 設置音頻通道數 |
-an | disable audio | 禁用音頻 |
-acodec codec | force audio codec ('copy' to copy stream) | 強制音頻編解碼器(“復制”以復制流) |
-vol volume | change audio volume (256=normal) | 更改音量(256 =正常) |
-af filter_graph | set audio filters | 設置音頻過濾器 |
Advanced Audio options: | 高級音頻選項: | |
-atag fourcc/tag | force audio tag/fourcc | 強制音頻標簽/ fourcc |
-sample_fmt format | set sample format | 設置樣本格式 |
-channel_layout layout | set channel layout | 設置頻道布局 |
-guess_layout_max | set the maximum number of channels to try to guess the channel layout | 設置最大通道數以嘗試猜測通道布局 |
-absf audio bitstream_filters | deprecated | 不推薦使用 |
-apre preset | set the audio options to the indicated preset | 將音頻選項設置為指示的預設 |
Subtitle options: | 字幕選項: | |
-s size | set frame size (WxH or abbreviation) | 設置幀大小(WxH或縮寫) |
-sn | disable subtitle | 禁用字幕 |
-scodec codec | force subtitle codec ('copy' to copy stream) | 強制字幕編解碼器(“復制”以復制流) |
-stag fourcc/tag | force subtitle tag/fourcc | 強制字幕標簽/ fourcc |
-fix_sub_duration | fix subtitles duration | 修正字幕的持續時間 |
-canvas_size size | set canvas size (WxH or abbreviation) | 設置畫布大小(WxH或縮寫) |
-spre preset | set the subtitle options to the indicated preset | 將字幕選項設置為指示的預設 |