FFMPEG和FFPLAY可以从一个IP访问RTSP流,但是从另一个IP中可以访问RTSP流
情况很复杂。我正在通过OPENCV归档几个CCTV摄像头供稿(RTSP,H264,无音频),但是CPU利用率过高,并且开始逐渐失去一些框架。
为了减少CPU利用率,我开始使用FFMPEG跳过解码和编码过程,这些过程在我的家用机上非常有效。但是,当我连接到大学VPN并尝试在我们的实验室服务器上部署它时,FFMPEG无法读取任何帧,FFPlay也无法获得任何东西。但是,OpenCV,VLC播放器和IINA播放器仍然可以阅读和显示提要。
总之,
1 ffmpeg/ffplay
1.1只能
从其他两个网络中读取我的家庭网络(Wi-Fi,最佳)1.2的feed,错误消息说:“无法找到流的编解码器参数(视频:H264,无,无):未指定的尺寸 考虑增加“分析性”(0)和“探测”(5000000)选项的值”
2 IINA/VLC播放器,OpenCV 这些工具可以一直获取视频。
我想知道FFMPEG所需的某些特定端口访问是否与某些特定的端口访问有关。如果有人能提供任何建议,我将不胜感激。
作为参考,测试的FFPLAY命令很简单:
ffplay 'the rtsp address'
感谢
更新
已执行更多测试。
通过将RTSP_Transport指定为TCP,FFPlay可以播放视频,但是FFMPEG无法访问视频。 (一开始,当FFMPEG和FFPlay通过我的家庭网络工作时,它是UDP) FFMPEG命令如下:
ffmpeg -i rtsp://the_ip_address/axis-media/media.amp -hide_banner -c:v copy -s 1920x1080 -segment_time 00:30:00 -f segment -strftime 1 -reset_timestamps 1 -rtsp_transport tcp "%Y-%m-%d-%H-%M-%S_Test.mp4"
请帮助...
The situation is kind of complex. I was archiving several CCTV camera feeds (rtsp, h264, no audio) through OpenCV, which worked but the CPU utilization was too high and started to lose some frames time by time.
To reduce the CPU utilization, I started to use FFMPEG to skip the decoding and encoding processes, which worked perfectly on my home machine. However, when I connected to my university VPN and tried to deploy it on our lab server, FFmpeg couldn't read any frame, ffplay couldn't get anything either. However, OpenCV, VLC Player and IINA Player could still read and display the feed.
In Summary,
1 FFMPEG/ffplay
1.1 can only read the feed from my home network(Wi-Fi, optimum)
1.2 from other two networks, the error message says: "Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options"
2 IINA/VLC Player, OpenCV
These tools can get the video all the time.
I'm wondering whether it's related to some specific port access, that the ffmpeg required but the others don't. I'd appreciate it if anyone can provide any suggestions.
As references, the tested ffplay command is simple:
ffplay 'the rtsp address'
Thanks
Update
More tests have been performed.
By specifying rtsp_transport as TCP, ffplay can play the video, but FFmpeg can't access the video. (In the beginning, when both FFmpeg and ffplay worked through my home network, it was UDP)
The FFmpeg command is as follows:
ffmpeg -i rtsp://the_ip_address/axis-media/media.amp -hide_banner -c:v copy -s 1920x1080 -segment_time 00:30:00 -f segment -strftime 1 -reset_timestamps 1 -rtsp_transport tcp "%Y-%m-%d-%H-%M-%S_Test.mp4"
Please help...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过强迫它在-i之前使用“ -rtsp_transport tcp”来解决。
Solved by forcing it to use "-rtsp_transport tcp" right before -i.