yt-watchme
yt-watchme copied to clipboard
Pls provide compiled & working FFMPEG+Lame JNI Libs
I've got the app to start, create live events, but in my Live Control Room on Youtube Live (on web), I'm not receiving any stream. It shows as "streaming" on the app, but no stream received on Youtube Live.
I built ffmpeg as per https://github.com/cine-io/android-ffmpeg-with-rtmp, used the NDK to build it, included the streaming libraries, but it just doesn't show the streams on Youtube Live.
Would really appreciate some help here.
+1
+1
Ya this would be really nice. I do not understand why you would provide the source code for a app but not include any libraries it uses? Thats like giving you a brand new car with no engine, and then saying good luck with installing the engine.
+1 Is there somebody that already succeeded to make it all work?
After a lot of effort I got it to work correctly streaming video to youtube ok, but I could not get any audio through youtube. I then had to stop trying & go on with other work. (It is confusing having reference to both AAC & MP3 audio in the library build.)
This functionality should be included in the Android OS so we can just call with a few lines of code to get the project working.
@garyjamessilva can you please share your jni folder?
@brunoric
I've published the partly working my version of the project here -
https://www.dropbox.com/s/yshwhmlhg02zaqf/MainActivity.zip?dl=0
(It was too large to publish in github > 100MB)
- As mentioned I could not get audio to live stream through youtube, only video.
I built the project in Eclipse (adt-bundle-linux-x86_64-20140702, android-ndk-r10c & Android API V4.4W2) under Ubuntu V14.04. (I'm not using Android Studio as yet).
I built the FFMPEG (Version 2.3 !!!) & related library components as per these instructions - http://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu - but I crossed compiled for Android/ARM (not x86)
You will need to edit MainActivity.java & insert your own account key - public static final String ACCOUNT_KEY = "YOUR OWN apps.googleusercontent.com KEY GOES HERE !!!";
The project has a external dependency on google-play-services_lib, build that as per - http://developer.android.com/google/play-services/setup.html
You will also need to Export an unsigned APK and sign it manually as per - http://developer.android.com/tools/publishing/app-signing.html
Other than that you need to complete the Google Developers Console configuration details for this project as per - https://github.com/youtube/yt-watchme
Finally I advise you to read ALL opened & closed issues for this project, they contain details about overcoming some errors.
If anybody works out how to get audio to live stream as well as video please let me know.
Thank you for sharing your folder!
If someone succeeds to solve the audio problem too, it will be great, because I am not good enough to figure out how to solve it. I wonder if someone (except the one who has created the project) has already succeeded to make it all work. Is it not possible for him to share his JNI folder too? I wonder why it is not the case (if someone has an idea?)
Thanks anyway!
Thanks you made my day. Plz if you succed to make the audio function don't forget us ;)
does anybody make audio function works ?
@garyjamessilva did you find a way to fix that audio function?
Unfortunately no On 13/02/2015 1:58 pm, "pangguoming" [email protected] wrote:
@garyjamessilva https://github.com/garyjamessilva did you find a way to fix that audio function?
— Reply to this email directly or view it on GitHub https://github.com/youtube/yt-watchme/issues/16#issuecomment-74197254.
+1
Hey Guys.. so, I've re-built garyjamesilva's build in android studio after jumping through some hoops, and i'm running into the following error:
Error:Execution failed for task ':app:compileDebugNdk'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\android-ndk-r10d\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\Android.mk APP_PLATFORM=android-19 NDK_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj NDK_LIBS_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\lib APP_ABI=all Error Code: 2 Output: C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_init': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:104:3: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] video_stream = av_new_stream(fmt_context, 0); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:109:5: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] audio_stream = av_new_stream(fmt_context, 1); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeVideoFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:328:3: warning: 'avcodec_encode_video' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4444) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_video(video_codec_ctx, out, out_length, &source); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeAudioFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:375:5: warning: 'avcodec_encode_audio' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4381) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_audio(audio_codec_ctx, out, 128000, AudioBuffer_Get()); ^ C:\Users\danman\AppData\Local\Temp\ccYfLvZc.s: Assembler messages: C:\Users\danman\AppData\Local\Temp\ccYfLvZc.s:5770: Error: unexpected characters following instruction at operand 3 --
umull x14,x0,x12,x13' C:\Users\danman\AppData\Local\Temp\ccYfLvZc.s:5868: Error: unexpected characters following instruction at operand 3 --
umull x15,x4,x13,x14' make.exe: *** [C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/app/C_\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec\ac3dec_fixed.o] Error 1
the last warning is interesting -- why is avcodec.h using avcodec_encode_audio when it's deprecated? Has anyone else seen this?
Hi,
https://github.com/youtube/yt-watchme/issues/8 has mention of these warnings, as well as a possible work around for other errors (use ndk-build outside of Android Studio).
For your error, I'd also suggest changing APP_ABI=all to something less so that is not generating arm64-v8a code, unless that is the target you really need ( Nexus 9 perhaps ? )
Regards
On Tue, Feb 17, 2015 at 10:56 AM, danman81 [email protected] wrote:
Hey Guys.. so, I've re-built garyjamesilva's build in android studio after jumping through some hoops, and i'm running into the following error:
Error:Execution failed for task ':app:compileDebugNdk'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\android-ndk-r10d\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\Android.mk APP_PLATFORM=android-19 NDK_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj NDK_LIBS_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\lib APP_ABI=all Error Code: 2 Output: C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_init': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:104:3: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] video_stream = av_new_stream(fmt_context, 0); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:109:5: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] audio_stream = av_new_stream(fmt_context, 1); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeVideoFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:328:3: warning: 'avcodec_encode_video' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4444) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_video(video_codec_ctx, out, out_length, &source); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeAudioFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:375:5: warning: 'avcodec_encode_audio' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4381) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_audio(audio_codec_ctx, out, 128000, AudioBuffer_Get()); ^ C:\Users\danman\AppData\Local\Temp\ccYfLvZc.s: Assembler messages: C:\Users\danman\AppData\Local\Temp\ccYfLvZc.s:5770: Error: unexpected characters following instruction at operand 3 -- umull x14,x0,x12,x13' C:\Users\danman\AppData\Local\Temp\ccYfLvZc.s:5868: Error: unexpected characters following instruction at operand 3 --umull x15,x4,x13,x14' make.exe: *** [C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/app/C_\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec\ac3dec_fixed.o] Error 1
the last warning is interesting -- why is avcodec.h using avcodec_encode_audio when it's deprecated? Has anyone else seen this?
— Reply to this email directly or view it on GitHub https://github.com/youtube/yt-watchme/issues/16#issuecomment-74593349.
hey garyjamesilva, thanks for your help! I've tried both of of your suggestions, but still same error message!
so it looks like my error was caused by the way my libraries were setup in Android.mk. Now, I'm getting the following error:
Error:Execution failed for task ':app:compileDebugNdk'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\android-ndk-r10c\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\Android.mk APP_PLATFORM=android-19 NDK_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj NDK_LIBS_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\lib APP_ABI=all Error Code: 2 Output: C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'AudioBuffer_Push': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:62:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < num_samples; i++) { ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:62:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_init': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:104:3: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] video_stream = av_new_stream(fmt_context, 0); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:109:5: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] audio_stream = av_new_stream(fmt_context, 1); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeVideoFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:308:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < frame_size / 4; i++) { ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:328:3: warning: 'avcodec_encode_video' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4444) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_video(video_codec_ctx, out, out_length, &source); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeAudioFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:375:5: warning: 'avcodec_encode_audio' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4381) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_audio(audio_codec_ctx, out, 128000, AudioBuffer_Get()); ^ make.exe: *** [C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/app/C_\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.o] Error 1
well, avcodec.h even says that avcodec_encode_audio2 should be used instead, and i wonder if that has anything to do with your audio problem? granted, i have some other errors so i'm fixing those first, but wanted to let you know about this, garyjamessilva!
Hi danman81,
Thanks for that, let us all know if you get any further using avcodec_encode_audio2 instead of the deprecated avcodec_encode_audio calls.
Looking quickly the call parms are different so some additional work is likely required...
int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples);
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr);
Regards garyjamessilva
On Wed, Feb 18, 2015 at 12:40 PM, danman81 [email protected] wrote:
so it looks like my error was caused by the way my libraries were setup in Android.mk. Now, I'm getting the following error:
Error:Execution failed for task ':app:compileDebugNdk'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\android-ndk-r10c\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\Android.mk APP_PLATFORM=android-19 NDK_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj NDK_LIBS_OUT=C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\lib APP_ABI=all Error Code: 2 Output: C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'AudioBuffer_Push': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:62:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < num_samples; i++) { ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:62:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_init': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:104:3: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] video_stream = av_new_stream(fmt_context, 0); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:109:5: warning: 'av_new_stream' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavformat/avformat.h:2167) [-Wdeprecated-declarations] audio_stream = av_new_stream(fmt_context, 1); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeVideoFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:308:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < frame_size / 4; i++) { ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:328:3: warning: 'avcodec_encode_video' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4444) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_video(video_codec_ctx, out, out_length, &source); ^ C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c: In function 'Java_com_google_android_apps_watchme_Ffmpeg_encodeAudioFrame': C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.c:375:5: warning: 'avcodec_encode_audio' is deprecated (declared at C:\AndroidStudioProjects\yt-watchme\app\src\main\jni\libavcodec/avcodec.h:4381) [-Wdeprecated-declarations] int compressed_length = avcodec_encode_audio(audio_codec_ctx, out, 128000, AudioBuffer_Get()); ^ make.exe: *** [C:\AndroidStudioProjects\yt-watchme\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/app/C_\AndroidStudioProjects\yt-watchme\app\src\main\jni\ffmpeg-jni.o] Error 1
well, avcodec.h even says that avcodec_encode_audio2 should be used instead, and i wonder if that has anything to do with your audio problem? granted, i have some other errors so i'm fixing those first, but wanted to let you know about this, garyjamessilva!
— Reply to this email directly or view it on GitHub https://github.com/youtube/yt-watchme/issues/16#issuecomment-74794994.
oh yes, there is definitely some work to do here, but the real question is who is going to man up and do it
btw, got it to compile finally (thanks ckarthikv!)
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
here's a new thread that was started for the audio problem.
https://github.com/youtube/yt-watchme/issues/23
hey @AlifKuan -- why don't you try downloading @garyjamessilva 's precompiled libraries above? they do work, but we are still stuck on this audio problem...
Hi, Danman81 You mean https://github.com/garyjamessilva/FFmpeg? How can I integrate it in android studio?Please give me detailed explain Thanks in advance
Hi,
No not on github on dropbox see my comments earlier in https://github.com/youtube/yt-watchme/issues/16
Also this was originally done in Eclipse not Android Studio, you'll needs to work that out yourself.
Regards On Mar 30, 2015 11:48 AM, "AlifKuan" [email protected] wrote:
Hi, Danman81 You mean https://github.com/garyjamessilva/FFmpeg? How can I integrate it in android studio?Please give me detailed explain Thanks in advance
— Reply to this email directly or view it on GitHub https://github.com/youtube/yt-watchme/issues/16#issuecomment-87504462.
( I have deleted https://github.com/garyjamessilva/FFmpeg it was just an unused clone, for FFMPEG see https://github.com/FFmpeg/FFmpeg instead )
Hey everybody, is someone able to solve the audio problem? If it is complicated or takes too much time, we will pay for your service! Thanks in advance for your message!
Hi,
I'm still too busy for the next month or so to go back & fix the audio problem, but if you are willing to pay you might try contacting this developer for help -
https://play.google.com/store/apps/details?id=com.rotw.android.bigve&hl=en
https://www.youtube.com/watch?v=pcSYf9pmpcU
http://bigvstudio.com/
Let us know if you make any progress.
Regards
On Sat, Apr 4, 2015 at 10:59 PM, Oliver B. [email protected] wrote:
Hey everybody, is someone able to solve the audio problem? If it is complicated or takes too much time, we will pay for your service! Thanks in advance for your message!
— Reply to this email directly or view it on GitHub https://github.com/youtube/yt-watchme/issues/16#issuecomment-89556682.
Hey @danman81, I have the same compilation problem on task ':app:compileDebugNdk'. How did you solve those problems??
Thanks.
I used @garyjamessilva 's MainActivity solution but tweaked it to compile for gradle. Already included it in my own private project so I don't want to share that source, but I will share my gradle build as well as my gitignore. Gitignore is important to limit the 600mb version after building everything to the smallest amount of source/library files that will compile into the rest of it, which is about 100mb.
My process cannot generate the mp3lame_a in libs or the libffmpeg.so and liblame.a in obj. But it still works the same as MainActivity without them! Still no audio but it works with gradle and AndroidStudio!
The important parts are here:
Gitignore
# FFMPEG build related
**/libs/armeabi-v7a/*
**/obj/local/armeabi-v7a/*
build.gradle
apply plugin: 'com.android.application'
android {
sourceSets {
main {
jniLibs.srcDir 'src/main/libs' //set libs as .so's location instead of jni
jni.srcDirs = [] //disable automatic ndk-build call with auto-generated Android.mk file
}
}
// Call regular ndk-build (.cmd) script from local.properties
task ndkBuild(type: Exec) {
def ndkDir = plugins.getPlugin('com.android.application').sdkHandler.getNdkFolder()
println(ndkDir)
commandLine "$ndkDir/ndk-build", '-C', file('src/main/').absolutePath
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
}
@garyjamessilva : Hi , I got the audio worked, and this is all because your sharing files on Dropbox. Thank you very much, and It helped A LOT! I attached my solution in the thread, and @danman81 have some updated progress. Hope this would help. https://github.com/youtube/yt-watchme/issues/23