亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

ffmpeg 有哪些filter

ffmpeg 有哪些filter

一只名叫tom的貓 2018-10-01 12:12:40
查看完整描述

1 回答

?
牛魔王的故事

TA貢獻1830條經驗 獲得超3個贊

  AVFilter
  所有我們寫的濾鏡都要用一個AVFilter結構體講給ffmpeg聽。 這個結構體里描述了ffmpeg從哪個方法進入我們的濾鏡。 這個結構體在libavfilter/avfilter.h里如下定義:
  
  01 typedef struct
  02 {
  03 char *name; ///< 濾鏡名稱
  04
  05 int priv_size; ///< 給濾鏡分配的內存大小
  06
  07 int (*init)(AVFilterContext *ctx, const char *args, void *opaque);
  08 void (*uninit)(AVFilterContext *ctx);
  09
  10 int (*query_formats)(AVFilterContext *ctx);
  11
  12 const AVFilterPad *inputs; ///< 一系列輸入 NULL terminated list of inputs. NULL if none
  13 const AVFilterPad *outputs; ///< 一系列輸出 NULL terminated list of outputs. NULL if none
  14 } AVFilter;
  “query_formats”方法用于設置可以接受的輸入圖像格式和輸出的圖像格式(用于濾鏡鏈分辨哪些濾鏡可以組合在一起用)。
  AVFilterPad
  這個濾鏡用于描述濾鏡的輸入輸出,在libavfilter/avfilter.h中定義如下:
  01 typedef struct AVFilterPad

  02 {
  03 char *name;
  04 int type;
  05
  06 int min_perms;
  07 int rej_perms;
  08
  09 void (*start_frame)(AVFilterLink *link, AVFilterPicRef *picref);
  10 AVFilterPicRef *(*get_video_buffer)(AVFilterLink *link, int perms);
  11 void (*end_frame)(AVFilterLink *link);
  12 void (*draw_slice)(AVFilterLink *link, int y, int height);
  13
  14 int (*request_frame)(AVFilterLink *link);
  15
  16 int (*config_props)(AVFilterLink *link);
  17 } AVFilterPad;
  頭文件里有十分具體的描述,這里大概解釋如下:
  輸入輸出pad都可以用的元素:
name pad的名字,所有的輸入pad名字不能重復,所有的輸出名字不能重復;
type 此元素目前只能為“AV_PAD_VIDEO”值
config_props 鏈接此pad的配置方法的函數指針
  僅限輸入pad使用的元素:
min_perms 接受輸入需要的最小權限
rej_perms 不接受的輸入權限
start_frame 一幀傳入時引用的方法的函數指針
draw_slice 每個slice已經傳入后引用的方法的函數指針
end_frame 一幀完整結束后引用的方法的函數指針
get_video_buffer 前一個濾鏡調用,用以為一個圖像請求內存
  僅限輸出pad使用的元素:
request_frame 請求濾鏡輸出一幀

查看完整回答
反對 回復 2018-10-17
  • 1 回答
  • 0 關注
  • 1270 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號