How to install GSM lib for FFMPEG?
It is a painful experience to compile and install GSM lib for FFMPEG in the environment of MINGW, whereas a good result gives me some comfort. I guess that many users will meet the same troubles as mine, so I write them to share with you. I think that it will be a great help for who like shot way, right?!
It is unlucky that I have not successfully compiled it in the latest version, for example, libgsm_1.0.10-13, because many errors burn my enthusiasm downL. At last, I give up. However, I believe that I can eliminate them later, and re-share them with you.
Anyway, this article focuses on the old version gsm-1.0.12.tar.gz. Likewise other libs, it needs patch(libgsm_1.0.10-13.diff.gz) to make it run, do you like it?! No matter what, we must follow the rule of open source. As mentioned before, open source is free for anything, and often gives you additional gifts. Enjoy them and happy day!
1. Download them form the hyperlink.
2. Uncompress them. It is very simple operation and shown in the following table.
$ tar xvzf ./gsm-1.0.12.tar.gz $ unzip ./ libgsm_1.0.10-13.diff.gz $ patch –p0 < ./ libgsm_1.0.10-13.diff |
3. Enter gsm folder.
$ cd ./gsm-1.0-pl12 |
4. Edit Makefile.
INSTALL_ROOT = /mingw GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include |
‘INSTALL_ROOT’ indicate the root to install lib and header files.
‘GSM_INSTALL_INC’ is error in the original file and correct it.
5. Make it! Why do you hesitate?!
$ make ./src/toast.o:toast.c:(.text+0x978): undefined reference to `fchmod' ./src/toast.o:toast.c:(.text+0x9af): undefined reference to `fchown' collect2: ld returned 1 exit status make: *** [bin/toast] Error 1 |
WOW, Angry?! Hit the desk heavy, and “$#2%%68sssZzzz#!!!”. Try my best to find gcc lib in the MINGW, unfortunately, it does not exist!!! Disappointed, unhelpful, …, come out! After some minute silence, A thinking arises in my brain, whether libgsm.a has been generated because toast.c looks like a testing program. After rechecking toast.c, it is confirmed. Great! Let’s go!
6. Install GSM into MINGW.
$ make install |
7. Install GSM into FFMPEG
$ ./configure --prefix=/mingw --enable-memalign-hack --enable-shared --disable-static --enable-w32threads --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-gpl --enable-avfilter --enable-postproc --enable-avfilter-lavf --enable-swscale --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libfaac --enable-libfaad --enable-libgsm $ make $make install |
Yeah, successful!
Summarize
1. Please keep patient when using the SW of open source. Good toast only can be enjoyed after making efforts!
2. Recheck the configurations in terms of the compiling errors. This case indicates that we can obtain the result even if compiler shows the unrelated errors.
3. After failing to deal with them, please search whether wise users have another solution.