Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFmpeg av_read_frame and maximum packet size

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

like image 782
DEgITx Avatar asked Jun 25 '12 12:06

DEgITx


1 Answers

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 ].

like image 78
av501 Avatar answered Oct 05 '22 09:10

av501