-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add ffpyplayer and dependencies recipes for new toolchain. #954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks like ffpyplayer just does a basic check for an Android build and assumes it's being built with pygame/sdl1, see here. I expect a patch to fix this would be welcome, or a simple short term fix is to add a patch for ffpyplayer in python-for-android. We do this with pyjnius, which also defaults to assuming a pygame build on Android. |
@inclement, with latest commits ffpyplayer==4.0.0 can be built with new toolchain (and SDL2) successfully. Only one problem left:
If you'll decide to merge PR, please check it, since, as I said, I'm new with p4a. Thanks. |
Build order fixed same way as it's done in old toolchain: adding sdl2 as dependency to ffmpeg. This is not correct since actually ffmpeg doesn't dependence of sdl2, but this is question to p4a building recipe order algorithm. However PR seems to be working and ready to merge. |
Hey can you test with matham/ffpyplayer#19 to see if that works for both old and new toolchain? |
I was just planning to merge it into master. what was the issues with the old toolchain using current master? |
@matham, I tested With new toolchain it works like a charm. With old toolchain everything compiles fine, but kivy can't use ffpyplayer provider:
|
Ok, merged py4a branch. That error is weird. The floor function is a standard c function imported from math.h. |
Can you add the math library to the libraries list and see if it fixes it? Just add |
@matham it works! Thanks. |
Merged. I guess this and for the old toolchain it should be good once you switch back to using master and remove the patch. |
Look @FeralBytes, in case you're interested, i've missed this pr completely. 😊 |
@germn thank you for this commit; it was recently highlighted to be incredibly important as a core feature for Kivy. Can you confirm this brings video to the SDL2 tool chain? Disregard it clearly does provide video for SDL2. Thanks again. |
@FeralBytes you're welcome. This PR brings video support (by |
@germn I intend to test this tomorrow, confirm I just use your branch of P4A and ensure that ffpyplayer is in the requirements. Does ffpyplayer need to go before or after sdl2 ... or since this recipe is for sdl2/android_new do I just leave sdl2 out of the requirements? |
@FeralBytes yes, ffpyplayer uses sdl2 from bootstrap, so you don't need to specify it in requirements. Here's example of requirements line that can be used:
|
@germn I have good news and bad news. |
@FeralBytes ok! I'm using this PR with Py2 / Android NDK, it would be nice to know if it works with Crystax NDK also. |
For anything like this, the CrystaX NDK should work just the same as the
normal one.
…On 12/02/17 19:44, Gerasimov Mikhail wrote:
@FeralBytes <https://github.com/FeralBytes> ok! I'm using this PR with
Py2 / Android NDK, it would be nice to know if it works with Crystax NDK
also.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#954 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNQm_9DdwwZK8HY7CyM0wIhccM40DBqks5rb2ElgaJpZM4LIJSN>.
|
This seems out of order according to guidance from Tito. |
Second Failure Log Attached for the Crystax Build. What do you make of the error logs? How should I proceed next? |
For this Build I built with Google but changed the requirements like you suggested: |
@FeralBytes, hello and sorry for late answer. Unfortunately, I can't say what causes errors in your case, I added two missing dependencies for new recipes, but I don't think it'll help. May be problem with sdk version you use, may be with something else. I have no idea, if and how I can fix it in my environment :( Nevertheless, I have alternative for you (or someone else) who might need to build recipes from this PR. I've just created new VM with Ubuntu recording all steps it took me to get working apk with ffpyplayer support. With this environment everything should work without errors.
|
@inclement anything that stops this PR from being merged? |
@germn I don't think so, sorry about the delay, I just haven't had time to review it recently. Following the Kivy release at the weekend we're now moving to do a python-for-android release, and I'll mark this as to-be-merged before that if possible. |
# Conflicts: # doc/source/quickstart.rst
…fpyplayer_new_toolchain # Conflicts: # doc/source/quickstart.rst
Thank you for this pull request. I'm able to build ffmpeg, ffpyplayer and ffpyplayer_codecs using this pull request. However, I've run into a peculiar problem that only occurs with videos that have audio. I'm able to play the same video using the ffpyplayer provider on osx without issue. It has h264 video and aac audio with a mp4 container. Here is the stacktrace from logcat:
This is the failing line: https://github.com/matham/ffpyplayer/blob/master/ffpyplayer/player/core.pyx#L1806 Looking at the source code here, https://github.com/matham/ffpyplayer/blob/master/ffpyplayer/player/core.pyx#L1684-L1690 It seems like this ZeroDivisionError should never happen, and I'm losing my mind trying to dig deeper. I set the log level to debug for ffpyplayer but nothing more shows up. Any clue about what's going on? I'm hesitant to file this with ffpyplayer since I have the same video working on osx using it as the provider. |
Can you put print statements to see what the actual values are in case something is wrong with the logger? |
@rammie hello! Any chance you can provide video file that causes error? |
Since the recipes seem good, I've merged them, thanks! |
Again, this PR is awesome and thanks for merging it. Also, @matham , @germn thanks for your responses. Here is what I found- my video works fine when I'm not playing other sounds at the same time. The ffpyplayer docs say that doing so requires building ffpyplayer with SDL_Mixer. I modified ffpyplayer's setup.py and this recipe to USE_SDL_MIXER and I got everything to build without issue. I verified that the new build uses SDL Mixer and uses Mix_Volume, but it would still fail when trying to open the audio device in the same exact way. Some useful notes: My log statements immediately before it would appear and immediately after this line would not appear as if there were an exception thrown. However log lines one stack frame above would report a return value of 1 for the audio_open function which would then lead to the ZeroDivisionError. This is bizarre and feels like a cython bug of some sort of sython behavior that I don't understand. I tried different cython versions(0.21, 0.23, latest) but that did not help. I did not dig into the generated C code. I circumvented my issue by using a custom SoundLoader based on Android's MediaPlayer similar to https://github.com/kivy/kivy/blob/master/kivy/core/audio/audio_avplayer.py I was wondering if it is worthwhile to contribute either of these changes back:
|
@rammie I'm not familiar with this stuff deeply, but if you'll decide to make ffpyplayer related changes, I'm ready to test it. |
I have been able to reproduce the float division by zero error. It works on ubuntu, but when I compile ffpyplayer and all its deps on centos5, which is very old, I get this error when running a file with audio in the interpreter. I suspect that it's something to do with the age of the OS, or it could be because I'm compiling sdl2 myself and am possibly missing something. It seems to me like a race condition, but haven't figured out the source. |
Ok, the |
Good stuff - needs to be advertised more IMHO. This also works to make SoundFFPY play OGG Vorbis. EDIT: Correction, it needs to be advertised AT ALL. This doesn't seem to be in any FFPyPlayer documentation yet. :-) |
Hey @germn I am having issues playing video with Ubuntu 18.04, Python 3.8, Kivy 1.11.1, Buildozer 1.8, on Android 9.0 Tablet. It's just loading a black screen. Kivy Camera works though. I tried adding ffpyplayer and ffpyplayer_codecs to the bulldozer requirements but it didn't work. I finally found your merge and I think I need to follow your steps here in quotes. My question is would this work on Ubuntu 18.04 and for Android 9.0? Is it possible to get an updated version of the instructions? Much appreciated. Thanks. |
Absolutely! It took me a week of Kivy Video troubles to find this and I am now hopeful this will get it going. |
This PR is about to add recipe for
ffpyplayer
for new toolchain. #951Currently it has 3 problems.
should_build(self, arch)
funcs aren't written for added recipes.ffmpeg
recipe should have['openssl', 'ffpyplayer_codecs']
asopt_depends
. But in that case for some reason toolchain tries to buildffmpeg
before it's optional dependencies what leads for error. It might be p4a bug or I completely miss something.Main problem:
ffpyplayer
recipe itself doesn't work. While looks like it's fine with builtffmpeg
it can't findsdl2
:May be it happens because of
sdl2
compiles somehow differently asffpyplayer
need. May beffpyplayer==v4.0.0
is broken for Android. May be I'm doing something wrong.If you have any idea how to fix it, you're welcome.