Bebop2 Video Stream from OLYMPE not working

I am Trying to get a video stream from my Bebop2 via an Olympe script. For now, I’m using the example streaming.py script with the flying code removed and replaced with a time.sleep(), so I can test the streaming indoors.

I can get it to work with Sphinx, but not with the actual drone. I am able to connect and control the physical drone via Olympe scripts, the stream is the only problem.

Here is the console output when connecting to the physical drone:

Olympe streaming example output dir: /tmp/olympe_streaming_test_osjsjr8x
I arsdkctrl: discovery 'net': start
I arsdkctrl: discovery 'net': add device name='Bebop2-122368' id='P742PB9U12000131B050'
I arsdkctrl_net: Sending json:
I arsdkctrl_net: { "arstream2_client_stream_port": "55004", "arstream2_client_control_port": "55005", "arstream2_supported_metadata_version": "1", "controller_name": "arsdk-ng", "controller_type": "desktop", "d2c_port": 9988, "device_id": "", "qos_mode": 0 }
I arsdkctrl_net: Received json:
I arsdkctrl_net: { "status": 0, "c2d_port": 54321, "c2d_update_port": 51, "c2d_user_port": 21, "qos_mode": 0, "arstream2_server_stream_port": 5004, "arstream2_server_control_port": 5005 }
E arsdk: arsdk_cmd_itf_recv_data:953: arsdk_cmd_dec_header err=22(Invalid argument)
I pdraw_session: state change to CREATED
I pdraw_session: state change to OPENING
I pdraw_element: 'StreamDemuxerNet': element state change to CREATED
I pdraw_element: 'StreamDemuxerNet': element state change to STARTING
I rtsp_client: connecting to address 192.168.42.1 port 554
I pdraw_element: 'StreamDemuxerNet': element state change to STARTED
I pdraw_session: state change to OPENED
E pdraw_dmxstrmnet: getSingleStreamLocalStreamPort:231: invalid stream socket err=71(Protocol error)
E pdraw_dmxstrmnet: getSingleStreamLocalControlPort:246: invalid control socket err=71(Protocol error)
I pdraw_session: state change to CLOSING
I pdraw_element: 'StreamDemuxerNet': element state change to STOPPING
I rtsp_client: client disconnected (already disconnected)
I pdraw_dmxstrm: RTSP disconnected
I pdraw_element: 'StreamDemuxerNet': element state change to STOPPED
I pdraw_session: state change to CLOSED
I arsdkctrl: discovery 'net': remove device name='Bebop2-122368' id='P742PB9U12000131B050'
I arsdkctrl: discovery 'net': stop
ffmpeg version 6591f3c0b4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/home/picklefizz/code/parrot-groundsdk/out/olympe-linux/staging/usr --sysconfdir=/home/picklefizz/code/parrot-groundsdk/out/olympe-linux/staging/etc ac_cv_prog_YACC= --disable-maintainer-mode --disable-nls --disable-gtk-doc --disable-gtk-doc-html --disable-doxygen-docs --disable-doc --disable-docs --disable-documentation --disable-option-checking --quiet --enable-silent-rules --arch=x86_64 --enable-shared --enable-cross-compile --enable-optimizations --cross-prefix= --target-os=linux --disable-orc --disable-avconv --disable-avplay --disable-avprobe --disable-avserver --disable-avdevice --disable-avresample --disable-filters --disable-network --disable-yasm --disable-bzlib --disable-gpl --disable-version3 --disable-nonfree --disable-everything --enable-avcodec --enable-decoder=h264 --enable-protocol=file --enable-demuxer=h264 --enable-muxer=h264 --enable-parser=h264 --enable-muxer=mp4
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
[h264 @ 0x560523192620] Format h264 detected only with low score of 1, misdetection possible!
[h264 @ 0x560523192620] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, h264, from '/tmp/olympe_streaming_test_osjsjr8x/h264_data.264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264, none, 25 tbr, 1200k tbn, 50 tbc
Output #0, mp4, to '/tmp/olympe_streaming_test_osjsjr8x/h264_data.mp4':
Output file #0 does not contain any stream
Traceback (most recent call last):
  File "connection_test.py", line 191, in <module>
    streaming_example.postprocessing()
  File "connection_test.py", line 172, in postprocessing
    check=True
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ffmpeg', '-i', '/tmp/olympe_streaming_test_osjsjr8x/h264_data.264', '-c:v', 'copy', '/tmp/olympe_streaming_test_osjsjr8x/h264_data.mp4']' returned non-zero exit status 1.

Here is the console output when running sphinx (working):

