[ANN] New video provider for iOS / Android: ffpyplayer

714 views
Skip to the first unread message

Mathieu Virbel

unread,
28 Jun 2015, 11:39:26 am28/06/15
to kivy...@googlegroups.com, kivy-...@googlegroups.com
Hi everyone,

TLDR: replace ffmpeg with ffpyplayer as a requirements for video support on Android and iOS.

Forget about your previous experience for Video on Android / iOS. The previous provider was made by myself during 2012, based on ffmpeg 1.2. It was largely buggy for some cases, and performance was not great.

This time is done. Our lovely core developer, matham, coded a new project named ffpyplayer (https://github.com/matham/ffpyplayer/), a cython implementation of a ffmpeg based player. And i just finished the Android recipes for it.

FFPyPlayer is now fully available on Android and iOS. Just add "ffpyplayer" as a recipe to compile, or in requirements for your buildozer. It will compile latest ffmpeg 2.7, and ffpyplayer.
Also, since Kivy 1.9, it can be used as a core provider. Ie, just add it, and you'll get video support.

A few notes: ffmpeg is compiled with a minimal set of options: H264 + AAC, and supports http transport. This reduce the ffmpeg core library to 2.04MB (VS 8.48MB with full options). See the end of the email for the exacts options compiled.

Enjoy!

Mathieu & Matham

--

FFmpeg compilations options:
install prefix            build/ffmpeg/armeabi-v7a
source path               .
C compiler                arm-linux-androideabi-gcc
C library                 bionic
host C compiler           gcc
host C library            glibc
ARCH                      arm (armv7-a)
big-endian                no
runtime cpu detection     yes
ARMv5TE enabled           yes
ARMv6 enabled             yes
ARMv6T2 enabled           yes
VFP enabled               yes
NEON enabled              yes
THUMB enabled             no
debug symbols             yes
strip symbols             yes
optimize for size         yes
optimizations             yes
static                    no
shared                    yes
postprocessing support    yes
new filter support        yes
network support           yes
threading support         pthreads
safe bitstream reader     yes
SDL support               no
opencl enabled            no
texi2html enabled         no
perl enabled              yes
pod2man enabled           yes
makeinfo enabled          no
makeinfo supports HTML    no

External libraries:
zlib

Enabled decoders:
aac h263 h264

Enabled encoders:

Enabled hwaccels:

Enabled parsers:
aac h263 h264

Enabled demuxers:
asf mpegts sdp
mov rm

Enabled muxers:

Enabled protocols:
file rtp udp
http tcp

Enabled filters:
aresample crop

Enabled bsfs:

Enabled indevs:

Enabled outdevs:

Mathieu Virbel

unread,
28 Jun 2015, 5:07:49 pm28/06/15
to kivy...@googlegroups.com, kivy-...@googlegroups.com
I made another changes on android, if you compile openssl as well (add openssl as a requirements), then you'll get https / tls_openssl support.
(Vimeo http redirect to https url.). Now i can safely confirm that this player also read perfectly h264/aac video from the internet ^^

Carsten Thielepape

unread,
29 Jun 2015, 5:47:39 am29/06/15
to kivy-...@googlegroups.com, kivy...@googlegroups.com
Hello,
 
great job, thx.

Are they any instructions how get support for more codecs into the build?  

Mathieu Virbel

unread,
29 Jun 2015, 7:26:04 am29/06/15
to kivy-...@googlegroups.com, kivy...@googlegroups.com
Not really, i honestly don't know how to expose them. Best is to change the recipe to your needs :/

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carsten Thielepape

unread,
7 Sept 2015, 9:13:36 am07/09/15
to Kivy users support, kivy...@googlegroups.com
Hi Mathieu,

took a while to find some time to play around with this. So I added 

requirements = ffpyplayer,openssl, ......

to my buildozer spec file, but buildozer comes with the error

Available modules: android apsw audiostream c_igraph cprotobuf cymunk django docutils ffmpeg gevent greenlet hostpython igraph jpeg kivent kivy libevent libpq libswift libxml2 libxslt libyaml lxml m2crypto msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools sqlalchemy sqlite3 storm swift twisted txws wokkel zope


So it seems, that the receipe is missing. I allready tried to update buildozer (sudo pip install --upgrade buildozer), but error remains. Any advice what to build with buildozer (Android) and ffpyplayer woud be great.

Thanks!

Carsten Thielepape

unread,
7 Sept 2015, 9:48:31 am07/09/15
to Kivy users support, kivy...@googlegroups.com
Hello,

fixed it meanwhile: I copied the receipes from the python-for-android branch manual to the local folders.

Still haven't found any internet stream to show a picture. Maybe you have one example where you tested it?

刘斌

unread,
7 Sept 2015, 12:14:35 pm07/09/15
to Kivy users support, kivy...@googlegroups.com
hi, i got following error message on my android phone:
I/python  ( 5102): [ERROR             ] [ffpyplayer  ] http://10.10.0.1:8080/stream/video.h264: Invalid data found when processing input
is there any way to handle this?
i use a raspberry pi as a http h264 video server follow the guide at:
http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=16#example11
looking forward your reply,thank you.

在 2015年6月28日星期日 UTC+8下午11:39:26,Mathieu Virbel写道:

刘斌

unread,
7 Sept 2015, 12:14:35 pm07/09/15
to Kivy users support, kivy...@googlegroups.com
i think you can try to update your kivy.

在 2015年9月7日星期一 UTC+8下午9:13:36,Carsten Thielepape写道:

刘斌

unread,
9 Sept 2015, 4:54:35 am09/09/15
to Kivy users support, kivy...@googlegroups.com
hi, Is the ffpyplayer support the HTTP/raw H264 stream playback?
what should i do if i want to play the HTTP/raw H264 stream on my android phone use kivy.


在 2015年6月28日星期日 UTC+8下午11:39:26,Mathieu Virbel写道:
Hi everyone,

sagi...@gmail.com

unread,
29 Dec 2018, 6:02:48 am29/12/18
to Kivy users support
Hi Sir,
 Can you share your code sir? How did you fixed this error?
Reply all
Reply to author
Forward
0 new messages