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. How to implement a viewfinder using system camera
Forum Updated to NodeBB v4.3 + New Features

How to implement a viewfinder using system camera

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.4k 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.
  • S Offline
    S Offline
    stuartx
    wrote on last edited by
    #1

    Hi, I posted the following questions several days ago. However I cannot read replies even I received several emails saying that someone posted a reply to my question. I can not see my original post in "My latest posts" either. I desperately need your help. So I open a new thread for the same question and close the original. I hope this thread will work just fine. Thank you!

    =======

    Hi, I am going to implement a viewfinder program to view, capture and record video and pictures, using the system camera. Based on the document, I see two approaches, widgets solution and QGraphicView solution.

    1. In widgets solution, I need to use QCamera and QCameraViewfinder (QMediaRecorder and QCameraImageCapture) classes for the implementation. If I want to manually arrange the QCameraViewFinder in the UI form of Qt creator, where can I get the widget symbol? I could not find it in the “Widget Box” of the Qt creator.

    2. In QGraphicView solution, I need to use QGraphicView, QGraphicScene, and QGraphicsVideoItem classes. In this approach, how can I connect the QCamera to the scene ? ( or to the QGraphicsVedioItem?) Should I use other class to represent the camera device?

    Which approach do you prefer? Is there any C++ examples for this kind of project?

    Your help and advice are greatly appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stuartx
      wrote on last edited by
      #2

      One more question: based on the document, the second approach has some performance penalty due to floating point number process. Is this a noticeable problem in today's hardware? Thanks.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andreyc
        wrote on last edited by
        #3

        There is a "Camera Example":http://qt-project.org/doc/qt-5/qtmultimediawidgets-camera-example.html in Qt examples.
        There are some other multimedia examples in Qt5.3.1/Examples/Qt-5.3/multimediawidgets/

        [quote author="stuartx" date="1407418420"]Hi, I posted the following questions several days ago. However I cannot read replies even I received several emails saying that someone posted a reply to my question. I can not see my original post in "My latest posts" either. I desperately need your help. So I open a new thread for the same question and close the original. I hope this thread will work just fine. Thank you![/quote]
        There was a spam attack recently. They posted spam messages as replies to the questions. That is why you were getting email notifications. After cleanup those messages disappeared and that is why you don't see any responses in your thread.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stuartx
          wrote on last edited by
          #4

          andreyc,

          I try to run the camera example. I get the following error:

          @Starting /home/sxu/Documents/QtApp/multimediawidgets/build-camera-Desktop_Qt_5_3_GCC_32bit-Debug/camera...

          (<unknown>:2287): GLib-GObject-WARNING **: invalid (NULL) pointer instance

          (<unknown>:2287): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

          (<unknown>:2287): GStreamer-CRITICAL **: gst_object_ref_sink: assertion `GST_IS_OBJECT (object)' failed

          (<unknown>:2287): GStreamer-CRITICAL **: gst_element_get_bus: assertion `GST_IS_ELEMENT (element)' failed

          (<unknown>:2287): GStreamer-CRITICAL **: gst_bus_add_watch_full: assertion `GST_IS_BUS (bus)' failed

          (<unknown>:2287): GStreamer-CRITICAL **: gst_bus_set_sync_handler: assertion `GST_IS_BUS (bus)' failed

          (<unknown>:2287): GStreamer-CRITICAL **: gst_object_ref: assertion `object != NULL' failed
          /home/sxu/Documents/QtApp/multimediawidgets/build-camera-Desktop_Qt_5_3_GCC_32bit-Debug/camera: symbol lookup error: /home/Qt/5.3/gcc/plugins/mediaservice/../../lib/libqgsttools_p.so.1: undefined symbol: gst_element_factory_list_get_elements
          /home/sxu/Documents/QtApp/multimediawidgets/build-camera-Desktop_Qt_5_3_GCC_32bit-Debug/camera exited with code 127@

          The gstreamer is installed in my system. Any thing did I miss?

          Thanks.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hugoclaesen
            wrote on last edited by
            #5

            I have the same on CentOS 6.3 (gstreamer 0.10.29) with Qt 5.3.2. I guess Qt 5.3.2 needs at least gstreamer 0.10.30 for gst_element_factory_list_get_elements.

            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