Olympe streaming example output dir: /tmp/olympe_streaming_test_cvvlx4bb
I arsdkctrl: discovery 'net': start
I arsdkctrl: discovery 'net': add device name='ANAFI-0000000' id='000000000000000000'
I arsdkctrl_net: Sending json:
I arsdkctrl_net: { "arstream2_client_stream_port": "55004", "arstream2_client_control_port": "55005", "arstream2_supported_metadata_version": "1", "controller_name": "arsdk-ng", "controller_type": "desktop", "d2c_port": 9988, "device_id": "", "qos_mode": 0 }
I arsdkctrl_net: Received json:
I arsdkctrl_net: { "c2d_update_port": 51, "c2d_user_port": 21, "status": 0, "c2d_port": 2233, "qos_mode": 0, "proto_v": 1 }
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 234, in 'calling callback function'
  File "/home/picklefizz/code/parrot-groundsdk/out/olympe-linux/final/usr/lib/python3.6/site-packages/olympe_deps.py", line 70, in <lambda>
    type_((lambda callback: lambda *args: callback(*args))(bound_fields[name]))
  File "/home/picklefizz/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/drone.py", line 408, in _recv_cmd_cb
    raise RuntimeError("Unknown message id {}".format(message_id))
RuntimeError: Unknown message id 2432696335
I pdraw_session: state change to CREATED
I pdraw_session: state change to OPENING
I pdraw_element: 'StreamDemuxerNet': element state change to CREATED
I pdraw_element: 'StreamDemuxerNet': element state change to STARTING
I rtsp_client: connecting to address 10.202.0.1 port 554
I pdraw_element: 'StreamDemuxerNet': element state change to STARTED
I pdraw_session: state change to OPENED
I rtsp_client: client connected
I pdraw_dmxstrm: RTSP connected
I rtsp_client: send RTSP request OPTIONS: cseq=1 session=-
E pdraw_dmxstrmnet: getSingleStreamLocalStreamPort:231: invalid stream socket err=71(Protocol error)
E pdraw_dmxstrmnet: getSingleStreamLocalControlPort:246: invalid control socket err=71(Protocol error)
I rtsp_client: response to RTSP request OPTIONS: status=200(OK) cseq=1 session=- req_status=OK
I rtsp_client: send RTSP request DESCRIBE: cseq=2 session=-
I rtsp_client: response to RTSP request DESCRIBE: status=200(OK) cseq=2 session=- req_status=OK
I pdraw_dmxstrm: application selected media 1 (DefaultVideo)
I rtsp_client: send RTSP request SETUP: cseq=3 session=-
I rtsp_client: response to RTSP request SETUP: status=200(OK) cseq=3 session=16d90c2b7cedd68c req_status=OK
I rtsp_client: client session 16d90c2b7cedd68c added
I rtsp_client: send RTSP request PLAY: cseq=4 session=16d90c2b7cedd68c
I rtsp_client: response to RTSP request PLAY: status=200(OK) cseq=4 session=16d90c2b7cedd68c req_status=OK
I vstrm: receiver: init_source: ssrc=0xb9a0278e seq=0
I vstrm: receiver: init_seq: seq=0
I pdraw_dmxstrm: new output media
I pdraw_source: 'StreamDemuxerNet': add port for media id=1 type=VIDEO
I vdec_ffmpeg: libavcodec version=57.89.100 - using CPU H.264 decoding
I pdraw_element: 'AvcDecoder': element state change to CREATED
I pdraw_sink: 'AvcDecoder': link media id=1 type=VIDEO
I pdraw_element: 'AvcDecoder': element state change to STARTING
I vdec: dimensions: width=1280 height=720 SAR=1:1
I vdec: crop: left=0 top=0 width=1280 height=720
I vdec: declared framerate: 30000/1001 -> 29.970 fps
I vdec: declared NAL bitrate: 5000000 bit/s (CPB size 3000000 bits)
I pdraw_source: 'AvcDecoder': add port for media id=2 type=VIDEO
I pdraw_element: 'AvcDecoder': element state change to STARTED
I pdraw_source: 'StreamDemuxerNet': link media id=1 type=VIDEO (channel key=0x7fae50045d10)
W pdraw_decavc: duplicate timestamp (0), incrementing
I pdraw_element: 'VideoSink': element state change to CREATED
I pdraw_sink: 'VideoSink': link media id=2 type=VIDEO
I pdraw_element: 'VideoSink': element state change to STARTING
I pdraw_element: 'VideoSink': element state change to STARTED
I pdraw_source: 'AvcDecoder': link media id=2 type=VIDEO (channel key=0x7fae500a5600)
I pdraw_element: 'VideoSink': element state change to CREATED
I pdraw_sink: 'VideoSink': link media id=1 type=VIDEO
I pdraw_element: 'VideoSink': element state change to STARTING
I pdraw_element: 'VideoSink': element state change to STARTED
I pdraw_source: 'StreamDemuxerNet': link media id=1 type=VIDEO (channel key=0x7fae500a57b0)
[h264 @ 0x7fae500460e0] Reinit context to 1280x720, pix_fmt: yuv420p
W pdraw_decavc: timestamp rollback from 1 to 0, incrementing
E pdraw_sockinet: write:431: sendto err=22(Invalid argument)
E vstrm: vstrm_receiver_write_rtcp:575: cbs.send_ctrl err=22(Invalid argument)
I rtsp_client: send RTSP request GET_PARAMETER: cseq=5 session=16d90c2b7cedd68c
I rtsp_client: response to RTSP request GET_PARAMETER: status=200(OK) cseq=5 session=16d90c2b7cedd68c req_status=OK
I rtsp_client: send RTSP request PAUSE: cseq=6 session=16d90c2b7cedd68c
I rtsp_client: response to RTSP request PAUSE: status=200(OK) cseq=6 session=16d90c2b7cedd68c req_status=OK
I pdraw_session: state change to CLOSING
I pdraw_element: 'StreamDemuxerNet': element state change to STOPPING
I rtsp_client: send RTSP request TEARDOWN: cseq=7 session=16d90c2b7cedd68c
I pdraw_sink: 'VideoSink': unlink media id=1 type=VIDEO
I pdraw_source: 'StreamDemuxerNet': unlink media id=1 type=VIDEO (channel key=0x7fae500a57b0)
I pdraw_dmxstrm: received RTCP goodbye, reason: user disconnection
I pdraw_element: 'AvcDecoder': element state change to STOPPING
I pdraw_sink: 'AvcDecoder': unlink media id=1 type=VIDEO
I pdraw_source: 'StreamDemuxerNet': unlink media id=1 type=VIDEO (channel key=0x7fae50045d10)
I pdraw_source: 'StreamDemuxerNet': delete port for media id=1 type=VIDEO
I pdraw_sink: 'VideoSink': unlink media id=2 type=VIDEO
I pdraw_source: 'AvcDecoder': unlink media id=2 type=VIDEO (channel key=0x7fae500a5600)
I pdraw_source: 'AvcDecoder': delete port for media id=2 type=VIDEO
I pdraw_element: 'VideoSink': element state change to STOPPING
I pdraw_element: 'VideoSink': element state change to STOPPED
I pdraw_element: 'AvcDecoder': element state change to STOPPED
W pomp: event 0x7fae500a01d0 is still attached to loop 0x27eadc0
I pdraw_element: 'VideoSink': element state change to STOPPING
I pdraw_element: 'VideoSink': element state change to STOPPED
W pomp: event 0x7fae500a30b0 is still attached to loop 0x27eadc0
I rtsp_client: response to RTSP request TEARDOWN: status=200(OK) cseq=7 session=16d90c2b7cedd68c req_status=OK
I rtsp_client: client session 16d90c2b7cedd68c removed
I rtsp_client: client disconnected
I pdraw_dmxstrm: RTSP disconnected
I pdraw_element: 'StreamDemuxerNet': element state change to STOPPED
I pdraw_session: state change to CLOSED
I arsdkctrl: discovery 'net': remove device name='ANAFI-0000000' id='000000000000000000'
I arsdkctrl: discovery 'net': stop
ffmpeg version 6591f3c0b4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/home/picklefizz/code/parrot-groundsdk/out/olympe-linux/staging/usr --sysconfdir=/home/picklefizz/code/parrot-groundsdk/out/olympe-linux/staging/etc ac_cv_prog_YACC= --disable-maintainer-mode --disable-nls --disable-gtk-doc --disable-gtk-doc-html --disable-doxygen-docs --disable-doc --disable-docs --disable-documentation --disable-option-checking --quiet --enable-silent-rules --arch=x86_64 --enable-shared --enable-cross-compile --enable-optimizations --cross-prefix= --target-os=linux --disable-orc --disable-avconv --disable-avplay --disable-avprobe --disable-avserver --disable-avdevice --disable-avresample --disable-filters --disable-network --disable-yasm --disable-bzlib --disable-gpl --disable-version3 --disable-nonfree --disable-everything --enable-avcodec --enable-decoder=h264 --enable-protocol=file --enable-demuxer=h264 --enable-muxer=h264 --enable-parser=h264 --enable-muxer=mp4
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
Input #0, h264, from '/tmp/olympe_streaming_test_cvvlx4bb/h264_data.264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 29.75 fps, 29.97 tbr, 1200k tbn, 59.94 tbc
Output #0, mp4, to '/tmp/olympe_streaming_test_cvvlx4bb/h264_data.mp4':
  Metadata:
    encoder         : Lavf57.71.100
    Stream #0:0: Video: h264 (Main) ([33][0][0][0] / 0x0021), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 29.75 fps, 29.97 tbr, 1200k tbn, 1200k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x55f5b4773a60] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=  131 fps=0.0 q=-1.0 Lsize=      25kB time=00:00:04.37 bitrate=  46.9kbits/s speed=7.48e+03x    
video:23kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.267691%

For the sake of brevity, I have the output at a low log level. If more detail is needed please let me know.

I’ve looked at all revelant posts I could find, but none address my issues. If you have an idea of why this is happening please reply.

Thank you very much.

CLOSING