Integrate libtorch into a C program

I have tried to integrate ffmpeg with libtorch, but found that libtorch can not compiled by C. Did someone do this work sucessfully?

I don’t think PyTorch supports that.
You would likely need to define a wrapper library with extern “C” functions and compile that in C++. The wrapper can then be called from C.

Best regards

Thomas