mapmap icon indicating copy to clipboard operation
mapmap copied to clipboard

Unable to reopen project with v4l2 devices as sources

Open skankerror opened this issue 3 years ago • 2 comments

Expected Behavior

I want to save and reopen a project with v4l2 devices

Actual Behavior

When I reopen the project, it searches for a video file as source, and don't accept v4l2 specified in mmp file

Steps to Reproduce the Problem

  1. create new project, add new camera, add a mesh
  2. save project and close mapmap
  3. reopen this project, A windows error appears and ask to locate the video file

Specifications

  • Version: last develop version
  • Platform: manjaro linux
  • Subsystem: Qt 5.15

here's the console output :

25 oct. 21 17:04 | Debug: Found paint with classname: "mmp::Video" - src/core/ProjectReader.cpp:154 25 oct. 21 17:04 | Warning: Cannot change volume cause this video does not support audio. - src/core/VideoImpl.cpp:106 25 oct. 21 17:04 | Debug: Created new instance with id: 1 - src/core/ProjectReader.cpp:168 25 oct. 21 17:04 | Debug: Opening movie: "/dev/video0" . - src/core/VideoImpl.cpp:461 25 oct. 21 17:04 | Debug: Freeing remaining samples/buffers - src/core/VideoImpl.cpp:277 25 oct. 21 17:04 | Debug: Calling gst_filename_to_uri : /dev/video0 - src/core/VideoUriDecodeBinImpl.cpp:168 25 oct. 21 17:04 | Debug: Discoverer error: Impossible de lire à partir de la ressource. - src/core/VideoUriDecodeBinImpl.cpp:208 25 oct. 21 17:04 | Debug: This URI cannot be played - src/core/VideoUriDecodeBinImpl.cpp:235 25 oct. 21 17:04 | Debug: Cannot load movie "/dev/video0" . - src/core/Paint.cpp:316 25 oct. 21 17:04 | Debug: Unable to set the pipeline to the playing state. - src/core/VideoImpl.cpp:514 25 oct. 21 17:04 | Warning: QPainter::begin: Paint device returned engine == 0, type: 2 - :0 25 oct. 21 17:04 | Warning: QPainter::setPen: Painter not active - :0

skankerror avatar Oct 25 '21 20:10 skankerror

I noticed that in mmp file, there's only one class for Video, therefore ProjectReader will always use VideoUriDecodeBinImpl to handle uri. To fix it, maybe in mmp file, we have to specify a new class Camera, or in ProjectReader, check the uri in order to use VideoV4l2SrcImpl when that's look like a device uri ?

skankerror avatar Oct 27 '21 19:10 skankerror

Hi! Thank you for reporting that bug! Yes - we will need to add a new serializable type. Perhaps we can organize some coding session to fix this! @skankerror It's probably easy to fix.

aalex avatar Oct 28 '21 19:10 aalex