bluerobotics / companion

Companion computer startup scripts and examples
https://www.ardusub.com/operators-manual/companion-web.html
GNU General Public License v3.0
48 stars 54 forks source link

Update audio and video service with camera manager #339

Closed patrickelectric closed 2 years ago

Williangalvani commented 3 years ago

I just tested this starting from the 0.0.21 image.

steps:

I have video but the camera page is not populated (all selects are empty)

patrickelectric commented 3 years ago

@Williangalvani what you mean by camera page ? QGC or companion ? Can you send a picture ?

Williangalvani commented 3 years ago

@Williangalvani what you mean by camera page ? QGC or companion ? Can you send a picture ?

Screenshot from 2020-07-20 12-45-37

I also didn't see any calls to the backend, did you accidentally drop something?

Williangalvani commented 3 years ago

Tried again, same steps. Started with qgc stable. After reboot I had video for a few seconds and then lost it. /camera shows rtsp selected, changing to udp did nothing. changed back to rtsp: rtsp had weird aspect ratio again (image centralized using 50% of the available space) changed to udp in browser: had to change in qgc aswell, but now qgc shows video artifacts which lead me to believe it is received two of the same streams at the same port.

with qgc master: Alternating between stream types sometimes fails in qgc. changing to udp causes the same weird artifacts I mentioned before (stream is in slowmotion and full of artifacts)

rtsp streams are also showing these artifacts at the lower right: Screenshot from 2020-07-23 16-34-42

also relevant log from qgc:

VideoReceiverLog: Starting decoding "rtsp://192.168.2.2:8554/video1"
VideoReceiverLog: GStreamer error: Could not open resource for reading and writing.
VideoReceiverLog: Stopping because of error
VideoReceiverLog: Stopping "rtsp://192.168.2.2:8554/video1"
Camera "name" stopped transmitting. Removing from list.
VideoManagerLog: Restart video streaming 0
VideoManagerLog: Restart video streaming 1
VideoReceiverLog: Streaming did not start "rtsp://192.168.2.2:8554/video1"
VideoReceiverLog: Stopped "rtsp://192.168.2.2:8554/video1"
VideoReceiverLog: Stopping "rtsp://192.168.2.2:8554/video1"
VideoReceiverLog: Stopped "rtsp://192.168.2.2:8554/video1"
CameraManagerLog: Hearbeat from  100
CameraManagerLog: _requestCameraInfo( 100 )
CameraManagerLog: _requestCameraInfo( 100 )
CameraManagerLog: _requestCameraInfo( 100 )
CameraManagerLog: _requestCameraInfo( 100 )
CameraManagerLog: _requestCameraInfo( 100 )
Giving up requesting camera info from 1 100
patrickelectric commented 3 years ago

@Williangalvani Try to use gst source directly from the terminal or a stable version of QGC, I'm using the last table appimage available I have seen such problems here

patrickelectric commented 3 years ago

I was able to replicate both problems: The UDP problem was a missing sync in the udp multudpsink pipeline The RTSP rectangle is a result of the RTSP streaming as faster as it can, I have added a h264parse to avoid such problem.

patrickelectric commented 3 years ago

@Williangalvani I did the same steps without the update.sh (that's not necessary) and with npm install in place of npm update. Everything appears to be working without issues here.

I'll flash your sdcard and see if the problem was during your manual installation or a fault of the sdcard

jaxxzer commented 3 years ago

@Williangalvani @patrickelectric The way I recommend to test something like this:

git fetch origin pull/339/head:pr339
git tag 0.0.22 pr339

This will make sure an update is done in the same manner as when it's performed from the /system page after we push a new stable tag

alternatively, push the tag to your github fork, then add your fork as a remote from the github page, and you can skip the command line fetch/tag

jaxxzer commented 3 years ago

I updated with the steps described above, this is the output in the console on the /system page: https://pastebin.com/JTK6vf0F

Make failed, see line 459