Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Inclusion of FFmpeg Libraries #8

Open
Alexandertyler-zz opened this issue Nov 5, 2014 · 7 comments
Open

Inclusion of FFmpeg Libraries #8

Alexandertyler-zz opened this issue Nov 5, 2014 · 7 comments

Comments

@Alexandertyler-zz
Copy link

Hi, I compiled ffmpeg on linux and tried to include it into the project but it started throwing errors on the ffmpeg-jni.c file.

Here is the output:
/home/alex/Cs/youtube-yt-watchme-bca6784/app/src/main/jni/ffmpeg-jni.c
Error:(62, 3) error: 'for' loop initial declarations are only allowed in C99 or C11 mode
Error:(84, 3) error: format not a string literal and no format arguments [-Werror=format-security]
Warning:(103, 16) warning: assignment makes pointer from integer without a cast
Warning:(107, 18) warning: assignment makes pointer from integer without a cast
Error:(278, 3) error: 'for' loop initial declarations are only allowed in C99 or C11 mode
Warning:(298, 3) warning: 'avcodec_encode_video' is deprecated (declared at /home/alex/Cs/youtube-yt-watchme-bca6784/app/src/main/jni/libavcodec/avcodec.h:4476) [-Wdeprecated-declarations]
Warning:(345, 5) warning: 'avcodec_encode_audio' is deprecated (declared at /home/alex/Cs/youtube-yt-watchme-bca6784/app/src/main/jni/libavcodec/avcodec.h:4413) [-Wdeprecated-declarations]
int compressed_length = avcodec_encode_audio(audio_codec_ctx, out, 128000, AudioBuffer_Get());

@vshcryabets
Copy link
Contributor

This is weird because in yt-watchme/app/src/main/jni/Android.mk already defined C99 mode.

@ulukaya
Copy link
Contributor

ulukaya commented Nov 7, 2014

You need to build the ffmpeg with the provided JNI code and Android.mk
Also you need to cross-compile it as in: https://trac.ffmpeg.org/wiki/CompilationGuide/Android

@maximeloridan
Copy link

Hello,

I had exactly the same problem.
I have solved it this way: Do not try to generate the apk with android studio because it will not use the android.mk provided. Instead open a command line shell, go to the jni folder and enter the following command to build the native code:
$ ndk-build

With this, you will go further, but with this I am stuck with the following problem:
libavutil/common.h:83:23: fatal error: config.h: No such file or directory

And actually in this file, I have

ifdef HAVE_AV_CONFIG_H
include "config.h"
include "intmath.h"
endif

Is there someone else who had this problem?

Thank you!

@JavierCabanas
Copy link

Hi,
config.h is located in the ffmpeg source folder, you should copy to your "third_party/include" folder.
And intmath.h and other headers you may need could be found in libavutil, under ffmpeg source folder.

I don't remember the specific headers needed but all of them are in libavutil.

@brunoric
Copy link

I have the same problem. =(

I have tried to build with all FFmpeg sources at Compilation Guide but in all cases got some error. Can anyone that had a successful FFmpeg inclusion and app construction help us? I will keep trying and with any success I will post here. Thanks in advance!

@AlifKuan
Copy link

Hi, Guys
I'm trying to use the watch but I had many difficulties
With much efforts I compiled it but some .so file is still missing after compile
And when I click start screaming, the camera screen is displayed and app crashed after 2 or 3 seconds and no recording on event
Please give me an advice
Everything will be really appreciated

@achinverma
Copy link

hi, i need help to solve this error #35

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants