Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Trusted Contributor
Posts: 160
Registered: ‎09-13-2012
My Device: 9900
My Carrier: vodafone

ffmpeg compile issue

Hi all,

 

I am having a problem compiling ffmpeg to playbook compatible. This was suggested to me on Friday but it's took unti today to pluck up the courage to try!

 

My problem: arm-unknown-nto-qnx6.5.0eabi-gcc is unable to create an executable file.
C compiler test failed.

 

My env variables are set up because when i type arm-unknown-nto-qnx6.5.0eabi-gcc in command it expecs input file. My config file is ./configure --enable-cross-compile --target-os=qnx --cc=arm-unknown-nto-qnx6.5.0eabi-gcc --cxx=arm-unknown-nto-qnx6.5.0eabi-gcc --extra-ldflags='-Wl,-s ' --arch=armv6 but i have tried all other suggestions in other thread.

 

A posted on a simiar thread posted..

 

  problem was that i edit my user local bashrc, and needed to run configure command with sudo user, and of course, sudo user is not getting local user variables, so i edit /etc/bash.bashrc which is system wide version of it and now it is Ok, problem solved.

 

My problem is I don't really know what he means, could anybody clarify as this could be the same problem as mine.

 

I seached my pc for bash.bashrc but get no results.

 


Any help is appreciated.

 

Trusted Contributor
Posts: 160
Registered: ‎09-13-2012
My Device: 9900
My Carrier: vodafone

Re: ffmpeg compile issue

[ Edited ]

This is last of my log file in ffmpeg

 

mktemp -u XXXXXX
./configure: line 692: mktemp: command not found
check_ld cc
check_cc
BEGIN /tmp/ffconf..CHRISLAPTOP.500.2080.c
1 int main(void){ return 0; }
END /tmp/ffconf..CHRISLAPTOP.500.2080.c
arm-unknown-nto-qnx6.5.0eabi-gcc -c -o /tmp/ffconf..CHRISLAPTOP.500.2080.o /tmp/ffconf..CHRISLAPTOP.500.2080.c
as: unrecognized option `-EL'
C compiler test failed.

 

 

 

Thanks

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: ffmpeg compile issue

[ Edited ]

Which other thread are you refering to?

 

You may also want to check out these projects I made in github:

 

library for encoding / decoding / drawing on BB10 using ffmpeg:

https://github.com/hardisonbrewing/libffbb

 

Sample app that uses the above library:

https://github.com/hardisonbrewing/FFCameraSample

 

The libffbb also has precompiled lib files and the instructions I used to compile them.

Trusted Contributor
Posts: 160
Registered: ‎09-13-2012
My Device: 9900
My Carrier: vodafone

Re: ffmpeg compile issue

[ Edited ]

Hi mreed, the library is something i will be looking into (just dl it now). 

 

but I have just gotten past that error by running bbndk-env.sh via minGW and then tried to run ./myconfig and it worked but with something about ..

 

WARNING: arm-unknown-nto-qnx6.5.0eabi-pkg-config not found, library detection may fail.
WARNING: Compiler does not indicate floating-point ABI, guessing soft.

 

so then i run Make ..

 

$ make
library.mak:95: warning: overriding commands for target `install-libs-yes'
library.mak:95: warning: ignoring old commands for target `install-libs-yes'
library.mak:95: warning: overriding commands for target `install-libs-yes'
library.mak:95: warning: ignoring old commands for target `install-libs-yes'
library.mak:95: warning: overriding commands for target `install-libs-yes'
library.mak:95: warning: ignoring old commands for target `install-libs-yes'
library.mak:95: warning: overriding commands for target `install-libs-yes'
library.mak:95: warning: ignoring old commands for target `install-libs-yes'
library.mak:95: warning: overriding commands for target `install-libs-yes'
library.mak:95: warning: ignoring old commands for target `install-libs-yes'
library.mak:95: warning: overriding commands for target `install-libs-yes'
library.mak:95: warning: ignoring old commands for target `install-libs-yes'
make: touch: Command not found
make: *** No rule to make target `libavdevice/libavdevice.so', needed by `all-yes'. Stop.

 

Any ideas?

 

p.s heres the thread i refer to http://supportforums.blackberry.com/t5/Native-Development/FFMpeg-compile/td-p/1791909/page/3

Trusted Contributor
Posts: 160
Registered: ‎09-13-2012
My Device: 9900
My Carrier: vodafone

