gpt4 book ai didi

ffmpeg输入rtsp错误

转载 作者:行者123 更新时间:2023-12-04 23:27:34 25 4
gpt4 key购买 nike

我从相机成功播放了 url rtsp://admin:admin@camera-ip:4455 这个链接。
但是当我通过ffmpeg得到它时。

ffmpeg -i rtsp://admin:admin@camera-ip:4455 -codec copy -f rtmp:/streaming-ip:1935/RTMP/test

我得到了错误:
[rtsp @ 0x241f0e0] UDP timeout, retrying with TCP
[rtsp @ 0x241f0e0] method PAUSE failed: 455 Method Not Valid in This State
[rtsp @ 0x241f0e0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://admin:admin@camera-ip:4446':
Metadata:
title : RTSP Session/2.0
Duration: N/A, bitrate: 64 kb/s
Stream #0:0: Video: h264, none, 90k tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
Output #0, flv, to 'rtmp://streaming-ip:1935/RTMP/test':
Metadata:
title : RTSP Session/2.0
encoder : Lavf56.15.102
Stream #0:0: Audio: pcm_alaw ([7][0][0][0] / 0x0007), 8000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Press [q] to stop, [?] for help
[rtsp @ 0x241f0e0] UDP timeout, retrying with TCP
rtsp://admin:admin@camera-ip:4446: Operation not permitted
[flv @ 0x250ca00] Failed to update header with correct duration.
[flv @ 0x250ca00] Failed to update header with correct filesize.
size= 0kB time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

是什么原因?我能做些什么来解决这个问题。

感谢您的帮助。

最佳答案

看起来您正在尝试将 RTSP 流转换为 RTMP。要将您的问题分成几部分,我建议确保您能够成功接收 RTSP 流,一旦您确认可以尝试将其转换为 RTMP。

使用 ffplay 可以验证 ffmpeg 是否可以正常接收 RTSP 流。您也可以使用 Wireshark 来捕获 RTSP 通信。

RTMP 使用 1935 端口,请确保您有权在该端口上打开 TCP 套接字。使用 sudo 以防万一。希望这可以帮助。

关于ffmpeg输入rtsp错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38409705/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com