Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to force the use of TCP protocol when capturing RTSP protocol video streams? #711

Closed
yanest opened this issue Dec 6, 2016 · 5 comments
Assignees
Labels
TransByAI Translated by AI/GPT.
Milestone

Comments

@yanest
Copy link

yanest commented Dec 6, 2016

The -rtsp_transport tcp parameter in ffmpeg.

TRANS_BY_GPT3

@yanest
Copy link
Author

yanest commented Dec 6, 2016

Using the following format in ffmpeg, you can capture it, but I couldn't find the corresponding setting method in SRS2.0. The main concern is how to add double quotes and how to add the parameters to force TCP.
ffmpeg -rtsp_transport tcp -i "rtsp://admin:12345678@192.168.2.21:554/Streaming/Channels/501?transportmode=unicast" -vcodec copy -an -f flv rtmp://127.0.0.1:1935/live/mystream

TRANS_BY_GPT3

@winlinvip winlinvip added this to the srs 3.0 release milestone Dec 9, 2016
@winlinvip
Copy link
Member

winlinvip commented Jan 6, 2017

Double quotation marks are only necessary in the command line. In fact, SRS fork processes do not require double quotation marks.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jan 6, 2017


    ingest {
        enabled      on;
        input {
            type    stream;
            url     rtsp://admin:12345678@192.168.2.21:554/Streaming/Channels/501?transportmode=unicast;
        }
        ffmpeg      ./objs/ffmpeg/bin/ffmpeg;
        engine {
            enabled          on;
            perfile {
                rtsp_transport tcp;
            }
            vcodec copy;
            acodec copy;
            output          rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
        }
    }

Added a profile that supports adding rtsp_transport in front of -i.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jan 6, 2017

Generated log:

[2017-01-06 10:38:51.105][trace][9604][105] fored process, pid=9605, bin=./objs/ffmpeg/bin/ffmpeg, stdout=./objs/ffmpeg-ingest-__defaultVhost__-live-livestream.log, stderr=./objs/ffmpeg-ingest-__defaultVhost__-live-livestream.log, argv=./objs/ffmpeg/bin/ffmpeg -rtsp_transport tcp -i rtsp://admin:12345678@192.168.2.21:554/Streaming/Channels/501?transportmode=unicast -vcodec copy -acodec copy -f flv -y rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__/livestream

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jan 6, 2017

Note that it is resolved by SRS3.

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Sep 18, 2021
@winlinvip winlinvip changed the title 采集RTSP协议视频流的时候如何强制使用tcp协议? How to force the use of TCP protocol when capturing RTSP protocol video streams? Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

2 participants