Re: ffmpeg compile issue

I'm seeing the relevence of the library now mreed, I can just skip manually building ffmpeg myself (overcoming the above error) and use the .so files with the library downoad. Please correct me if im wrong.

 

The problem i face now is that The camera sample seems to be in c++ and im ony just learning c so dont want to get confused even more.

 

My question to mreed or anybody else - How do i get the ffmpeg .so files contained within iibffbb folder (obviously copy paste!) to a newly created c project so i can start calling ffmpeg using c? I can then go away and learn more about c and ffmpeg because there seems to be lots of resources out there for there.

 

Thanks

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: ffmpeg compile issue

[ Edited ]

Couple things:

 

pkg-config not found

I see that warning too. Its fine. I don't recall any of the other warnings. First result in google is for MinGW, which I think you mentioned you were using. I'm on OSX, so I'm not sure about those.

 

I can just skip manually building ffmpeg myself (overcoming the above error) and use the .so files with the library downoad.

You should be able to. I'm not exactly sure what differences there are between building it with the BB10 NDK and PlayBook NDK... but theres nothing relying on the BB10 API, so I'm *guessing* those ffmpeg libs should work.

 

The camera sample seems to be in c++ and im ony just learning c so dont want to get confused even more.

Which platform are you using? The camera sample was based on one of the Cascades samples. Not sure you can get around avoiding c++ there.

 

How do i get the ffmpeg .so files contained within iibffbb folder (obviously copy paste!) to a newly created c project so i can start calling ffmpeg using c?

On the libffbb project page in github if you scroll down in the readme it mentions how its linking and including the ffmpeg libs in the BAR file. It may differ slightly depending on which type of NDK app you're making.

Trusted Contributor
Posts: 160
Registered: ‎09-13-2012
My Device: 9900
My Carrier: vodafone

Re: ffmpeg compile issue

Thanks mreed, I have just posted a new thread about third issue - compiling against ffmpeg. I am so new to native that I don't understand where i would put the device { Arch = .. } etc text (i have read the readme a good few times today)? I suspect in either bar-descriptor.xml or common.mk but not sure and also how to link to ffmpeg files (properly) using momentics.

 

Regarding building ffmpeg myself, i got to bad instruction 'ldrbgt lr... but cant get further than that - maybe to do with enabling neon but best i found. No solution to actually enabling it.

 

Just want to start to learn advanced c and calling ffmpeg so my udp bytes wil be shown!

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: ffmpeg compile issue

[ Edited ]

You should stick to one thread for that.

 

I have the Arch / LIBS+= settings in the .PRO file... but I'm using Cascades. You can skip the Arch setting part, thats just in there for switching between device/simulator. Not sure which makefile you'd need to put them in.. whichever one has the most in it already. I think the default has comments in the correct makefile saying to put custom stuff in there... so just look around i guess.

 

There does need to be additions to the bar file, but thats for including the lib files so they are available at runtime on the device.

Trusted Contributor
Posts: 160
Registered: ‎09-13-2012
My Device: 9900
My Carrier: vodafone

Re: ffmpeg compile issue

I have just gotten to the same point i did earlier, when i add the ARCH= and LIBS += to my common.mk I get no rule to make target 'lib-lcamapi.a' and the same for other libs if i remove that one. I have added the folder ffmpeg/include and public to my includes so right now I dont know what else to do.

 

I do always try to follow forum etiquette mreed (i knew i was teetering on receiving advice to do such though), I opened a more general thread because I'm just confused as to how to add libraries such as these to a project in momentics using the ndk. I see a lot of these third party libraries come in these files and i dont know how to use them currently because of this issue. 

 

If the answer comes in this thread - I won't complain Smiley Happy

 

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: ffmpeg compile issue

[ Edited ]

For ffmpeg you only need to worry about: -lavformat -lavcodec -lavutil

The -L should be the path to wherever you have the .SO files.

 

Looking at the NDK-Samples in the BlackBerry github... the common.mk is different from the .PRO setup. For LIBS+= you don't need the -l before the name. So it should just be:

LIBS += avformat avcodec avutil

 

I guess you should put the path to the lib files under EXTRA_LIBVPATH and the path to the include files under EXTRA_INCVPATH

 

Looking at this as the example:

https://github.com/blackberry/NDK-Samples/blob/master/Accelerometer/common.mk