[FFmpeg-devel] AVFrame and enum AVMediaType

Soft Works softworkz at hotmail.com
Fri Aug 13 05:13:25 EEST 2021


Hi,

I have a question: Is there a specific reason why AVFrame does not have 
a property indicating the AVMediaType?

Instead, the type is mostly tried to be inferred from other properties, e.g.
AVMEDIA_TYPE_VIDEO when width and height are specified or channel format
in case of audio.

Though I don't want to discuss the modelling aspect that is involved and
I suppose that this has reasons and/or history. 

It just causes a straight an simple problem: when extending the filtergraph
processing to allow subtitles (attached to frames) flowing through the graph, 
this causes a little problem, because in case of graphical subs, the frames
will have a width and height (canvas size) just like video frames. 
At this point, the assumption "has width/height ==> video frame" is no longer 
valid.

From that background, I'm wondering whether it would be acceptable to add
A property of type AVMediaType to AVFrame?

Would somebody prefer a different solution?

Thanks,
sw


More information about the ffmpeg-devel mailing list