UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

Including FFmpeg libraries in Petalinux rootfs

Accepted Solution Solved
Highlighted
Visitor
Posts: 6
Registered: ‎07-21-2017
Accepted Solution

Including FFmpeg libraries in Petalinux rootfs

Hello,

 

I am trying to build Petalinux image which includes OpenCV libraries with FFmpeg support. I have configured my Petalinux project to include OpenCV libraries by using petalinux-config -c rootfs and selecting the opencv libraries; and as I check the built image it seems that all are correctly included. However as I run my application, I get an error that "libavformat.so.54: cannot open shared object file: No such file or directory". I checked the /usr/lib and noticed that ffmpeg libraries are not included. I am wondering how I could include them in the built image; I searched in for them through rootfs configuration, but I couldn't locate them. Could anyone help me with that issue please.

 

I have noticed http://www.wiki.xilinx.com/OpenCV+Installation however I can't relate between this and the issue I observe. I could find all those required FFmpeg libraries (such as libavcodec.so, libavformat.so,...) in Petalinux_install_path/tools/hsm/data/embeddedsw/ThirdParty/opencv/lib. So do I need to cross compile FFmpeg for ARM yet?

 

Thanks for your help and sorry if it's a dumb question.

 


Accepted Solutions
Visitor
Posts: 6
Registered: ‎07-21-2017

Re: Including FFmpeg libraries in Petalinux rootfs

Thank you so much Rocco for your great help and advice. I just noticed your reply as I didn't get any notification in my email and hopelessly though there is no reply here. I tried adding the custom library as advised in ug1144 and used the pre-compiled libraries available in <petalinux-install-dir>/tools/hsm/data/embeddedsw/ThirdParty/opencv/lib. Once I added them, it worked all fine and after that the option of new my added library was available when I run petalinux-config -c rootfs so I could simply select/deselect the library to be included in the rootfs any time later.

 

Anyway, thanks a lot for your help, I learnt new ways from you; really appreciate it.

 

 

View solution in original post


All Replies
Adventurer
Posts: 97
Registered: ‎10-14-2015

Re: Including FFmpeg libraries in Petalinux rootfs

it is easier than you might think, as the ffmpeg recipe is already included in petalinux-2017.2

you can find the recipe in <petalinux_source_dir>/components/yocto/source/arm/layers/core/meta/recipes-multimedia/

 

1) in your <project_dir>/project-spec/meta-user/recipes-core/images/petalinux-image.bbappend add the following line:

 IMAGE_INSTALL_append = " ffmpeg"  (be aware of the extra space)

2) in petalinux-config -c rootfs -> user packages, enable ffmpeg

 

that's it!

Visitor
Posts: 6
Registered: ‎07-21-2017

Re: Including FFmpeg libraries in Petalinux rootfs

Thanks a lot roccobrandi, I am using Petalinux-2016.1 as I need to keep it compatible with my Vivado version. I develop the hardware part in Vivado-2016.1. It's good to know that ffmpeg recipe is included in Petalinux-2017.2 so I might move to that version later. Do you  think there could be any option to solve the issue within 2016.1? I am thinking of adding the libraries as custom libraries at the moment; not really sure if it works fine though.

 

Thanks again.

Adventurer
Posts: 97
Registered: ‎10-14-2015

Re: Including FFmpeg libraries in Petalinux rootfs

I have downloaded the FFmpeg source code. it doesn't have a configure file but it already has a makefile.

 

what you can do is to create a petalinux application called "ffmpeg" and copy all FFmpeg source code into the new application folder. petalinux should set auomaticcaly the compiler and other flags, but you have to pass manually your root directory, where to install files. specifically the final files and libraries should be installed in <your_petalinux_proj_dir>/build/linux/rootfs/targetroot/

you have to be sure also that the required libraries have been compiled and installed BEFORE FFmpeg get compiled.

 

again, the include path for the FFmpeg makefile should point to the file system under <your_petalinux_proj_dir>/build/linux/rootfs/targetroot/

 

Regards,

Rocco

Visitor
Posts: 6
Registered: ‎07-21-2017

Re: Including FFmpeg libraries in Petalinux rootfs

Thank you so much Rocco for your great help and advice. I just noticed your reply as I didn't get any notification in my email and hopelessly though there is no reply here. I tried adding the custom library as advised in ug1144 and used the pre-compiled libraries available in <petalinux-install-dir>/tools/hsm/data/embeddedsw/ThirdParty/opencv/lib. Once I added them, it worked all fine and after that the option of new my added library was available when I run petalinux-config -c rootfs so I could simply select/deselect the library to be included in the rootfs any time later.

 

Anyway, thanks a lot for your help, I learnt new ways from you; really appreciate it.