Closed TomSavas closed 5 years ago
Current ffmpeg
recipe has nothing to do with kivy video providers.
You should add ffpyplayer
to be able to play video on android.
Note, that recipe for it isn't in python-for-android
yet, but you can use p4a from this branch:
https://github.com/kivy/python-for-android/pull/954
omg thanks for that, I was wondering why my videos weren't playing
excuse me, but i'm new to kivy, ffmpeg and ffpyplayer requirements in buildozer.spec makes buildozer fails to compile apk. What i have specifically to do? thanks anyway
@fisiodes 1) Do you build apk with 'android' (old, pygame based toolchain) or 'android_new' (new, sdl2 based toolchain) command? 2) What your buildozer.spec requirements line exactly is? 3) Does your programm builds fine without adding ffmpeg and ffpyplayer in requirements? 4) You're trying to make video on Android work, aren't you?
yes here is my log:
/home/andrea/Desktop/kivy/.buildozer/android/platform/build/build/other_builds/ffmpeg/armeabi-v7a/ffmpeg
./libpng_build.sh: line 5: pushd: libpng-1.6.21: No such file or directory
make: *** No rule to make target 'clean'. Stop.
./libpng_build.sh: line 17: ./configure: No such file or directory
STDERR:
I have readed forum on update libpng or reinstall 1.6.21 version. What i have to do? and how? thanks!
I think the ffmpeg recipe is broken with android_new. There's a pull request that I think should fix it, which hopefully will be merged fairly shortly.
Hi inclem, we have talked in this post: https://stackoverflow.com/questions/42008776/buildozer-deploy-stucks I have not resolved gifs issue so i have converted them in mp4 videos. Tried with android command:
# Package the application
Traceback (most recent call last):
File "/usr/local/bin/buildozer", line 11, in <module>
load_entry_point('buildozer', 'console_scripts', 'buildozer')()
File "/home/andrea/buildozer/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/home/andrea/buildozer/buildozer/__init__.py", line 1029, in run_command
self.target.run_commands(args)
File "/home/andrea/buildozer/buildozer/target.py", line 91, in run_commands
func(args)
File "/home/andrea/buildozer/buildozer/target.py", line 103, in cmd_debug
self.buildozer.build()
File "/home/andrea/buildozer/buildozer/__init__.py", line 211, in build
self.target.build_package()
File "/home/andrea/buildozer/buildozer/targets/android.py", line 646, in build_package
self._update_libraries_references(dist_dir)
File "/home/andrea/buildozer/buildozer/targets/android.py", line 815, in _update_libraries_references
fd.writelines(content)
TypeError: write() argument 1 must be unicode, not str
@fisiodes you're trying to build apk with ffmpeg
recipe. ffmpeg
is currently broken, and besides that it's slow and buggy (outdated).
ffpyplayer
is modern alternative to ffmpeg
that enables video support, I advice you to use it. Currently recipe for ffpyplayer
is not merged in p4a yet, but you can use it this way:
Create your local copy of p4a with ffpyplayer recipe merged by command
git clone -b ffpyplayer_new_toolchain https://github.com/germn/python-for-android/
specify path to your local p4a in your buildozer.spec
android.p4a_dir = /home/kivy/python-for-android
Fix you requirements to use ffpyplayer recipe instead of ffmpeg:
requirements = hostpython2, kivy, ffpyplayer, openssl, ffpyplayer_codecs
Now you can run buildozer android_new debug
Thank you so much! Done it but build fails again:
[INFO]: Building libshine for armeabi-v7a
[INFO]: -> directory context /home/andrea/Desktop/kivy/.buildozer/android/platform/build/build/other_builds/libshine/armeabi-v7a/libshine
[INFO]: -> running bootstrap
ccache found, will optimize builds
('path is', '/home/andrea/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/:/home/andrea/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/:/home/andrea/.buildozer/android/platform/android-ndk-r9c:/home/andrea/.buildozer/android/platform/android-sdk-20/tools:/home/andrea/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/andrea/bin:/home/andrea/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games')
working: ./bootstrap:Exception in thread background thread for pid 11566:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1401, in wrap
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2294, in background_thread
handle_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1993, in fn
return self.command.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 677, in handle_command_exit_code
raise exc
ErrorReturnCode_127:
RAN: ./bootstrap
STDOUT:
./bootstrap: 4: ./bootstrap: autoreconf: not found
STDERR:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/andrea/kivy/python-for-android/pythonforandroid/toolchain.py", line 842, in <module>
main()
File "/home/andrea/kivy/python-for-android/pythonforandroid/toolchain.py", line 839, in main
ToolchainCL()
File "/home/andrea/kivy/python-for-android/pythonforandroid/toolchain.py", line 489, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/andrea/kivy/python-for-android/pythonforandroid/toolchain.py", line 147, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/andrea/kivy/python-for-android/pythonforandroid/toolchain.py", line 190, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "pythonforandroid/build.py", line 562, in build_recipes
File "/home/andrea/kivy/python-for-android/pythonforandroid/recipes/libshine/__init__.py", line 20, in build_arch
shprint(sh.Command('./bootstrap'))
File "pythonforandroid/logger.py", line 173, in shprint
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 725, in next
self.wait()
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 656, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 677, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_127:
RAN: ./bootstrap
STDOUT:
./bootstrap: 4: ./bootstrap: autoreconf: not found
STDERR:
# Command failed: python -m pythonforandroid.toolchain create --dist_name=quta --bootstrap=sdl2 --requirements=kivy,ffpyplayer,openssl,ffpyplayer_codecs,hostpython2 --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/andrea/Desktop/kivy/.buildozer/android/platform/build
#
# Buildozer failed to execute the last command
ffmpeg builds should currently be working in python-for-android.
Plus you're missing a system dependency autoreconf
binary comes from autoconf
package on Ubuntu
ffmpeg builds should currently be working in python-for-android.
But it gives the following error: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg
Hi , I had a question , were you successful in compiling js2py ? is it running fine ?
Everything builds fine till I add ffmpeg, to the requirements, because VideoPlayer doesn't play video on Android without it (or so have I read, please inform if I'm mistaken). When I add ffmpeg the buildozer fails to run a command:
By the way I use
buildozer android_new debug
to compile an apk file.Here is a full output of buildozer: