On Mon, Jan 29, 2024 at 11:29 AM Zhao Zhili <quinkbl...@foxmail.com> wrote: > > > > > If someone can show me code in FFmpeg that parses loaded data as text, > > I can follow > > that and send a new patch. This is to avoid doing things the wrong > > way, as I'm a newcomer > > and don't know if there's existing code to do this. > > Check read_binary() in ffmpeg_filter.c for loading data from file and setting > AV_OPT_TYPE_BINARY > option value. > > Check pix_fmts option in buffersink.c for the consumer side of > AV_OPT_TYPE_BINARY. > > static const AVOption buffersink_options[] = { > { "pix_fmts", "set the supported pixel formats", OFFSET(pixel_fmts), > AV_OPT_TYPE_BINARY, .flags = FLAGS }, >
Thanks for giving directions. I find `FFTextReader` in libavformat/subtitles.h and can follow that to create a struct `FF3DLUTReader` to do text processing. But there's one problem I don't know how to solve. When using `AV_OPT_TYPE_BINARY`, the original file name is not available in the filter code, only the loaded data and length is available. Take a look at `ff_lut3d_init`, it relies on file name extension to detect LUT file type and call different parse functions. If we add another option to specify LUT file type, then vf_lut3d's command line option would require change. -- Best regards, Chen Yufei _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".