Recent

Author Topic: [Solved] Slow calls to DLL ?  (Read 8868 times)

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #15 on: February 05, 2024, 09:55:14 am »
ffmpeg_Sdl2_library.zip Extract to the source code project directory.
looking forward to pascaler's discussion and help.

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #16 on: February 05, 2024, 10:29:19 am »
The demo should not be limited to FreePascal and Lazarus versions. Of course, things have improved in recent years.
The problem lies in this line of code:
//
Avcodec_ Decode_ Video2 (pCodecCtx, frame, frame_finished, @ packet);
//

The phenomenon I tested is that under Windows, this line of code is very fast.
Under arm64 Linux, it is very slow, and decoding a 1080P video takes 70 milliseconds. Normally, it should not exceed 25 milliseconds. But under arm64 Linux, loading ffmpeg decoding with qt is very fast, usually around 10 milliseconds.
Should I suspect that Freepassal calling the C runtime library under arm64 Linux may cause Obvious efficiency issues?

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #17 on: February 05, 2024, 10:39:10 am »
The demo defaults to playing the video.h264 (1080p) file in the main directory. You can also

Set filename to RTSP video stream.

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #18 on: February 05, 2024, 11:58:32 am »
demo download url: ftp://ftp://1:Test1234@121.40.151.139/
Complete directory tree: .png

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #19 on: February 06, 2024, 01:42:05 pm »
My FPC version is 3.2.2 Lazarus version is 2.2.6.

Thaddy

  • Hero Member
  • *****
  • Posts: 16340
  • Censorship about opinions does not belong here.
Re: [Solved] Slow calls to DLL ?
« Reply #20 on: February 06, 2024, 01:51:35 pm »
arm64 Linux? Is that a Raspberry Pi 5? In that case the VideoCore VI HW acceleration still lags behind the 32 bit version of the OS so some decoding is done on the CPU and not the GPU. Also note that third party distro's often do not even support VideoCore VI yet.
« Last Edit: February 06, 2024, 01:53:18 pm by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #21 on: February 06, 2024, 03:35:08 pm »
Perhaps my previous description was incomplete. CPU decoding is used, not GPU decoding.
CPU is Raspberry 5

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #22 on: February 06, 2024, 03:41:38 pm »
In my understanding, the decoding part is performed within the ffmpeg so library and will not be affected by
FPC, right? But the effect is very slow

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #23 on: February 18, 2024, 09:37:36 am »
Has no one paid attention to this issue? Perhaps they haven't encountered this problem

Thaddy

  • Hero Member
  • *****
  • Posts: 16340
  • Censorship about opinions does not belong here.
Re: [Solved] Slow calls to DLL ?
« Reply #24 on: February 18, 2024, 09:45:13 am »
Is your Pi 5 AARCH64(64 bit) or ARM32 Armv8 (32 bit) installed? AARCH64 has often some issues, not only on Raspberry Pi OS. Although here it works fine.
One of these issues is e.g. that ffmpeg does not use Videocore VI but the CPU.
Raspberry Pi's with the older Videocore IV use the GPU for ffmpeg, so that is currently much faster. In the - hopefully - near future that will change of course.
It has nothing to do with shared libraries loading slow. CPU is simply much slower than GPU optimized code.
« Last Edit: February 18, 2024, 09:56:01 am by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #25 on: February 18, 2024, 10:02:41 am »
It is interesting that on the same aarch64 machine, the ffmpeg dynamic library decoding display is normal (10 milliseconds per frame) when qt is called, and CPU is also used

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #26 on: February 18, 2024, 10:05:10 am »
What are the influencing factors? I really can't figure it out

Thaddy

  • Hero Member
  • *****
  • Posts: 16340
  • Censorship about opinions does not belong here.
Re: [Solved] Slow calls to DLL ?
« Reply #27 on: February 18, 2024, 10:10:16 am »
What I need to know if you installed Raspberry Pi OS as a 64 bit OS or a 32 bit OS.
The processor architecture does not matter. The OS does matter.
I can only test if I know that. Pi's enough with all kinds of configurations....
« Last Edit: February 18, 2024, 10:11:56 am by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #28 on: February 18, 2024, 01:56:27 pm »
@Thaddy, do you have a teamviewer? You can control my machine,
It is an arm64 system based on Ubuntu, but it is no longer raspberry pi.
The verification environment has been set up above, including Lazarus and QT.
My teamviewer ID: 166049595952
I am sending you the password privately.
thanks

cwlyj001

  • New Member
  • *
  • Posts: 23
Re: [Solved] Slow calls to DLL ?
« Reply #29 on: February 18, 2024, 04:17:41 pm »
@Thaddy, If the password is incorrect, it may be that my machine's teamviewer password has changed.
You tell me, I will send you the latest password private message.

 

TinyPortal © 2005-2018