Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Call ffmepg binary on android(x86 emulator)
QtWS25 Last Chance

Call ffmepg binary on android(x86 emulator)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 2 Posters 531 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • thamT Offline
    thamT Offline
    tham
    wrote on last edited by
    #1

    Trying to call the ffmpeg binary on android x86 emulator, but the binary cannot start, it do not has any error messages either(connected to errorOccurred, readyReadStandardError, readyReadStandardOutput), all I can see are

    D Audio_on_android_2: test_command "/data/user/0/org.qtproject.example/files/ffmpeg --help"
    D Audio_on_android_2: qprocess_state_changed QProcess::Starting
    D Audio_on_android_2: qprocess_state_changed QProcess::NotRunning
    D Audio_on_android_2: qprocess_error QProcess::FailedToStart
    

    What I have done:

    1: I donwload the ffmpeg-master-android-clang.tar.xz from sourceForge
    2: Unzip and add the .so files in Build steps->Build android apk->add additional libraries

    libavcodec.so
    libavdevice.so
    libavfilter.so
    libavformat.so
    libavresample.so
    libavutil.so
    libswresample.so
    libswscale.so

    1. Add ffmpeg in to resource file

    2. Copy ffmpeg to ffmpeg_path_

    QString const app_location = QStandardPaths::writableLocation(QStandardPaths::StandardLocation::AppDataLocation);
    ffmpeg_path_ = app_location + "/" + QFileInfo(source).fileName();
    
    1. Call ffmpeg with help command
    QString const command = QString("%1 --help").arg(ffmpeg_path_);
    qDebug()<<__func__<<command;
    process_->start(command);
    

    Any process wrong?Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It's likely a dependency issue. I suspect ffmpeg cannot find the librairies it depends on.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      thamT 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        It's likely a dependency issue. I suspect ffmpeg cannot find the librairies it depends on.

        thamT Offline
        thamT Offline
        tham
        wrote on last edited by
        #3

        @SGaist I guess in order to let the ffmpeg found the libraries, I cannot add the libraries like that. How could I tell the ffmpeg binary where to find the so files?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I don't think you can use the LD_LIBRARY_PATH environment variable. So I would try to modify the rpath of the ffmpeg executable.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          thamT 1 Reply Last reply
          0
          • SGaistS SGaist

            I don't think you can use the LD_LIBRARY_PATH environment variable. So I would try to modify the rpath of the ffmpeg executable.

            thamT Offline
            thamT Offline
            tham
            wrote on last edited by
            #5

            @SGaist Do Android platform got tools like otool/install_name_tool ?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Androïd is a Linux based OS.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved