Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th August 2021, 09:53   #1  |  Link
Barabba
Registered User
 
Barabba's Avatar
 
Join Date: Jul 2007
Posts: 48
Force FFmpeg output only TCP as RTSP proxy

Hi! do somebody here knows how to force ffmpeg outputing a TCP rtsp instead of default UDP? I know how to force the input to TCP, with -rtsp_transport tcp option, but I can't find how to force the output.
Read somewhere that someone solved suggesting to use avformat_write_header(ofmt_ctx, &options); but didn't say nothing mode about that.. and this is too generic info. Thanks a lot for help!
Barabba is offline   Reply With Quote
Old 20th August 2021, 12:27   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Any of these any good,

What steps are needed to stream RTSP from FFmpeg?
https://stackoverflow.com/questions/...sp-from-ffmpeg

FFmpeg - capture a rtsp stream and re-stream it to another rtsp-server
https://stackoverflow.com/questions/...er-rtsp-server

How to minimize the delay in a live streaming with ffmpeg
https://stackoverflow.com/questions/...ng-with-ffmpeg

StackOverflow:- Hot answers tagged rtsp
https://stackoverflow.com/tags/rtsp/hot?filter=year

Or more of same, Google:-
Code:
"ffmpeg" NEAR "TCP rtsp" site:stackoverflow.com
https://www.google.co.uk/search?q=%2...w=1920&bih=909

Good Luck
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 20th August 2021, 20:54   #3  |  Link
Barabba
Registered User
 
Barabba's Avatar
 
Join Date: Jul 2007
Posts: 48
Hi, thanks for links, I've spent hours reading all around, I can't solve my problem.
I?m using this string, it connect to first sopurce by TCP, but ffmpeg is not opening a tcp listenng port. It does open 4 UDP ports with different values (far from what I've specified for tcp), anyway I've tried to connect to them too with VLC, but no one works.

ffmpeg -re -i rtsp://adminassord@rtsp.source:554/live.sdp -rtsp_transport tcp -f rtsp -rtsp_transport tcp rtsp:/192.168.0.100:50041/

May you kindly correct it if it is wrong?
Barabba is offline   Reply With Quote
Old 21st August 2021, 00:58   #4  |  Link
patul
Registered User
 
Join Date: Sep 2005
Posts: 130
You need to put the -rstp_transport tcp before the input, something like this

PHP Code:
ffmpeg -rtsp_transport tcp -re -i rtsp://admin:password@rtsp.source:554/live.sdp -f rtsp -muxdelay 0.1 rtsp://localhost:7000 

Last edited by patul; 21st August 2021 at 01:01.
patul is offline   Reply With Quote
Old 23rd August 2021, 13:19   #5  |  Link
Barabba
Registered User
 
Barabba's Avatar
 
Join Date: Jul 2007
Posts: 48
thanks for answering me,
I underline the problem is not input (to connect by tcp only to an rtsp source), the problem is output, to stream from ffmpeg only with TCP, ignoring any UDP request and forse to use TCP only. How this can be possible? Thank you.
I've tried some apps on Android TV to show an rtsp stream, they will connect by UDP as first attempt, there are no way to foce this clients to use TCP, I've tried with Windows firewall but didn't work. I need to kill UDP
Thank you
Barabba is offline   Reply With Quote
Old 24th August 2021, 00:31   #6  |  Link
patul
Registered User
 
Join Date: Sep 2005
Posts: 130
I tried that command, no udp port was opened. Other thing I can think of is

Quote:
-rtsp_flags prefer_tcp
patul is offline   Reply With Quote
Old 25th August 2021, 21:20   #7  |  Link
Barabba
Registered User
 
Barabba's Avatar
 
Join Date: Jul 2007
Posts: 48
I've solved it using https://github.com/aler9/rtsp-simple-server
in the end you may get a TCP stream from the rtsp://serverIPort/proxied
seems there are no ways to tell ffmpeg to stream on TCP only
Barabba is offline   Reply With Quote
Reply

Tags
ffmpeg, proxy, rtsp, tcp


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.