Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. omxplayer doesn't exit when the video finish

omxplayer doesn't exit when the video finish

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 266 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by
    #1

    Rasbian Lite, Qt5.9.2. I launch omxplayer in this way:

    QProcess *_omx = new QProcess(this);
    _omx->setProcessChannelMode(QProcess::MergedChannels);
    _omx->setReadChannel(QProcess::StandardOutput);
    connect(_omx, &QProcess::started, this, &QPlayer::omx_started);
    connect(_omx, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(omx_finished(int,QProcess::ExitStatus)));
    connect(_omx, &QProcess::readyRead, this, &QPlayer::omx_readyRead);
    
    
    void QPlayer::play(QString uri)
    {
        if (uri.isEmpty()) _uri = uri;
        if (!QFile::exists(uri)) return;
    
        QStringList args;
        args << "-o" << "0" << "-i" << "0";
        args << "omxplayer";
        args << "-I" << "-s";
        args << "-o" << "hdmi" << _uri;
        _omx->start("stdbuf", args, QProcess::Unbuffered | QProcess::ReadWrite);
    }
    

    It happens that when the video finishes omxplayer is still alive for about 10+ seconds. After that time it exits and the finished signal is emitted by QProcess. Launching the very same command from console leads to the expected behavior (i.e. omxplayer exits immediately after the video has finished).

    Do you see something wrong here?

    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