简体   繁体   English

ffmpeg流rtsp到mpegts

[英]ffmpeg stream rtsp to mpegts

I'm trying to transcode an rtsp stream into something that Android can read. 我正在尝试将rtsp流转码为Android可以读取的内容。

I need to take a input of rtsp: Transcode it to H.264 AVC (Baseline) MPEGTS + AAC LC audio. 我需要输入rtsp:将其转码为H.264 AVC(基准)MPEGTS + AAC LC音频。 Broadcast out onto the localhost socket. 广播到localhost套接字上。

Currently I have: bash ffmpeg -re -i rtsp://admin:12345@remote-address:55266/videoMain -c:a copy -c:v libx264 -r 25 -preset ultrafast -profile:v baseline -f mpegts udp://127.0.0.1:65440 当前我有: bash ffmpeg -re -i rtsp://admin:12345@remote-address:55266/videoMain -c:a copy -c:v libx264 -r 25 -preset ultrafast -profile:v baseline -f mpegts udp://127.0.0.1:65440

I see ffmpeg printing out that it's copying frames to the output. 我看到ffmpeg打印出它正在将帧复制到输出。 But if I try to connect to the stream in VLC, I see nothing. 但是,如果我尝试连接到VLC中的流,则看不到任何内容。 (The original source works fine in VLC). (原始源在VLC中工作正常)。

Can anyone see if I am doing something wrong? 谁能看到我做错了什么?

You should send the stream to a multicast address, for example udp://224.0.0.100 . 您应该将流发送到多播地址,例如udp://224.0.0.100

Note that without an announcement this will work only if the stream consumer knows what to expect. 请注意,只有在流消费者知道所期望的情况下,它才会在没有通知的情况下起作用。 Otherwise it is better to use RTSP so that the stream details are announced in an sdp file. 否则,最好使用RTSP,以便在sdp文件中声明流详细信息。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM