Skip to content

Time consumption of ffio

dongrixinyu edited this page Jan 25, 2024 · 1 revision

test speed of ffio

  • aiming to test the speed of Python wrapper for FFmpeg-C-API compared with pure FFmpeg-C-API
  • The test condition:
    • AMD x86_64 (16 cpu cores),
    • Ubuntu 18.04, gcc, FFmpeg-6.0, Python 3.10.
    • video: 29.97fps, 1920*1080p, 2M/s
  • running 1 loop of decode-ffio is composed of decode-C(purely call FFmpeg-C-API to get 1 frame) and decode-py-convertor(convert C image frame to python format, numpy default). Same to encoder items.
  • The table below shows that decoding 1 frame costs 15.84ms in average, in which 1.49ms is used to convert decoded image in C format(unsigned char *) to python format(numpy, etc.). encoding 1 frame costs 11.96ms in average, in which 2.03ms is used to do C-py format conversion.
functions average cost time(ms) max cost time(ms) min cost time(ms)
decode-ffio 15.84 42.28 8.08
decode-C 14.34 40.43 7.00
decode-py-convertor 1.49 2.63 1.02
encode-ffio 11.96 22.65 10.37
encode-C 9.92 18.41 9.13
encode-py-convertor 2.03 4.49 1.05
Clone this wiki locally