Results 1 to 13 of 13

Thread: qml change the resolution before camera capture picture

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qml change the resolution before camera capture picture

    Quote Originally Posted by neda View Post
    Excuse me
    I mean, "setMaxResulotion" function works
    And the camera is set to the highest resolution after this code:
    Qt Code:
    1. setMaxResulotion();//set highest resolution
    2. console.log("w2:"+camera.viewfinder.resolution.width) //=> ok : highest resolution.width
    3. console.log("h2:"+camera.viewfinder.resolution.height)//=> ok : highest resolution.height
    To copy to clipboard, switch view to plain text mode 
    well, the properties have the expected values, but I see that I was asking not precisely enough.
    What I meant was "does it work", i.e. does the camera capture at the set resolution.

    It seems it doesn't.

    Does it work if you don't change the resolution?
    If yes, does it work if you change to the first offered resolution?
    etc.

    Cheers,
    _

  2. #2
    Join Date
    Jan 2016
    Posts
    81
    Thanks
    31
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qml change the resolution before camera capture picture

    Thank you,
    When I put "console.log" after change resolution of camera I see resolution of camera is correct(in application output window)
    Qt Code:
    1. var res = camera.supportedViewfinderResolutions();
    2. var largestSize = 0;
    3. for(var i=0;i<res.length;i++) {
    4. var currentSize = res[i].width * res[i].height;
    5. if (currentSize > largestSize) {
    6. largestSize = currentSize;
    7. camera.viewfinder.resolution = Qt.size(res[i].width,res[i].height);
    8. }
    9. }
    10. console.log("w2:"+camera.viewfinder.resolution.width) //=> ok : highest resolution.width
    11. console.log("h2:"+camera.viewfinder.resolution.height)//=> ok : highest resolution.height
    To copy to clipboard, switch view to plain text mode 

    Then when this line of code runs I have this error:
    Qt Code:
    1. camera.imageCapture.capture()
    To copy to clipboard, switch view to plain text mode 
    QCameraImageCapture error: "Camera not ready for capture"

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qml change the resolution before camera capture picture

    Quote Originally Posted by neda View Post
    Thank you,
    When I put "console.log" after change resolution of camera I see resolution of camera is correct(in application output window)
    Is this some kind of unintentional double post?
    I think all that information is already in comment #7

    Cheers,
    _

  4. The following user says thank you to anda_skoa for this useful post:

    neda (4th May 2016)

  5. #4
    Join Date
    Jan 2016
    Posts
    81
    Thanks
    31
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qml change the resolution before camera capture picture

    Quote Originally Posted by anda_skoa View Post
    Does it work if you don't change the resolution?
    _
    Yes. When I run just "camera.imageCapture.capture()", it work. If I submit capture button after change the resolution every thing is OK. But when I put "change the resolution of camera" before "camera.imageCapture.capture()", it does not work.

    Button1 = > Change the resolution = > Is OK
    Button2 = > Image Capture => Is OK . If Button2 = > Change the resolution and Image Capture : It does not work


    Quote Originally Posted by anda_skoa View Post
    If yes, does it work if you change to the first offered resolution?
    _
    First offered resolution of camera is highest resolution. (I change the resolution of camera to lower resolution in start of program).
    Did you mean? If yes,it does not work.
    Qt Code:
    1. var res = camera.supportedViewfinderResolutions();
    2. camera.viewfinder.resolution = Qt.size(res[res.length-1].width,res[res.length-1].height);
    3. camera.imageCapture.capture()
    To copy to clipboard, switch view to plain text mode 
    Last edited by neda; 4th May 2016 at 06:18.

  6. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qml change the resolution before camera capture picture

    Quote Originally Posted by neda View Post
    Yes. When I run just "camera.imageCapture.capture()", it work. If I submit capture button after change the resolution every thing is OK. But when I put "change the resolution of camera" before "camera.imageCapture.capture()", it does not work.

    Button1 = > Change the resolution = > Is OK
    Button2 = > Image Capture => Is OK . If Button2 = > Change the resolution and Image Capture : It does not work
    Ok, this is an important data point.
    So what you are seeing is that changing the resolution within the same function that calls capture doesn't work but if you have two user interactions triggering them separately, even if immediately after each other, it works.

    Maybe check if the camera status changes when you change the resolution.
    If not you could try delaying the call to capture() with a timer.

    Cheers,
    _

  7. The following user says thank you to anda_skoa for this useful post:

    neda (4th May 2016)

  8. #6
    Join Date
    Mar 2018
    Posts
    1
    Qt products
    Platforms
    Windows

    Default Re: qml change the resolution before camera capture picture

    This feature rich application is accessible for numerous stages, for example, iOS, Android, Windows and Mac. Two separate applications together offer wonderful home security administrations. With the assistance of the camera application, your gadget would transform into a camera. Utilizing the other application, you can surveil it. A portion of the mentionable highlights of AtHome Camera are remote observing, facial acknowledgment, multi-see camera offices, time-pass recording and some more. In the event that you need, you can get the equipment cameras offered with the applications also. The application is accessible for nothing however not the equipment cameras! With a couple of fundamental yet urgent highlights, IP Webcam is a straightforward and simple to-utilize application and a prevalent section in this rundown of home security applications. Utilizing this application, your telephone would transform into a remote camera. Live video spilling, VLC player bolster, movement recognition, bolster for video visit, Dropbox, FTP servers and so forth are a portion of the real highlights of IP Webcam. You can get this application without spending a solitary penny.
    Thanks& regards,
    Lindsey Nicole
    Security Cameras Toronto | Security Cameras Vancouver

Similar Threads

  1. How to change the app resolution
    By roseicollis in forum Newbie
    Replies: 10
    Last Post: 23rd January 2015, 11:11
  2. display camera capture on label->setpixmap
    By mdaud in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2013, 20:50
  3. Replies: 0
    Last Post: 12th June 2013, 06:44
  4. capture video from DV camera
    By ekkondela in forum Newbie
    Replies: 1
    Last Post: 7th March 2010, 09:38
  5. Replies: 0
    Last Post: 7th August 2009, 19:21

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.