youtube / yt-watchme

340 stars 134 forks source link

ffmpeg-jni.c:104: error: undefined reference to 'av_new_stream' #10

Open garyjamessilva opened 9 years ago

garyjamessilva commented 9 years ago

Hi,

I am getting ffmpeg-jni.c:104: error: undefined reference to 'av_new_stream' during C compilation (ndk-build) - when using latest versions of ffmpeg libraries & NDK r10c.

If a change the source code from -

audio_stream = av_new_stream(fmt_context, 1);

audio_stream = avformat_new_stream(fmt_context, 1);

11-12 22:29:17.253: I/ffmpeg-jni(7522): creating audio stream 11-12 22:29:17.253: A/libc(7522): Fatal signal 11 (SIGSEGV) at 0x00000009 (code=1), thread 7522 (id.apps.watchme)

Please advise / update ffmpeg-jni.c.

Is there some specific version of FFMPEG libraries required for successful build of the Watchme app ???

(I've spent over a week getting this far & I'm not giving up now ... ;-)

Regards

vshcryabets commented 9 years ago

For me it works with FFMPEG 2.3. But you right, in ffmpeg 2.4 this deprecated function was removed.

garyjamessilva commented 9 years ago

Ok thanks, I will give FFMPEG 2.3 a shot. And nice to know someone had got this app working ok.

vshcryabets commented 9 years ago

Also you will need libx264 from git://git.videolan.org/x264.git.

garyjamessilva commented 9 years ago

Yes I also included & built the x264 library, but I will double check its the same as git://git.videolan.org/x264.git Thanks again

maximeloridan commented 9 years ago

OK, good to know that there is some problems with the latest version (2.4) Have you taken "FFmpeg 2.3.5 "Mandelbrot"" under http://www.ffmpeg.org/olddownload.html?

One question for the libx264 livrary: I assume you have to retrieve it as it is mentionned here https://trac.ffmpeg.org/wiki/How%20to%20quickly%20compile%20libx264

cd /my/path/where/i/keep/compiled/stuff git clone git://git.videolan.org/x264.git cd x264 ./configure --enable-static --enable-shared make make install ldconfig

But when you have done that ,how do you include it to WatchMe?

Thank you!

garyjamessilva commented 9 years ago

Yes, download ffmpeg 2.3.5 from the link mentioned. For building libx264 you need to ./configure & build for cross compiling for Android and then ./configure (and make) ffmpeg to enable x264 support, see various examples that you can adapt for yourself - https://github.com/search?utf8=%E2%9C%93&q=ffmpeg+x264+android&type=Repositories&ref=searchresults The libx264.a library file produced needs to be copied into the WatchMe project - $(WORKING_DIR)/../third_party/lib/libx264.a (along with the other ffmpeg & associated library files) so that it can be linked when building libffmpeg.so

bipinsynerzip commented 8 years ago

Does anyone know AV_CODEC_ID_H264 Value ? Hard -Coded Value I just need to pass the Currect value avcodec_find_encoder(AV_CODEC_ID_H264) where i am getting undeclared Error..

Help needed here..