Closed xsy123xsy closed 2 years ago
如何配置https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/filtering_video.c 中的const char *filter_descr,从而使用ffmpeg中的atadenoise进行视频降噪
谢谢,但是没有看到atadenoise的filter_descr
atadenoise的filter_descr="atadenoise=2a",可以在java层添加。 参数列表如下: 0a Set threshold A for 1st plane. Default is 0.02. Valid range is 0 to 0.3.
0b Set threshold B for 1st plane. Default is 0.04. Valid range is 0 to 5.
1a Set threshold A for 2nd plane. Default is 0.02. Valid range is 0 to 0.3.
1b Set threshold B for 2nd plane. Default is 0.04. Valid range is 0 to 5.
2a Set threshold A for 3rd plane. Default is 0.02. Valid range is 0 to 0.3.
2b Set threshold B for 3rd plane. Default is 0.04. Valid range is 0 to 5.
Threshold A is designed to react on abrupt changes in the input signal and threshold B is designed to react on continuous changes in the input signal.
s Set number of frames filter will use for averaging. Default is 9. Must be odd number in range [5, 129].
p Set what planes of frame filter will use for averaging. Default is all.
a Set what variant of algorithm filter will use for averaging. Default is p parallel. Alternatively can be set to s serial.
谢谢,我在示例程序filtering_video.c中按照这种方式声明atadenoise滤镜: const char* filter_descr = "atadenoise=0a=0.2:1a=0.2:2a=0.2:0b=0.3:1b=0.3:2b=0.3"; 但是运行时open_input_file()这个函数返回一个负值,并且报错:cannot open input file 代码如下:
int ret;
AVPacket packet;
AVFrame* frame;
AVFrame* filt_frame;
std::string test_file_path_s = rx_video_resource_file_path("0.mp4");
char const* test_file_path = test_file_path_s.c_str();
// if (argc != 2) {
// fprintf(stderr, "Usage: %s file\n", argv[0]);
// exit(1);
// }
frame = av_frame_alloc();
filt_frame = av_frame_alloc();
if (!frame || !filt_frame) {
perror("Could not allocate frame");
exit(1);
}
if ((ret = open_input_file(test_file_path)) < 0)
goto end;
if ((ret = init_filters(filter_descr)) < 0)
goto end;
你好,请问是否有ffmpeg中的atadenoise降噪算法的调用实例