From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 47B1148291 for ; Mon, 15 Jan 2024 20:37:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2858D68CED1; Mon, 15 Jan 2024 22:37:34 +0200 (EET) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 24C3268C89E for ; Mon, 15 Jan 2024 22:37:28 +0200 (EET) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a298accc440so1124181266b.1 for ; Mon, 15 Jan 2024 12:37:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705351047; x=1705955847; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:from:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=NILnNaHO9J38XK8OBKIi+wSEDiL7QcHNDOKO7XgX76o=; b=eefNI/riFM9BlEyov8xERSNYm/7xr1MFwrrzEEJ5wtm8e23vuQZxzzVaHEVL9fez22 wOTV97H9SnUoTNsti00HfUL88PQxTXU4nR/nQYInTvV4BqkH3WEfZO5WWvQz1/uFfbZy EFzTOemn8Fjt2hXjZn0GKcn0dfdKBV+nNmkM8PyVXBrO8Jv4FSj8zcg24hHk20uWn4ui p/+QuDJ8ytF7Qn655LINha9ks/MSCQxEecoVdVZpi7D2Dt1v0eMrVY98W14hnUJAp4Uu dzq5JE0Wfz8MamHba8VjqpZNekCBPK6hYdazmXKmP8NyMEPI/7UScspON1edvh+qVkD0 HDdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705351047; x=1705955847; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NILnNaHO9J38XK8OBKIi+wSEDiL7QcHNDOKO7XgX76o=; b=piHmlKOuYwJ4GVEXJHo0rmWstTYci4MQB/6YcqxvrEMmJfdX7dFAwJoVyzOXwmT5ZK toNrnCc7fQrE5BM7rnbiKAXenkq/OAQf1sf5JSuT/sRWgx7NHSVdGiSmqxnpKN6gq83E EqtUNkpkut85RT3tTnXf/6wvo3E0wjzWFkRYhZ9/9QDePxjjJTOKe8RsgJ6jYfdlVSsH KdK8DUOcmJl3l5FCnv5kmlZfmGRCdb7v8o5OPS+ogXl5qlAhZQHkOcKiHkWA/4nz9Rh+ WZZpMj1IPwIO4bek3SLHDRZlnZdgIgx71i4Ed4yJS31N//kPKdIco1kgV5T15FQSlFnj A2zw== X-Gm-Message-State: AOJu0Yxq/YBntOgo71UNvpuFfA3tAv/mUVVlK2fvvf5NVJNp2dUaqI4F ZUn8dyZUX/jP6S6/HtzhijPi7ObqdGg= X-Google-Smtp-Source: AGHT+IEAdWqEYNsVGDU+MinBnMRNoULwKxEoSAAk/kFKQaZgTBJfi6ooeOjfwVhnGGwS3Z1PCC4/TA== X-Received: by 2002:a17:906:1608:b0:a2d:3b4f:a2ae with SMTP id m8-20020a170906160800b00a2d3b4fa2aemr1986228ejd.137.1705351046728; Mon, 15 Jan 2024 12:37:26 -0800 (PST) Received: from [192.168.0.180] ([77.222.158.233]) by smtp.gmail.com with ESMTPSA id b21-20020a17090630d500b00a2c4c23cd12sm5630124ejb.217.2024.01.15.12.37.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jan 2024 12:37:26 -0800 (PST) Message-ID: Date: Mon, 15 Jan 2024 22:37:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Paul Orlyk To: ffmpeg-devel@ffmpeg.org References: <20240113182218.GE6420@pb2> Content-Language: en-US In-Reply-To: <20240113182218.GE6420@pb2> Subject: [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes server compatibility issues with rtspclientsink GStreamer plugin. >>From specification: RFC 7826 "Real-Time Streaming Protocol Version 2.0" (https://datatracker.ietf.org/doc/html/rfc7826), section 18.54: mode: The mode parameter indicates the methods to be supported for this session. The currently defined valid value is "PLAY". If not provided, the default is "PLAY". The "RECORD" value was defined in RFC 2326; in this specification, it is unspecified but reserved. RECORD and other values may be specified in the future. RFC 2326 "Real Time Streaming Protocol (RTSP)" (https://datatracker.ietf.org/doc/html/rfc2326), section 12.39: mode: The mode parameter indicates the methods to be supported for this session. Valid values are PLAY and RECORD. If not provided, the default is PLAY. mode=receive was always like this, from the initial commit 'a8ad6ffa rtsp: Add listen mode'. For comparison, Wowza was used to push RTSP stream to. Both GStreamer and FFmpeg had no issues. Here is the capture of Wowza responding to SETUP request: 200 OK CSeq: 3 Server: Wowza Streaming Engine 4.8.26+4 build20231212155517 Cache-Control: no-cache Expires: Mon, 15 Jan 2024 19:40:31 GMT Transport: RTP/AVP/UDP;unicast;client_port=11640-11641;mode=record;source=172.17.0.2;server_port=6976-6977 Date: Mon, 15 Jan 2024 19:40:31 GMT Session: 1401457689;timeout=60 Test setup: Server: ffmpeg -loglevel trace -y -rtsp_flags listen -i rtsp://0.0.0.0:30800/live.stream t.mp4 FFmpeg client: ffmpeg -re -i "Big Buck Bunny - FULL HD 30FPS.mp4" -c:v libx264 -f rtsp rtsp://127.0.0.1:30800/live.stream GStreamer client: gst-launch-1.0 videotestsrc is-live=true pattern=smpte ! queue ! videorate ! videoscale ! video/x-raw,width=640,height=360,framerate=60/1 ! timeoverlay font-desc="Sans, 84" halignment=center valignment=center ! queue ! videoconvert ! tee name=t t. ! x264enc bitrate=9000 pass=cbr speed-preset=ultrafast byte-stream=false key-int-max=15 threads=1 ! video/x-h264,profile=baseline ! queue ! rsink. audiotestsrc ! voaacenc ! queue ! rsink. t. ! queue ! autovideosink rtspclientsink name=rsink location=rtsp://localhost:30800/live.stream Test results: modified FFmpeg client -> stock server : ok stock FFmpeg client -> modified server : ok modified FFmpeg client -> modified server : ok GStreamer client -> modified server : ok Signed-off-by: Paul Orlyk --- libavformat/rtspdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 39fd92fb66..d6a223cbc6 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl) rtsp_st->interleaved_min = request.transports[0].interleaved_min; rtsp_st->interleaved_max = request.transports[0].interleaved_max; snprintf(responseheaders, sizeof(responseheaders), "Transport: " - "RTP/AVP/TCP;unicast;mode=receive;interleaved=%d-%d" + "RTP/AVP/TCP;unicast;mode=record;interleaved=%d-%d" "\r\n", request.transports[0].interleaved_min, request.transports[0].interleaved_max); } else { @@ -333,7 +333,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl) localport = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle); snprintf(responseheaders, sizeof(responseheaders), "Transport: " - "RTP/AVP/UDP;unicast;mode=receive;source=%s;" + "RTP/AVP/UDP;unicast;mode=record;source=%s;" "client_port=%d-%d;server_port=%d-%d\r\n", host, request.transports[0].client_port_min, request.transports[0].client_port_max, localport, -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".