Skip to content

[RTSP] Nonmatching transport in server reply #2

Description

@diegonc

I'm using BStreamer to simulate an RTSP camera and when I add it to Feniks
as a new stream, the logs contain the following stacktrace after clicking the "Find Optimal Settings for Camera" button:

ffmpeg_service-instance    | Exception in thread Thread-11 (handle):                                       
ffmpeg_service-instance    | Traceback (most recent call last):
ffmpeg_service-instance    |   File "/usr/lib/python3.10/threading.py", line 1009, in _bootstrap_inner     
ffmpeg_service-instance    |     self.run()
ffmpeg_service-instance    |   File "/usr/lib/python3.10/threading.py", line 946, in run                   
ffmpeg_service-instance    |     self._target(*self._args, **self._kwargs)
ffmpeg_service-instance    |   File "/app/various/probe_event_handler.py", line 36, in handle              
ffmpeg_service-instance    |     probe: dict = ffmpeg.probe(request.address)
ffmpeg_service-instance    |   File "/usr/local/lib/python3.10/dist-packages/ffmpeg/_probe.py", line 23, in
 probe         
ffmpeg_service-instance    |     raise Error('ffprobe', out, err)                                          
ffmpeg_service-instance    | ffmpeg._run.Error: ffprobe error (see stderr output for detail)

The offending line seems to be the following:

probe: dict = ffmpeg.probe(request.address)

So, trying that line in a REPL I get the error in the title of this issue report:

>>> try:
...   ffmpeg.probe("rtsp://192.168.6.64:7554/file-mp4", hide_banner=None)
... except ffmpeg.Error as e:
...   print(e.stderr)
... 
b'[rtsp @ 0x55798ead2ec0] Nonmatching transport in server reply\nrtsp://192.168.6.64:7554/file-mp4: Invalid data found when processing input\n'

If I pass the rtsp_transport parameter to the ffmpeg.probe method the operation completes correctly:

>>> try:
...   ffmpeg.probe("rtsp://192.168.6.64:7554/file-mp4", hide_banner=None, rtsp_transport="tcp")
... except ffmpeg.Error as e:
...   print(e.stderr)
... 
{'streams': [{'index': 0, 'codec_name': 'h264', 'codec_long_name': 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10', 'profile': 'High', 'codec_type': 'video', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'width': 1920, 'height': 1080, 'coded_width': 1920, 'coded_height': 1080, 'closed_captions': 0, 'has_b_frames': 1, 'sample_aspect_ratio': '1:1', 'display_aspect_ratio': '16:9', 'pix_fmt': 'yuv420p', 'level': 40, 'color_range': 'tv', 'color_space': 'bt709', 'color_transfer': 'bt709', 'color_primaries': 'bt709', 'chroma_location': 'left', 'field_order': 'progressive', 'refs': 1, 'is_avc': 'false', 'nal_length_size': '0', 'r_frame_rate': '500/317', 'avg_frame_rate': '30000/1001', 'time_base': '1/90000', 'start_pts': 57060, 'start_time': '0.634000', 'bits_per_raw_sample': '8', 'disposition': {'default': 0, 'dub': 0, 'original': 0, 'comment': 0, 'lyrics': 0, 'karaoke': 0, 'forced': 0, 'hearing_impaired': 0, 'visual_impaired': 0, 'clean_effects': 0, 'attached_pic': 0, 'timed_thumbnails': 0}}], 'format': {'filename': 'rtsp://192.168.6.64:7554/file-mp4', 'nb_streams': 1, 'nb_programs': 0, 'format_name': 'rtsp', 'format_long_name': 'RTSP input', 'start_time': '0.634000', 'probe_score': 100, 'tags': {'title': 'bserver'}}}

Not being able to pass the RTSP transport to the find parameters operation seems to be a problem here for IP cameras in wild too[*]

The main issue, I think, is that the process dies before being able to send any response to the event bus. The WebApp keeps the animation of a rolling circle and never completes the process with a success nor a failure indication.

Maybe some try/except and then sending a reply back with an status code could be nice. Also adding a rtsp_transport attribute to the ProbeRequestEvent may allow the probe to complete for these cameras.


[*] I found one result, and others related to OpenCV
(1) https://stackoverflow.com/questions/66280861/ffmpeg-nonmatching-transport-in-server-reply-but-openrtsp-works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions