本文档记录qiyi-filter的生成和使用方法
文件说明
涉及到四个文件
vf_qrestore.c
qrestore.h
qrestore.cpp
vf_qrestore
提供的是qiyi-ffmpeg
数据到libtorch数据转换和接口调用qrestore
实现了质量恢复方法,提供c wrapper
调用 c++接口函数和libtorch
库文件
集成步骤
集成步骤主要分四部:
所有文件放到
libavfilter
目录下。在
libavfilter/allfilters.c
文件中新增REGISTER_FILTER(QRESTORE, qrestore, vf);
修改
libavfilter/Makefile
文件,将需要编译的c文件引用进来OBJS-$(CONFIG_QRESTORE_FILTER) += vf_qrestore.o
修改
libavfilter/Makefile
文件,将需要编译的cpp和h文件引用进来,在HEADERS
处添加qrestore.h
,在OBJS
处添加qrestore.h
配置
config-qiyi-simple
,链接libtorch
库,这里给出config-qiyi-simple
配置:
./configure --enable-yasm --enable-static --enable-nonfree --enable-gpl --disable-filter=intertrustwm --disable-filter=iqiyiwm --disable-filter=css --disable-optimizations --extra-cflags="-I/data/source/wrappertest/src -I/data/source/Qrestore/src -I/data/source/pytorch/torch/lib/tmp_install/include" --extra-cxxflags="-std=c++11" --extra-ldflags="-L/data/source/pytorch/torch/lib/tmp_install/lib -L/usr/local/cuda/lib64 -L/usr/local/lib -L/data/source/wrappertest/src -L/data/source/Qrestore/src/build" --extra-libs="-lCppAddWrapper -lCppAdd -ltorch -lcuda -lnvrtc -lnvToolsExt -lcudart_static -lpthread -ldl -lrt -lcaffe2 -lcaffe2_gpu -lc10 -lc10_cuda -lcufft -lcurand -lcudnn -lculibos -lcublas -lcublas_device -lstdc++" --prefix=/usr/local/ffmpeg_new_master |
使用
filter
使用
./ffmpeg -i input -vf qrestore output |
函数调用
: #include "qrestore.h" |
Comments