So far I’m unable to confirm that setting the mode beforehand does prevent the RTSP connection from being shot down in the moment of making a photo.
Here some steps to reproduce:
-
Console prepared to run:
gst-launch-1.0 rtspsrc location=rtsp://192.168.42.1/live is-live=true connection-speed=3000 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! fakesink
-
A function, which sets up photo mode a short moment after having successfully connected to the drone
- Setup photo mode
def set_photo_mode(self):
''' Set photo mode '''
self.logger.info("set photo mode")
assert(self.drone(camera.set_camera_mode(cam_id=0, value='photo')).wait().success())
assert(self.drone(camera.set_photo_mode(
cam_id=0,
mode='single',
format='full_frame',
file_format='jpeg',
burst='burst_4_over_1s',
bracketing='preset_1ev',
capture_interval=0
)).wait().success())
This function runs OK.
-
Start the RTSP client
-
Make a photo (function taken from one of your samples)
def take_photo(self):
''' Take photo '''
self.logger.info("taking photo")
photo_saved = self.drone(camera.photo_progress(result="photo_saved", _policy="wait"))
self.drone(camera.take_photo(cam_id=0)).wait()
if not photo_saved.wait(_timeout=30).success():
assert False, "take_photo timedout"
photo_progress_info = photo_saved.received_events().last().args
print(photo_saved, photo_progress_info)
media_id = photo_progress_info["media_id"]
photo_count = photo_progress_info["photo_count"]
print("Media ID {}, Photo count {}".format(media_id, photo_count))
The output of this function looks OK so far, but says also, that no photo has been taken.
{'Camera.Photo_progress': OrderedDict([('cam_id', None),
('result',
<photo_result.photo_saved: 2>),
('photo_count', None),
('media_id', None),
('list_flags', None)])} OrderedDict([('cam_id', 0), ('result', <photo_result.photo_saved: 2>), ('photo_count', 0), ('media_id', '10000029'), ('list_flags', <list_flags_Bitfield: []>)])
Media ID 10000029, Photo count 0
This is reproducible. The RTSP video instead, running in the separate console until the shot was taken, is shot down:
Got EOS from element "pipeline0".
Execution ended after 0:00:10.906530244
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unhandled error
Additional debug info:
../subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c(6697): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Bad Request (400)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not write to resource.
Additional debug info:
../subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c(8242): gst_rtspsrc_close (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not send message. (Generic error)
Freeing pipeline ...
The GST call has ended and returned to console prompt.
Either I have misunderstood you or it is not possible at all.
The only thing, which is not consistent here: The media ID increases and even if no RTSP stream is running no photo is made That in fact makes me think that either the setup or the shot itself is wrong.