U
U
UnknownUser2019-09-24 22:47:30
linux
UnknownUser, 2019-09-24 22:47:30

How to compile Omxplayer for Raspbian?

Hello.
There was a need to tweak something inside Omxplayer for Raspberry Pi.
I copied the sources from here https://github.com/popcornmix/omxplayer and followed the instructions for compiling directly on Malinka, that is, running

./prepare-native-raspbian.sh #затем запуск недостающих зависимостей
make ffmpeg
make -j$(nproc)

1) The first surprise was a compilation error, which said that some header files were not found.
Those were inside the ffmeg folder, which in turn is located in the Omxplayer's source folder.
2) The problem was solved by downloading/compiling FFmpeg separately.
3) Next, everything that was in the omxplayer/Makefile.ffmpeg file was deleted.
Now the compilation is interrupted with the following (I copy only the final part, I think this is enough for understanding):
spoiler
/usr/bin/ld: //usr/local/lib/libavformat.a(srtp.o): in function `ff_srtp_encrypt':

/home/pi/omx2/FFmpeg/libavformat/srtp.c:305: undefined reference to `av_aes_init'

/usr/bin/ld: //usr/local/lib/libavformat.a(srtp.o): in function `encrypt_counter':

/home/pi/omx2/FFmpeg/libavformat/srtp.c:48: undefined reference to `av_aes_crypt'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/srtp.c:48: undefined reference to `av_aes_crypt'

/usr/bin/ld: //usr/local/lib/libavformat.a(srtp.o): in function `ff_srtp_encrypt':

/home/pi/omx2/FFmpeg/libavformat/srtp.c:313: undefined reference to `av_hmac_init'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/srtp.c:314: undefined reference to `av_hmac_update'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/srtp.c:320: undefined reference to `av_hmac_final'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/srtp.c:313: undefined reference to `av_hmac_init'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/srtp.c:314: undefined reference to `av_hmac_update'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/srtp.c:318: undefined reference to `av_hmac_update'

/usr/bin/ld: //usr/local/lib/libavformat.a(cache.o): in function `cache_close':

/home/pi/omx2/FFmpeg/libavformat/cache.c:314: undefined reference to `av_tree_enumerate'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/cache.c:315: undefined reference to `av_tree_destroy'

/usr/bin/ld: //usr/local/lib/libavformat.a(cache.o): in function `cache_read':

/home/pi/omx2/FFmpeg/libavformat/cache.c:168: undefined reference to `av_tree_find'

/usr/bin/ld: //usr/local/lib/libavformat.a(cache.o): in function `add_entry':

/home/pi/omx2/FFmpeg/libavformat/cache.c:125: undefined reference to `av_tree_find'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/cache.c:135: undefined reference to `av_tree_node_alloc'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/cache.c:144: undefined reference to `av_tree_insert'

/usr/bin/ld: //usr/local/lib/libavformat.a(crypto.o): in function `crypto_close':

/home/pi/omx2/FFmpeg/libavformat/crypto.c:384: undefined reference to `av_aes_crypt'

/usr/bin/ld: //usr/local/lib/libavformat.a(crypto.o): in function `crypto_write':

/home/pi/omx2/FFmpeg/libavformat/crypto.c:356: undefined reference to `av_aes_crypt'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/crypto.c:352: undefined reference to `av_aes_crypt'

/usr/bin/ld: //usr/local/lib/libavformat.a(crypto.o): in function `crypto_read':

/home/pi/omx2/FFmpeg/libavformat/crypto.c:214: undefined reference to `av_aes_crypt'

/usr/bin/ld: //usr/local/lib/libavformat.a(crypto.o): in function `crypto_open2':

/home/pi/omx2/FFmpeg/libavformat/crypto.c:151: undefined reference to `av_aes_alloc'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/crypto.c:156: undefined reference to `av_aes_init'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/crypto.c:166: undefined reference to `av_aes_alloc'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/crypto.c:171: undefined reference to `av_aes_init'

/usr/bin/ld: //usr/local/lib/libavformat.a(md5proto.o): in function `md5_close':

/home/pi/omx2/FFmpeg/libavformat/md5proto.c:64: undefined reference to `av_md5_final'

/usr/bin/ld: //usr/local/lib/libavformat.a(md5proto.o): in function `md5_write':

/home/pi/omx2/FFmpeg/libavformat/md5proto.c:52: undefined reference to `av_md5_update'

/usr/bin/ld: //usr/local/lib/libavformat.a(md5proto.o): in function `md5_open':

/home/pi/omx2/FFmpeg/libavformat/md5proto.c:41: undefined reference to `av_md5_alloc'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/md5proto.c:44: undefined reference to `av_md5_init'

/usr/bin/ld: //usr/local/lib/libavformat.a(rtmpdigest.o): in function `ff_rtmp_calc_digest':

/home/pi/omx2/FFmpeg/libavformat/rtmpdigest.c:39: undefined reference to `av_hmac_alloc'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/rtmpdigest.c:43: undefined reference to `av_hmac_init'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/rtmpdigest.c:47: undefined reference to `av_hmac_update'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/rtmpdigest.c:48: undefined reference to `av_hmac_update'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/rtmpdigest.c:50: undefined reference to `av_hmac_final'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/rtmpdigest.c:52: undefined reference to `av_hmac_free'

/usr/bin/ld: /home/pi/omx2/FFmpeg/libavformat/rtmpdigest.c:45: undefined reference to `av_hmac_update'

/usr/bin/ld: //usr/local/lib/libswresample.a(resample.o): in function `multiple_resample':

/home/pi/omx2/FFmpeg/libswresample/resample.c:454: undefined reference to `av_get_cpu_flags'

collect2: error: ld returned 1 exit status

make: *** [Makefile:57: omxplayer.bin] Error 1

I know enough C++ to more or less understand what is written inside the sources, but unfortunately, I swim in the issues of compiling for *nix's. Perhaps the problem is that what was done in paragraph 3) is not enough or not quite right.
I'm doing all of this on a Raspberry Pi 2 under Rasbpian Buster, if that's a big deal.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
UnknownUser, 2019-09-24
@UnknownUser

So far, according to this link https://github.com/xplodwild/bbqscreen_client/issues/2 , I have swapped lswresample and lavutil in the Makefile, and the following order is obtained:

omxplayer.bin: version $(OBJS)

$(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvchostif -lvcos -ldbus-1 -lrt -lpthread -lswresample -lavcodec -lavformat -lavutil -lswscale -lpcre

$(STRIP) omxplayer.bin
The content of the error has changed a bit, it seems that if you play around with the location of the libraries, you can achieve what you want.
I'll try tomorrow, but now I need to sleep a little).
But if anyone can suggest a solution, that would be cool.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question