Replies: 2 comments 1 reply
-
Would you mind sharing the command(s) you used to link your Go program to ffmpeg? That could be an interesting section to add in the README 👍
Did you try to remove
I won't have enough time to spend on this time-consuming issue in the short term but I'm really interested in your conclusions. My guess is that even if you use a portion of |
Beta Was this translation helpful? Give feedback.
-
Update on September 13, 2024: After being occupied elsewhere for a while, I returned here to find that the main branch has caught up with FFmpeg 7.0. Consequently, I carried out a compilation test using the latest version. The testing process used examples/transcoding/main.go Step 1: Used just './configure' for initial setup. ./configure --enable-static # FFmpeg
go build -ldflags '-extldflags "-static"' . # astiav Go Compilation results:
Step 2: Removed non-dependent components based on pkg-config flags currently marked in ./configure --enable-static --disable-programs --disable-doc --disable-swresample --disable-postproc --disable-pthreads --disable-w32threads --disable-os2threads --disable-network Compilation results:
Cool, there wasn’t a significant change in size. However, unlike before, this package does not depend on Step 3: Removed symbol table; based on the settings from step 2, added
It is quite surprising that debugging information occupied such a large portion of the binary file. Currently, a 25MB binary file looks very compelling, which somewhat brings into question the necessity for further trimming. Additionally, after reading this comment about PR#70, I suspect that completely removing the |
Beta Was this translation helpful? Give feedback.
-
For various reasons, I started to explore more possibilities. After statically linking a Go program to FFmpeg, it ballooned to 120MB in size. Therefore, I wanted to use the rich customizable options of FFmpeg's
./configure
to disable the compilation of some components.Based on the components currently making up the pkgconfig:
I attempted to exclude libraries unrelated to these:
However, I encountered a compilation error:
cannot find '-lswscale'
. So, I removed--disable-swscale
from the compile script and tried again. This time, the error was:cannot find '-lswresample'
.These are all my attempts at trimming FFmpeg. Through these efforts, I've found it challenging to define the scope of trimming for the FFmpeg libraries.
With this context, I pose the question:
Can anyone help explore the minimal FFmpeg trimming that would still allow
go-astiav
to function properly?Beta Was this translation helpful? Give feedback.
All reactions