Skip to content

ffmpeg breaks buildozer android debug compilation process. #1294

Closed

Description

@littlegreenbean33

Hi,

I just downloaded everything from scratch into my ubuntu 16.04 after facing some difficulties.

My application is a minimal app just to test I can display video on android.

Dependencies kivy/ffmpg
The build process breaks in

 STDOUT:
GEN     libavdevice/libavdevice.ver
CC      libavformat/network.o
CC      libavformat/options.o
CC      libavformat/os_support.o
CC      libavformat/protocols.o
In file included from libavformat/network.h:29:0,
                 from libavformat/network.c:22:
libavformat/os_support.h:67:32: error: expected declaration specifiers or '...' before '(' token
  #define lseek(f,p,w) lseek64((f), (p), (w))
                                ^
libavformat/os_support.h:67:37: error: expected declaration specifiers or '...' before '(' token
  #define lseek(f,p,w) lseek64((f), (p), (w))
                                     ^
libavformat/os_support.h:67:42: error: expected declaration specifiers or '...' before '(' token
   # define lseek(f,p,w) lseek64((f), (p), (w))
                                          ^
common.mak:60: recipe for target 'libavformat/network.o' failed
make: *** [libavformat/network.o] Error 1
make: *** Waiting for unfinished jobs....

I understand this is not a buildozer error. Just to reflect the inability to produce apps that support video playing while this is not resolved.

I wonder if there are alternatives to this libs for playing video

regards.

JC

