Closed chudsaviet closed 1 year ago
Thanks for your contribution!
@guysoft , I see this pull request caused build time to increase from 10 minutes to 2 hours. I can go disable unnecessary codecs from ffmpeg build, but it won’t help dramatically.
I wonder if there is a way ffmpeg could be built once, and then the binary just downloaded from somewhere as part of the OctoPi image? Since it is building from a specific commit it seems like it shouldn't have to re-build every time.
Should be able to be built once. I will have to look in to it though
Could be built and exported once using copy_and_export_folder
from CustomPiOS. Then loaded if it already exists from a web server.
@chudsaviet Hey, This is currently breaking the nightly, because the nightly build is done on a raspberrypi running a 32bit userspace and a 64bit kernel.
The ffmpeg build determines the build arch according to the kernel used and this causes the build to fail.
There should be a flag to tell it explicitly based on on what CustomPiOS is building what arch to build for.
Attaching a filed log:
cd FFmpeg-FFmpeg-9450f75
+ ./configure --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-ffplay --disable-ffprobe
install prefix /usr/local
source path .
C compiler gcc
C library glibc
ARCH aarch64 (genericcd FFmpeg-FFmpeg-9450f75
+ ./configure --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-ffplay --disable-ffprobe
install prefix /usr/local
source path .
C compiler gcc
C library glibc
ARCH aarch64 (generic
I was building in Docker on a M1 Mac, both 32 bit and 64bit worked.
Anyway, we will have to switch to prebuilt binary. And when FFmpeg will have the next version released, we will be able to switch back to FFmpeg from repository.
I think there should be a way to pass the configure what arch to build for.
Yes, I believe configure uses arch command to determine architecture.
Fixed, builds on both now
Current devel branch exports ffmpeg HLS that is built to the workspace folder. So we could have some logic that you place that inside OctoPi/src/modules/octopi/filesystem/hls
. Then the build script can use unpack and check it it has a pre-built binary or not. So you could have a shorter build time.
I see. Exact mechanism is not the problem.
The problem is managing binaries and their security. I'm not very eager to go this deep. Also, after next FFmpeg version will be released, we will be able just to use ffmpeg from OS repo.
I was working on next things:
It seems like it would just be best to wait after FFmpeg version will be released.
We might want to add instructions how to activate it if you would like to add that
Yeah, sorry, I had much work last couple of weeks.
“activate it” - what do you mean?
“I am not sure what to remove” - there are dozens of codecs in ffmpeg, and for HLS, we don’t need most of them. We can build a limited ffmpeg just for HLS, and use standard ffmpeg from repository for everything else.
I mean that I am not sure the setting in octopi.txt is documented.
It was experimental, so I haven't documented it in the past.
Which document shall I put the info to?
It should go https://github.com/guysoft/OctoPi/wiki But that also needs some care ATM, I don't know if its worth sending you there to document. Unless if you think it would help.
Tested on Raspberry Pi OS 32bit and 64bit. CPU load on Rpi4 is around 10%.