rtsp 流捕获 [英] rtsp stream capturing

查看:38
本文介绍了rtsp 流捕获的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找转储 rtsp 流的通用方法.我想弄清楚,某些 rtsp 流运行良好,服务器正在发送一些可观看的视频.

I'm looking for some universal way to dump rtsp stream. I want to figure out, that some rtsp stream is working well and server is sending some watchable video.

openRTSP

起初,google 向我推荐了 openRTSP 工具.

At first, google recommends me openRTSP tool.

 openRTSP -4 ${stream_link} > ${output_file}

但是该工具转储的输出视频文件并不正确.视频解码器 (ffdec) 返回许多错误,例如无法解码视频数据包"和[h264] 无帧!",这不适合我.

But output video file dumped by that tool is not really correct. Video decoder (ffdec) returns many errors like "Failed to decode video packet" and "[h264] no frame!", which don't suit me.

ffmpeg

然后我尝试使用 ffmpeg 工具转储 rtsp 流.

Then I've tried to dump rtsp stream with ffmpeg tool.

ffmpeg -loglevel debug -i "${stream_link}" -s 640x480 -vcodec copy -acodec copy -y ${output_file}

但是流处理经常被错误中断:

But streaming process was interrupted often by error:

Application provided invalid, non monotonically increasing dts to muxer in stream 0: 730672 >= 730672
av_interleaved_write_frame(): Invalid argument

我正在尝试使用 --fflags igndts 但 ffmpeg 不会忽略这些错误.这没有任何意义,因为该错误实际上意味着音频和视频流正在异步发送.最糟糕的是,由中断转储导致的转储文件也不正确.Ffdec 返回一些错误:

I'm trying to use --fflags igndts but ffmpeg doesn't ignore these errors. It doesn't make any sense, because that error actually means that audio and video streams are sending asynchronously. The worst thing is that dumped file, resulted by that interrupted dump, is not correct too. Ffdec return some error:

ERROR [mov,mp4,m4a,3gp,3g2,mj2] moov atom not found
ERROR [ffdec] av_open_input_file: Operation not permitted

经过一番很好的谷歌搜索后,我发现它真的很老了ffmpeg 的多路复用器错误.

After a nice cup of googling I've found, that it's really old ffmpeg's muxer bug.

播放器

比我尝试将 mplayer 与 LIVE_555 lib 一起使用.

Than I've tried to use mplayer with LIVE_555 lib.

mplayer -noframedrop -dumpfile ${output_file} -dumpstream ${stream_link}

但我也有一些错误.

Stream not seekable!
Core dumped ;)

问题

我觉得我做错了什么.听起来真的很荒谬,没有办法将 rtsp 流保存在正确且可播放的视频文件中.

I think I'm doing something wrong. It's sounds really ridiculous, that there is no way to save rtsp stream in correct and playable video-file.

也许还有其他一些工具可以帮助完成这项任务?实际上,我将非常感谢您对各种库和语言的任何建议.但是这个过程应该是自动的并且有 cli.

Maybe there are some another tools which can help with that task? Actually, I will be grateful for any advice for all kind of libs and languages. But that process should be automatic and have cli.

改进

我在本地主机上使用模拟 rtsp-broadcaster 的 vlc-streamer 完成了大约 50% 的实验.这是我尝试遵循的手册.

Something about 50% experiments I've done on the localhost with vlc-streamer that emulates rtsp-broadcaster. Here is a manual which I try to follow.

我有非常新鲜和最新的支持 x264 的 ffmpeg,我已经通过 那个 有用的线程安装了它.

I have really fresh and latest ffmpeg with x264 support, that I've installed by that useful thread.

推荐答案

您是否尝试过 vlc 保存 rtsp 流?它对我有用.不过我尝试使用图形界面.但它也应该从命令行工作.

Did you try vlc to save rtsp stream? It worked for me.I tried with graphical interface though. But it should also work from command line.

这篇关于rtsp 流捕获的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