Activity

  1. inclement commented on Jun 6, 2018

    @inclement
    Member

    Thanks for the report, I guess the ffmpeg recipe is broken. Interesting that the error seems to be an actual syntax error, I'm not really sure what's gone wrong.

  2. AndreMiras commented on Jun 20, 2018

    @AndreMiras
    Member

    It compiled OK in the Docker env.
    I ran the following command:

    python setup_testapp_python2_sqlite_openssl.py apk --sdk-dir /opt/android/android-sdk --ndk-dir /opt/android/android-ndk --requirements sdl2,kivy,ffmpeg
    

    Relevant part of the log is:

    [INFO]:    Building sdl2 for armeabi-v7a
    [INFO]:    -> directory context /root/.local/share/python-for-android/build/bootstrap_builds/sdl2_gradle-python2/jni
    [INFO]:    -> running ndk-build V=1
    [INFO]:    <- directory context /app/testapps
    [INFO]:    Building six for armeabi-v7a
    [INFO]:    six apparently isn't already in site-packages
    [INFO]:    Installing six into site-packages
    [INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/six-python2/armeabi-v7a/six
    [INFO]:    -> running python.host setup.py install -O2
    [INFO]:    <- directory context /app/testapps
    [INFO]:    Building ffmpeg for armeabi-v7a
    [INFO]:    -> directory context /root/.local/share/python-for-android/build/other_builds/ffmpeg/armeabi-v7a/ffmpeg
    [INFO]:    -> running configure --disable-everything --enable-parser=aac,ac3,h261,h264,mpegaudio,mpeg4video,mpegvideo,vc1 --enable-decoder=aac,h264,...(and 623 more)
    [INFO]:    -> running make -j4
    [INFO]:    -> running make install
    [INFO]:    <- directory context /app/testapps
    [INFO]:    Building pyjnius for armeabi-v7a
    [INFO]:    jnius apparently isn't already in site-packages
    [INFO]:    Cythonizing anything necessary in pyjnius
    
  3. AndreMiras commented on Oct 13, 2018

    @AndreMiras
    Member

    Re, I confirm I could reproduce with:

    python setup_testapp_python3.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $CRYSTAX_NDK_HOME --bootstrap sdl2 --requirements python3crystax,ffmpeg
    

    But it's working fine with:

    python setup_testapp_python2.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --bootstrap sdl2 --requirements python2,ffmpeg
    

    Note the differences:

    • different setup_testapp
    • different target python
    • different NDK

    Host Python2 for both.

    Error log extract:

    [INFO]:    <- directory context /home/andre/workspace/python-for-android/testapps
    [INFO]:    Building ffmpeg for armeabi-v7a    
    [INFO]:    -> directory context /home/andre/.local/share/python-for-android/build/other_builds/ffmpeg/armeabi-v7a/ffmpeg
    [DEBUG]:   -> running configure --disable-everything --enable-parser=aac,ac3,h261,h264,mpegaudio,mpeg4video,mpegvideo,vc1 --enable-decoder=aac,h264,mpeg4,mpegvideo --enable-muxer=h264,mov,mp4,mpeg2video --enable-demuxer=aac,h264,m4v,mov,mpegvideo,vc1 --disable-symver --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --enable-filter=aresample,resample,crop,adelay,volume --enable-protocol=file,http --enable-small --enable-hwaccels --enable-gpl --enable-pic --disable-static --enable-shared --target-os=android --cross-prefix=arm-linux-androideabi- --arch=arm --sysroot=/home/andre/.buildozer/crystax-ndk-10.3.2/platforms/android-19/arch-arm --enable-neon --prefix=/home/andre/.local/share/python-for-android/build/other_builds/ffmpeg/armeabi-v7a/ffmpeg
    [DEBUG]:        tput: No value for $TERM and no -T specified
    [DEBUG]:        tput: No value for $TERM and no -T specified                                    
    [DEBUG]:        install prefix            /home/andre/.local/share/python-for-android/build/other_builds/ffmpeg/armeabi-v7a/ffmpeg
    [DEBUG]:        source path               .                                         
    [DEBUG]:        C compiler                arm-linux-androideabi-gcc
    [DEBUG]:        C library                 bionic
    [DEBUG]:        host C compiler           gcc
    [DEBUG]:        host C library            glibc
    [DEBUG]:        ARCH                      arm (armv7-a)
    [DEBUG]:        big-endian                no
    [DEBUG]:        runtime cpu detection     yes
    [DEBUG]:        ARMv5TE enabled           yes
    [DEBUG]:        ARMv6 enabled             yes
    [DEBUG]:        ARMv6T2 enabled           yes
    [DEBUG]:        VFP enabled               yes
    [DEBUG]:        NEON enabled              yes
    [DEBUG]:        THUMB enabled             yes
    [DEBUG]:        debug symbols             yes
    [DEBUG]:        strip symbols             yes
    [DEBUG]:        optimize for size         yes
    [DEBUG]:        optimizations             yes
    [DEBUG]:        static                    no
    [DEBUG]:        shared                    yes
    [DEBUG]:        postprocessing support    yes
    [DEBUG]:        network support           yes
    [DEBUG]:        threading support         pthreads
    [DEBUG]:        safe bitstream reader     yes
    [DEBUG]:        texi2html enabled         no
    [DEBUG]:        perl enabled              yes
    [DEBUG]:        pod2man enabled           yes
    [DEBUG]:        makeinfo enabled          no
    [DEBUG]:        makeinfo supports HTML    no
    [DEBUG]:
    [DEBUG]:        External libraries:
    [DEBUG]:        bzlib                   xlib                    zlib
    [DEBUG]:        iconv
    [DEBUG]:
    [DEBUG]:        External libraries providing hardware acceleration:
    [DEBUG]:
    [DEBUG]:        Libraries:
    [DEBUG]:        avcodec                 avformat                swresample
    [DEBUG]:        avdevice                avutil                  swscale
    [DEBUG]:        avfilter                postproc
    [DEBUG]:
    [DEBUG]:        Programs:
    [DEBUG]:
    [DEBUG]:        Enabled decoders:
    [DEBUG]:        aac                     h264                    mpegvideo
    [DEBUG]:        h263                    mpeg4
    [DEBUG]:
    [DEBUG]:        Enabled encoders:
    [DEBUG]:
    [DEBUG]:        Enabled hwaccels:
    [DEBUG]:
    [DEBUG]:        Enabled parsers:
    [DEBUG]:        aac                     h263                    mpegaudio
    [DEBUG]:        ac3                     h264                    mpegvideo
    [DEBUG]:        h261                    mpeg4video              vc1
    [DEBUG]:
    [DEBUG]:        Enabled demuxers:
    [DEBUG]:        aac                     m4v                     mpegvideo
    [DEBUG]:        h264                    mov                     vc1
    [DEBUG]:
    [DEBUG]:        Enabled muxers:
    [DEBUG]:        h264                    mp4                     mpeg2video
    [DEBUG]:        mov
    [DEBUG]:
    [DEBUG]:        Enabled protocols:
    [DEBUG]:        file                    http                    tcp
    [DEBUG]:
    [DEBUG]:        Enabled filters:
    [DEBUG]:        adelay                  crop                    volume
    [DEBUG]:        aresample
    [DEBUG]:
    [DEBUG]:        Enabled bsfs:
    [DEBUG]:        null
    [DEBUG]:
    [DEBUG]:        Enabled indevs:
    [DEBUG]:
    [DEBUG]:        Enabled outdevs:
    [DEBUG]:
    [DEBUG]:        License: GPL version 2 or later
    [DEBUG]:        Creating configuration files ...
    [DEBUG]:
    [DEBUG]:        WARNING: arm-linux-androideabi-pkg-config not found, library detection may fail.
    [DEBUG]:   -> running make -j4
    [DEBUG]:        GEN     libavutil/libavutil.version
    [DEBUG]:        GEN     libswscale/libswscale.version
    [DEBUG]:        GEN     libswresample/libswresample.version
    [DEBUG]:        GEN     libavcodec/libavcodec.version
    [DEBUG]:        GEN     libpostproc/libpostproc.version
    [DEBUG]:        GEN     libavformat/libavformat.version
    [DEBUG]:        GEN     libavfilter/libavfilter.version
    [DEBUG]:        GEN     libavdevice/libavdevice.version
    [DEBUG]:        CC      libavdevice/alldevices.o
    [DEBUG]:        CC      libavdevice/avdevice.o
    [DEBUG]:        CC      libavdevice/reverse.o
    [DEBUG]:        CC      libavdevice/utils.o
    [DEBUG]:        CC      libavformat/aacdec.o
    [DEBUG]:        CC      libavformat/allformats.o
    [DEBUG]:        CC      libavformat/apetag.o
    [DEBUG]:        CC      libavformat/avc.o
    [DEBUG]:        CC      libavformat/avio.o
    [DEBUG]:        CC      libavformat/aviobuf.o
    [DEBUG]:        CC      libavformat/cutils.o
    [DEBUG]:        CC      libavformat/dump.o
    [DEBUG]:        CC      libavformat/file.o
    [DEBUG]:        libavformat/dump.c: In function 'dump_stream_format':
    [DEBUG]:        libavformat/dump.c:473:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:             avctx->properties = st->codec->properties;
    [DEBUG]:             ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:474:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:             avctx->codec      = st->codec->codec;
    [DEBUG]:             ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:475:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:             avctx->qmin       = st->codec->qmin;
    [DEBUG]:             ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:476:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:             avctx->qmax       = st->codec->qmax;
    [DEBUG]:             ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:477:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:             avctx->coded_width  = st->codec->coded_width;
    [DEBUG]:             ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:478:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:             avctx->coded_height = st->codec->coded_height;
    [DEBUG]:             ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:513:9: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:                 int tbc = st->codec->time_base.den && st->codec->time_base.num;
    [DEBUG]:                 ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:513:9: warning: 'codec' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:                 int tbc = st->codec->time_base.den && st->codec->time_base.num;
    [DEBUG]:                 ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        libavformat/dump.c:525:13: warning: 'codec' is deprecated [-Wdeprecated-declarations]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         [196/834]
    [DEBUG]:                     print_fps(1 / av_q2d(st->codec->time_base), "tbc");
    [DEBUG]:                     ^
    [DEBUG]:        In file included from libavformat/dump.c:37:0:
    [DEBUG]:        libavformat/avformat.h:893:21: note: declared here
    [DEBUG]:             AVCodecContext *codec;
    [DEBUG]:                             ^
    [DEBUG]:        CC      libavformat/format.o
    [DEBUG]:        CC      libavformat/golomb_tab.o
    [DEBUG]:        CC      libavformat/h264dec.o
    [DEBUG]:        CC      libavformat/hevc.o
    [DEBUG]:        CC      libavformat/http.o
    [DEBUG]:        CC      libavformat/httpauth.o
    [DEBUG]:        CC      libavformat/id3v1.o
    [DEBUG]:        CC      libavformat/id3v2.o
    [DEBUG]:        CC      libavformat/img2.o
    [DEBUG]:        CC      libavformat/isom.o
    [DEBUG]:        CC      libavformat/log2_tab.o
    [DEBUG]:        CC      libavformat/m4vdec.o
    [DEBUG]:        CC      libavformat/metadata.o
    [DEBUG]:        CC      libavformat/mov.o
    [DEBUG]:        CC      libavformat/mov_chan.o
    [DEBUG]:        CC      libavformat/movenc.o
    [DEBUG]:        CC      libavformat/movenccenc.o
    [DEBUG]:        CC      libavformat/movenchint.o
    [DEBUG]:        libavformat/movenc.c: In function 'handle_eac3':
    [DEBUG]:        libavformat/movenc.c:453:9: warning: 'av_copy_packet_side_data' is deprecated [-Wdeprecated-declarations]
    [DEBUG]:                 if ((ret = av_copy_packet_side_data(&info->pkt, pkt)) < 0)
    [DEBUG]:                 ^
    [DEBUG]:        In file included from libavformat/avformat.h:319:0,
    [DEBUG]:                         from libavformat/movenc.h:27,
    [DEBUG]:                         from libavformat/movenc.c:27:
    [DEBUG]:        ./libavcodec/avcodec.h:4640:5: note: declared here
    [DEBUG]:         int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src);
    [DEBUG]:             ^
    [DEBUG]:        CC      libavformat/mpegvideodec.o
    [DEBUG]:        CC      libavformat/mux.o
    [DEBUG]:        CC      libavformat/network.o
    [DEBUG]:        In file included from libavformat/network.h:29:0,
    [DEBUG]:                         from libavformat/network.c:22:
    [DEBUG]:        libavformat/os_support.h:67:32: error: expected declaration specifiers or '...' before '(' token
    [DEBUG]:         #  define lseek(f,p,w) lseek64((f), (p), (w))
    [DEBUG]:                                        ^
    [DEBUG]:        libavformat/os_support.h:67:37: error: expected declaration specifiers or '...' before '(' token
    [DEBUG]:         #  define lseek(f,p,w) lseek64((f), (p), (w))
    [DEBUG]:                                             ^
    [DEBUG]:        libavformat/os_support.h:67:42: error: expected declaration specifiers or '...' before '(' token
    [DEBUG]:         #  define lseek(f,p,w) lseek64((f), (p), (w))
    [DEBUG]:                                                  ^
    [DEBUG]:        ffbuild/common.mak:60: recipe for target 'libavformat/network.o' failed
    [DEBUG]:        make: *** [libavformat/network.o] Error 1
    [DEBUG]:        make: *** Waiting for unfinished jobs....
    Exception in thread background thread for pid 5881:
    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 "/home/andre/workspace/python-for-android/venv/local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
        fn(*args, **kwargs)
      File "/home/andre/workspace/python-for-android/venv/local/lib/python2.7/site-packages/sh.py", line 2459, in background_thread
        handle_exit_code(exit_code)
      File "/home/andre/workspace/python-for-android/venv/local/lib/python2.7/site-packages/sh.py", line 2157, in fn
        return self.command.handle_command_exit_code(exit_code)
      File "/home/andre/workspace/python-for-android/venv/local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
        raise exc
    ErrorReturnCode_2:
    
      RAN: /usr/bin/make -j4
    
      STDOUT:
    GEN     libavutil/libavutil.version
    GEN     libswscale/libswscale.version
    GEN     libswresample/libswresample.version
    GEN     libavcodec/libavcodec.version
    GEN     libpostproc/libpostproc.version
    GEN     libavformat/libavformat.version
    GEN     libavfilter/libavfilter.version
    GEN     libavdevice/libavdevice.version
    CC      libavdevice/alldevices.o
    CC      libavdevice/avdevice.o
    CC      libavdevice/reverse.o
    CC      libavdevice/utils.o
    CC      libavformat/aacdec.o
    CC      libavformat/allformats.o
    CC      libavformat/apetag.o
    CC      libavformat/avc.o
    CC      libavformat/avio.o
    CC      libavformat/aviobuf.o
    CC      libavformat/cutils.o
    CC      libavformat/dump.o
    CC      libavformat/file.o
    libavformat/dump.c: In function 'dump_stream_format':
    libavformat/dump.c:473:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->properties = st->codec->properties;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:474:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->codec      = st->codec->codec;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:475:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->qmin       = st->codec->qmin;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:476:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->qmax       = st->codec->qmax;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:477:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->coded_width  = st->codec->coded_width;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:478:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->coded_height = st->codec->coded_height;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:513:9: warning: 'codec' is deprecated [-Wdeprecated-declarations]
             int tbc = st->codec->time_base.den && st->codec->time_base.num;
             ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:513:9: warning: 'codec' is deprecated [-Wdeprecated-declarations]
             int tbc = st->codec->time_base.den && st->codec->time_base.num;
             ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:525:13: warning: 'codec' is deprecated [-Wdeprecated-declarations]
                 print_fps(1 / av_q2d(st->codec->time_base), "tbc");
                 ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    CC      libavformat/format.o
    CC      libavformat/golomb_tab.o
    CC      libavformat/h264dec.o
    CC      libavformat/hevc.o
    CC      libavformat/http.o
    CC      libavformat/httpauth.o
    CC      libavformat/id3v1.o
    CC      libavformat/id3v2.o
    CC      libavformat/img2.o
    CC      libavformat/isom.o
    CC      libavformat/log2_tab.o
    CC      libavformat/m4vdec.o
    CC      libavformat/metadata.o
    CC      libavformat/mov.o
    CC      libavformat/mov_chan.o
    CC      libavformat/movenc.o
    CC      libavformat/movenccenc.o
    CC      libavformat/movenchint.o
    libavformat/movenc.c: In function 'handle_eac3':
    libavformat/movenc.c:453:9: warning: 'av_copy_packet_side_data' is deprecated [-Wdeprecated-declarations]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [21/834]
             if ((ret = av_copy_packet_side_data(&info->pkt, pkt)) < 0)
             ^
    In file included from libavformat/avformat.h:319:0,
                     from libavformat/movenc.h:27,
                     from libavformat/movenc.c:27:
    ./libavcodec/avcodec.h:4640:5: note: declared here
     int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src);
         ^
    CC      libavformat/mpegvideodec.o
    CC      libavformat/mux.o
    CC      libavformat/network.o
    In file included from libavformat/network.h:29:0,
                     from libavformat/network.c:22:
    libavformat/os_support.h:67:32: error: expected declaration specifiers or '...' before '(' token
     #  define lseek(f,p,w) lseek64((f), (p), (w))
                                    ^
    libavformat/os_support.h:67:37: error: expected declaration specifiers or '...' before '(' token
     #  define lseek(f,p,w) lseek64((f), (p), (w))
                                         ^
    libavformat/os_support.h:67:42: error: expected declaration specifiers or '...' before '(' token
     #  define lseek(f,p,w) lseek64((f), (p), (w))
                                              ^
    ffbuild/common.mak:60: recipe for target 'libavformat/network.o' failed
    make: *** [libavformat/network.o] Error 1
    make: *** Waiting for unfinished jobs....
    
    
      STDERR:
    
    
    Traceback (most recent call last):
      File "setup_testapp_python3.py", line 30, in <module>
        package_data={'testapp': ['*.py', '*.png']}
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/andre/workspace/python-for-android/pythonforandroid/bdistapk.py", line 81, in run
        main()
      File "/home/andre/workspace/python-for-android/pythonforandroid/toolchain.py", line 999, in main
        ToolchainCL()
      File "/home/andre/workspace/python-for-android/pythonforandroid/toolchain.py", line 532, in __init__
        getattr(self, args.subparser_name.replace('-', '_'))(args)
      File "/home/andre/workspace/python-for-android/pythonforandroid/toolchain.py", line 145, in wrapper_func
        build_dist_from_args(ctx, dist, args)
      File "/home/andre/workspace/python-for-android/pythonforandroid/toolchain.py", line 189, in build_dist_from_args
        build_recipes(build_order, python_modules, ctx)
      File "/home/andre/workspace/python-for-android/pythonforandroid/build.py", line 580, in build_recipes
        recipe.build_arch(arch)
      File "/home/andre/workspace/python-for-android/pythonforandroid/recipes/ffmpeg/__init__.py", line 120, in build_arch
        shprint(sh.make, '-j4', _env=env)
      File "/home/andre/workspace/python-for-android/pythonforandroid/logger.py", line 176, in shprint
        for line in output:
      File "/home/andre/workspace/python-for-android/venv/local/lib/python2.7/site-packages/sh.py", line 863, in next
        self.wait()
      File "/home/andre/workspace/python-for-android/venv/local/lib/python2.7/site-packages/sh.py", line 792, in wait
        self.handle_command_exit_code(exit_code)
      File "/home/andre/workspace/python-for-android/venv/local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
        raise exc
    sh.ErrorReturnCode_2:
    
      RAN: /usr/bin/make -j4
    
      STDOUT:
    GEN     libavutil/libavutil.version
    GEN     libswscale/libswscale.version
    GEN     libswresample/libswresample.version
    GEN     libavcodec/libavcodec.version
    GEN     libpostproc/libpostproc.version
    GEN     libavformat/libavformat.version
    GEN     libavfilter/libavfilter.version
    GEN     libavdevice/libavdevice.version
    CC      libavdevice/alldevices.o
    CC      libavdevice/avdevice.o
    CC      libavdevice/reverse.o
    CC      libavdevice/utils.o
    CC      libavformat/aacdec.o
    CC      libavformat/allformats.o
    CC      libavformat/apetag.o
    CC      libavformat/avc.o
    CC      libavformat/avio.o
    CC      libavformat/aviobuf.o
    CC      libavformat/cutils.o
    CC      libavformat/dump.o
    CC      libavformat/file.o
    libavformat/dump.c: In function 'dump_stream_format':
    libavformat/dump.c:473:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->properties = st->codec->properties;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:474:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->codec      = st->codec->codec;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:475:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->qmin       = st->codec->qmin;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:476:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->qmax       = st->codec->qmax;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:477:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->coded_width  = st->codec->coded_width;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:478:5: warning: 'codec' is deprecated [-Wdeprecated-declarations]
         avctx->coded_height = st->codec->coded_height;
         ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:513:9: warning: 'codec' is deprecated [-Wdeprecated-declarations]
             int tbc = st->codec->time_base.den && st->codec->time_base.num;
             ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:513:9: warning: 'codec' is deprecated [-Wdeprecated-declarations]
             int tbc = st->codec->time_base.den && st->codec->time_base.num;
             ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    libavformat/dump.c:525:13: warning: 'codec' is deprecated [-Wdeprecated-declarations]
                 print_fps(1 / av_q2d(st->codec->time_base), "tbc");
                 ^
    In file included from libavformat/dump.c:37:0:
    libavformat/avformat.h:893:21: note: declared here
         AVCodecContext *codec;
                         ^
    CC      libavformat/format.o
    CC      libavformat/golomb_tab.o
    CC      libavformat/h264dec.o
    CC      libavformat/hevc.o
    CC      libavformat/http.o
    CC      libavformat/httpauth.o
    CC      libavformat/id3v1.o
    CC      libavformat/id3v2.o
    CC      libavformat/img2.o
    CC      libavformat/isom.o
    CC      libavformat/log2_tab.o
    CC      libavformat/m4vdec.o
    CC      libavformat/metadata.o
    CC      libavformat/mov.o
    CC      libavformat/mov_chan.o
    CC      libavformat/movenc.o
    CC      libavformat/movenccenc.o
    CC      libavformat/movenchint.o
    libavformat/movenc.c: In function 'handle_eac3':
    libavformat/movenc.c:453:9: warning: 'av_copy_packet_side_data' is deprecated [-Wdeprecated-declarations]
             if ((ret = av_copy_packet_side_data(&info->pkt, pkt)) < 0)
             ^
    In file included from libavformat/avformat.h:319:0,
                     from libavformat/movenc.h:27,
                     from libavformat/movenc.c:27:
    ./libavcodec/avcodec.h:4640:5: note: declared here
     int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src);
         ^
    CC      libavformat/mpegvideodec.o
    CC      libavformat/mux.o
    CC      libavformat/network.o
    In file included from libavformat/network.h:29:0,
                     from libavformat/network.c:22:
    libavformat/os_support.h:67:32: error: expected declaration specifiers or '...' before '(' token
     #  define lseek(f,p,w) lseek64((f), (p), (w))
                                    ^
    libavformat/os_support.h:67:37: error: expected declaration specifiers or '...' before '(' token
     #  define lseek(f,p,w) lseek64((f), (p), (w))
                                         ^
    libavformat/os_support.h:67:42: error: expected declaration specifiers or '...' before '(' token
     #  define lseek(f,p,w) lseek64((f), (p), (w))
                                              ^
    ffbuild/common.mak:60: recipe for target 'libavformat/network.o' failed
    make: *** [libavformat/network.o] Error 1
    make: *** Waiting for unfinished jobs....
    
    
      STDERR:
    
  4. AndreMiras commented on Jan 14, 2019

    @AndreMiras
    Member

    Looks like this is now working with the new target python3 plus #1579 (python3crystax support is discontinued). I've used the following command:

    python setup_testapp_python3.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --bootstrap sdl2 --requirements python3,ffmpeg

    Within docker that was built and ran as such:

    docker build --tag=p4a --file Dockerfile.py2 .
    docker run -it --rm p4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions