Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

CameraBin error: "Internal data stream error."



  • Hello Folks,

    • Device : RPi 3
    • What I'm trying to achieve:
      Roll over 4 USB camera displaying their video stream.

    Right know, I got in a single thread, a state machine that roll over all the four camera (every 10 sec I switch) but time to time I got that internal data stream error (I have like 10 other thread for other module).

    I got the exact same error with the qt camera example when I want to switch camera.

    It might because, I got some library that are missing?
    All the gstreamer relatives library that I installed are:

    baresip-gstreamer/oldstable 0.5.0-4 armhf
    deejayd-gstreamer/oldstable 0.10.0-6 all
    fso-deviced-player-gstreamer/oldstable 0.12.0-7 armhf
    gir1.2-gstreamer-0.10/oldstable 0.10.36-1.5 armhf
    gir1.2-gstreamer-1.0/oldstable,now 1.10.4-1 armhf [installed,automatic]
    gnome-twitch-player-backend-gstreamer-cairo/oldstable 0.3.1-1 armhf
    gnome-twitch-player-backend-gstreamer-clutter/oldstable 0.3.1-1 armhf
    gnome-twitch-player-backend-gstreamer-opengl/oldstable 0.3.1-1 armhf
    gstreamer-qapt/oldstable 3.0.2-1+b1 armhf
    gstreamer-tools/oldstable 0.10.36-1.5 armhf
    gstreamer0.10-alsa/oldstable 0.10.36-2 armhf
    gstreamer0.10-buzztard/oldstable 0.5.0-2+deb7u1 armhf
    gstreamer0.10-buzztard-doc/oldstable 0.5.0-2+deb7u1 all
    gstreamer0.10-chromaprint/oldstable 0.1-3+b1 armhf
    gstreamer0.10-doc/oldstable,stable 0.10.36-1.5 all
    gstreamer0.10-dvswitch/oldstable 0.0.1-1 armhf
    gstreamer0.10-gconf/oldstable 0.10.31-3+nmu4+b1 armhf
    gstreamer0.10-gnomevfs/oldstable 0.10.36-2 armhf
    gstreamer0.10-gnonlin/oldstable 0.10.17-2 armhf
    gstreamer0.10-gnonlin-dbg/oldstable 0.10.17-2 armhf
    gstreamer0.10-gnonlin-doc/oldstable 0.10.17-2 all
    gstreamer0.10-hplugins/oldstable 0.2.0-2 armhf
    gstreamer0.10-plugins-base/oldstable 0.10.36-2 armhf
    gstreamer0.10-plugins-base-apps/oldstable 0.10.36-2 armhf
    gstreamer0.10-plugins-base-dbg/oldstable 0.10.36-2 armhf
    gstreamer0.10-plugins-base-doc/oldstable,stable 0.10.36-2 all
    gstreamer0.10-plugins-cutter/oldstable 1.1.7-1.2 armhf
    gstreamer0.10-plugins-good/oldstable 0.10.31-3+nmu4+b1 armhf
    gstreamer0.10-plugins-good-dbg/oldstable 0.10.31-3+nmu4+b1 armhf
    gstreamer0.10-plugins-good-doc/oldstable 0.10.31-3+nmu4 all
    gstreamer0.10-plugins-ugly/oldstable 0.10.19-2.1+b4 armhf
    gstreamer0.10-plugins-ugly-dbg/oldstable 0.10.19-2.1+b4 armhf
    gstreamer0.10-plugins-ugly-doc/oldstable 0.10.19-2.1 all
    gstreamer0.10-pulseaudio/oldstable 0.10.31-3+nmu4+b1 armhf
    gstreamer0.10-qapt/oldstable 3.0.2-1 all
    gstreamer0.10-tools/oldstable 0.10.36-1.5 armhf
    gstreamer0.10-x/oldstable 0.10.36-2 armhf
    gstreamer1.0-alsa/oldstable,now 1.10.4-1+deb9u1 armhf [installed,automatic]
    gstreamer1.0-clutter/oldstable 2.0.18-1 armhf
    gstreamer1.0-clutter-3.0/oldstable 3.0.24-1 armhf
    gstreamer1.0-doc/oldstable,now 1.10.4-1 all [installed,automatic]
    gstreamer1.0-dvswitch/oldstable 0.1.1-1 armhf
    gstreamer1.0-espeak/oldstable 0.4.0-2 armhf
    gstreamer1.0-fluendo-mp3/oldstable 0.10.32.debian-1 armhf
    gstreamer1.0-gnonlin/oldstable 1.4.0-2 armhf
    gstreamer1.0-gnonlin-dbg/oldstable 1.4.0-2 armhf
    gstreamer1.0-gnonlin-doc/oldstable 1.4.0-2 all
    gstreamer1.0-libav/oldstable 1.10.4-1 armhf
    gstreamer1.0-libav-dbg/oldstable 1.10.4-1 armhf
    gstreamer1.0-nice/oldstable 0.1.13-2 armhf
    gstreamer1.0-omx/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-omx-bellagio-config/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-omx-dbg/oldstable 1.0.0.1-0+rpi12+jessiepmg armhf
    gstreamer1.0-omx-generic/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-omx-generic-config/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-omx-generic-dbgsym/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-omx-rpi/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-omx-rpi-config/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-omx-rpi-dbgsym/stable 1.10.4-1+rpt3 armhf
    gstreamer1.0-packagekit/oldstable 1.1.5-2+deb9u1 armhf
    gstreamer1.0-plugins-bad/oldstable,now 1.10.4-1 armhf [installed]
    gstreamer1.0-plugins-bad-dbg/oldstable,now 1.10.4-1 armhf [installed]
    gstreamer1.0-plugins-bad-doc/oldstable,now 1.10.4-1 all [installed]
    gstreamer1.0-plugins-base/oldstable,now 1.10.4-1+deb9u1 armhf [installed]
    gstreamer1.0-plugins-base-apps/oldstable,now 1.10.4-1+deb9u1 armhf [installed]
    gstreamer1.0-plugins-base-dbg/oldstable,now 1.10.4-1+deb9u1 armhf [installed]
    gstreamer1.0-plugins-base-doc/oldstable,now 1.10.4-1+deb9u1 all [installed]
    gstreamer1.0-plugins-good/oldstable,now 1.10.4-1 armhf [installed]
    gstreamer1.0-plugins-good-dbg/oldstable,now 1.10.4-1 armhf [installed]
    gstreamer1.0-plugins-good-doc/oldstable,now 1.10.4-1 all [installed]
    gstreamer1.0-plugins-ugly/oldstable,now 1.10.4-1 armhf [installed]
    gstreamer1.0-plugins-ugly-dbg/oldstable,now 1.10.4-1 armhf [installed]
    gstreamer1.0-plugins-ugly-doc/oldstable,now 1.10.4-1 all [installed]
    gstreamer1.0-pocketsphinx/oldstable 0.8+5prealpha-2 armhf
    gstreamer1.0-pulseaudio/oldstable,now 1.10.4-1 armhf [installed,automatic]
    gstreamer1.0-rtsp/oldstable 1.10.4-1 armhf
    gstreamer1.0-rtsp-dbg/oldstable 1.10.4-1 armhf
    gstreamer1.0-tools/oldstable,now 1.10.4-1 armhf [installed,automatic]
    gstreamer1.0-vaapi/oldstable 1.10.4-1+b1 armhf
    gstreamer1.0-vaapi-doc/oldstable 1.10.4-1 all
    gstreamer1.0-x/oldstable,now 1.10.4-1+deb9u1 armhf [installed,automatic]
    libcanberra-gstreamer/oldstable 0.30-3+b2 armhf
    libghc-tagstream-conduit-dev/oldstable 0.5.5.3-7 armhf
    libghc-tagstream-conduit-doc/oldstable 0.5.5.3-7 all
    libghc-tagstream-conduit-prof/oldstable 0.5.5.3-7 armhf
    libgstreamer-interfaces-perl/oldstable 0.06-2+b4 armhf
    libgstreamer-ocaml/oldstable 0.2.0-2+b2 armhf
    libgstreamer-ocaml-dev/oldstable 0.2.0-2+b2 armhf
    libgstreamer-perl/oldstable 0.19-1+b3 armhf
    libgstreamer-plugins-bad1.0-0/oldstable,now 1.10.4-1 armhf [installed]
    libgstreamer-plugins-bad1.0-dev/oldstable,now 1.10.4-1 armhf [installed]
    libgstreamer-plugins-base0.10-0/oldstable 0.10.36-2 armhf
    libgstreamer-plugins-base0.10-dev/oldstable 0.10.36-2 armhf
    libgstreamer-plugins-base1.0-0/oldstable,now 1.10.4-1+deb9u1 armhf [installed,automatic]
    libgstreamer-plugins-base1.0-dev/oldstable,now 1.10.4-1+deb9u1 armhf [installed]
    libgstreamer0.10-0/oldstable 0.10.36-1.5 armhf
    libgstreamer0.10-0-dbg/oldstable 0.10.36-1.5 armhf
    libgstreamer0.10-dev/oldstable 0.10.36-1.5 armhf
    libgstreamer1.0-0/oldstable,now 1.10.4-1 armhf [installed,automatic]
    libgstreamer1.0-0-dbg/oldstable 1.10.4-1 armhf
    libgstreamer1.0-dev/oldstable,now 1.10.4-1 armhf [installed]
    libgstreamerd-3-0/oldstable 3.3.1-2 armhf
    libgstreamerd-3-dev/oldstable 3.3.1-2 armhf
    libgstreamermm-1.0-1/oldstable 1.8.0+dfsg-1 armhf
    libgstreamermm-1.0-dev/oldstable 1.8.0+dfsg-1 armhf
    libgstreamermm-1.0-doc/oldstable 1.8.0+dfsg-1 all
    libqt5gstreamer-1.0-0/oldstable 1.2.0-4 armhf
    libqt5gstreamer-dev/oldstable 1.2.0-4 armhf
    libqt5gstreamerquick-1.0-0/oldstable 1.2.0-4 armhf
    libqt5gstreamerui-1.0-0/oldstable 1.2.0-4 armhf
    libqt5gstreamerutils-1.0-0/oldstable 1.2.0-4 armhf
    libqtgstreamer-1.0-0/oldstable 1.2.0-4 armhf
    libqtgstreamer-dev/oldstable 1.2.0-4 armhf
    libqtgstreamerui-1.0-0/oldstable 1.2.0-4 armhf
    libqtgstreamerutils-1.0-0/oldstable 1.2.0-4 armhf
    libreoffice-avmedia-backend-gstreamer/oldstable 1:5.2.7-1+rpi1+deb9u9 armhf
    liquidsoap-plugin-gstreamer/oldstable 1.1.1-7.1+b1 armhf
    mkchromecast-gstreamer/oldstable 0.3.7+git20170130-2 all
    phonon-backend-gstreamer/oldstable 4:4.9.0-1 armhf
    phonon-backend-gstreamer-common/oldstable 4:4.9.0-1 armhf
    phonon4qt5-backend-gstreamer/oldstable 4:4.9.0-1 armhf
    qml-module-qtgstreamer/oldstable 1.2.0-4 armhf
    qt5gstreamer-dbg/oldstable 1.2.0-4 armhf
    qtgstreamer-dbg/oldstable 1.2.0-4 armhf
    qtgstreamer-declarative/oldstable 1.2.0-4 armhf
    qtgstreamer-doc/oldstable 1.2.0-4 all
    qtgstreamer-plugins/oldstable 1.2.0-4 armhf
    qtgstreamer-plugins-qt5/oldstable 1.2.0-4 armhf
    ruby-gstreamer/oldstable 3.1.0-1+deb9u1 armhf
    
    

    A short resume of my code:

    void popupavancement::rollCamera()
    {
        /*
         * Roulement des caméras chaque index ne possède qu'une caméra
         *
        */
    
        /* On set la caméra sur le viewer du layout camera */
        if(max_camera != 0)
        {
            setCamera();
    
            if( index_camera < (max_camera - 1))
            {
                index_camera = (enum camera) (index_camera + 1);
            }
            else
            {
                index_camera = VertexG;
            }
        }
    
    }
    
    int popupavancement::setCamera()
    {
    
        int res = 1;
        CameraList::iterator itfirst;
        SubCameraList::iterator itsecond;
    
        qCInfo(logger) << QString("set de la camera: %1").arg(index_camera);
    
        switch(index_camera)
        {
            case VertexG:
    
                    itfirst = m_CameraList.find(VELVET_MODULE_VERTEX);
    
                    if (itfirst != m_CameraList.end())
                    {
                        itsecond = itfirst->second.find(VELVET_EYE_LEFT);
    
                        if (itsecond != itfirst->second.end())
                        {
                            if(m_modules[VELVET_MODULE_VERTEX][VELVET_EYE_LEFT]->is_enable() &&
                                    !m_modules[VELVET_MODULE_VERTEX][VELVET_EYE_LEFT]->is_missing())
                            {
                                m_camera.reset(new QCamera(m_CameraList[VELVET_MODULE_VERTEX][VELVET_EYE_LEFT]));
                                start(VELVET_MODULE_VERTEX, VELVET_EYE_LEFT);
                                break;
                            }
                            else
                            {
                               index_camera = (enum camera) (index_camera + 1);
                               // On passe sur Vertex Droit
                            }
    
                        }
                    }
                    else
                    {
                     qCCritical(logger) << "Module non présent";
                     res = -1;
                     break;
                    }
    
           ...
            case AlignementD:
    
                    itfirst = m_CameraList.find(VELVET_MODULE_ALIGNEMENT);
    
                    if (itfirst != m_CameraList.end())
                    {
                        itsecond = itfirst->second.find(VELVET_EYE_RIGHT);
    
                        if (itsecond != itfirst->second.end())
                        {
                            if(m_modules[VELVET_MODULE_ALIGNEMENT][VELVET_EYE_RIGHT]->is_enable() &&
                                    !m_modules[VELVET_MODULE_ALIGNEMENT][VELVET_EYE_RIGHT]->is_missing())
                            {
                                m_camera.reset(new QCamera(m_CameraList[VELVET_MODULE_ALIGNEMENT][VELVET_EYE_RIGHT]));
                                start(VELVET_MODULE_ALIGNEMENT, VELVET_EYE_RIGHT);
                                break;
                            }
                            else
                            {
                                index_camera = VertexG;
                                // On passe sur Vertex Gauche
                                setCamera();
    
                            }
    
                        }
                    }
                    else
                    {
                     qCInfo(logger) << "Module non présent";
                     res = -1;
                     break;
                    }
    
        };
    
    
        if( m_camera.data() != NULL)
        {
            m_mediaRecorder.reset(new QMediaRecorder(m_camera.data()));
            m_imageCapture.reset(new QCameraImageCapture(m_camera.data()));
    
            m_camera->setViewfinder(ui->cameraview);
            //ui->cameraview->setFixedSize(500, 230);
    
            // m_camera->start();
            qCInfo(logger) << QString("Start de la camera: %1").arg(index_camera);
        }
        else
        {
            qCCritical(logger) << "Unexpected null ptr";
            res = -1;
        }
    
        return res;
    }
    

    The start of the camera is done in the worker class.

    When the result is hitten every 10 sec, I reset for the new camera:

    void popupavancement::handleResults_emi(int res)
    {
    
        // Arrêt caméra
        m_camera->stop();
    
        if(res == 2)
        {
            rollCamera();
        }
        else
        {
            workerThread_emi.quit();
            workerThread_emi.wait();
    
            stop = true;
            qCInfo(logger) << QString("Arrêt du test d'émission des caméras avec le résultat: %1").arg(res);
        }
    }
    

    If you need any other information.

    Thanks in advance,

    Eve


Log in to reply