Results 1 to 2 of 2

Thread: QML Video Element not detecting or reading stream from webcam

  1. #1
    Join Date
    Jul 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QML Video Element not detecting or reading stream from webcam

    I am trying to stream video into my QML application. The video is NTSC, and I get it through /dev/video1 and I can see it being successfully displayed in VLC. When I try to make a video element to stream the video, I get a variety of error messages depending on the url I use. Using
    Qt Code:
    1. Video {
    2. id: camera1
    3. source: "/dev/video1"
    4. autoLoad: true
    5. playing: true
    6. }
    To copy to clipboard, switch view to plain text mode 
    I get the error “Could not read from resource.”.
    Using
    Qt Code:
    1. source: "file://v4l2:///dev/video2"
    To copy to clipboard, switch view to plain text mode 
    I get the error "Stream contains no data."
    and using
    Qt Code:
    1. source: "file:///dev/video2"
    To copy to clipboard, switch view to plain text mode 
    I get the errors
    Qt Code:
    1. Error: "Could not determine type of stream."
    2. Error: "Could not read from resource."
    3. Error: "Internal data flow error."
    To copy to clipboard, switch view to plain text mode 
    or “Could not read from resource”.

    These last two urls seem the most promising, since they recognize the device, though they won't display the screen, but I don't know how I can correctly get and display this stream. I haven't been able to find any examples of anyone doing this, or evidence in the documentation of how to correctly format these urls (and how they are parsed). Any help you can provide so that I can display the video being displayed in real time with low latency would be greatly appreciated.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML Video Element not detecting or reading stream from webcam

    The element needs the data to be formatted in a way it understands -- with a proper video container, its header, codec and stuff like that. What /dev/video returns is probably raw video data -- the Video QML element won't be able to handle that. You need to develop some kind of converter or implement a QML element that will do what Video element does for properly formatted video files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Best way to stream and record a webcam
    By ichigo in forum Qt Programming
    Replies: 4
    Last Post: 27th June 2014, 23:51
  2. Webcam Video Capture
    By bajoelkid12 in forum Qt Programming
    Replies: 28
    Last Post: 25th December 2011, 03:28
  3. Display webcam stream with phonon and the qt
    By nyquist82 in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2011, 08:03
  4. How to get video streaming from USB webcam
    By sanket.mehta in forum Qt Programming
    Replies: 4
    Last Post: 15th July 2011, 06:45
  5. Video Stream Over UDP
    By bajoelkid12 in forum Qt Programming
    Replies: 4
    Last Post: 1st June 2011, 08:02

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.