DEgITx
DEgITx

Reputation: 980

FFmpeg av_read_frame and maximum packet size

Any possibility to detect maximum packet (AVpacket) size that av_read_frame() can read?

Upvotes: 8

Views: 2382

Answers (1)

av501
av501

Reputation: 6729

I was looking for the same recently. It appears that av_read_frame internally calls a codec specific read_packet function for each codec/format. This in turns allocate memory per packet and frees it depending on the maximum limits that the codec/format poses. So as long as you have memory to support the (in)valid stream you should be fine and the limits are specific to the codec/format decoders. [YOu can find the function defined in AVInputFormat for each format as .read_packet ].

Upvotes: 2

Related Questions