I'm currently trying to read small video files sent from a server
In order to read a file using libavformat, you are supposed to call
av_open_input_file(&avFormatContext, "C:\path\to\video.avi", 0, 0, 0);
The problem is that in this case the file is not on the disk, but in memory.
What I'm doing for the moment is downloading the file, writing it on the disk using a temporary name, and then calling av_open_input_file
with the temporary file name, which is not a very clean solution.
In fact what I want is a function like av_open_custom(&avFormatContext, &myReadFunction, &mySeekFunction);
but I didn't find any in the documentation.
I guess it is technically possible, since the name of the file is not something that helps the library determine which format it is using.
So is there a function like this, or an alternative to av_open_input_file?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…