Comments (7)
好的好的!谢谢指正! 还有那个 命令真的很好就加了一个copy...居然...延迟一下降低了5s...还不怎么卡了...厉害厉害
from ffch4j.
这是rtsp协议默认使用udp导致的问题,所以rtsp强制使用tcp方式可以一定程度避免丢包。例如在命令中使用 -rtsp_transport tcp
from ffch4j.
tests发生网络异常丢包,消息体:[rtsp @ 0000000000eea340] max delay reached. need to consume packet
tests发生网络异常丢包,消息体:[rtsp @ 0000000000eea340] RTP: missed 5 packets
tests发生网络异常丢包,消息体:[rtsp @ 0000000000eea340] max delay reached. need to consume packet
tests发生网络异常丢包,消息体:[rtsp @ 0000000000eea340] RTP: missed 4 packets
tests:frame=13302 fps= 25 q=28.0 size= 155248kB time=00:08:53.56 bitrate=2383.6kbits/s dup=0 drop=5 speed=0.998x我用的是java写的test程序,实现rtsp转为rtmp并推流出去通过Nginx后在WEB页面通过标签来进行实时视频的播放,但是由于经常丢包所以视频延时达到了7秒,并且经常花屏.很不稳定,想问问大佬有什么办法改进嘛...
具体代码很简单如下: 用户名和密码暂时用了密码代替...
String ip = "192.168.1.11";
String id = "tests";
FFmpegManagerImpl manager = null;
if (manager == null) {
manager = new FFmpegManagerImpl();
}
Map<String,String> map = new HashMap<>();
map.put("appName", id);
map.put("input", "rtsp://username:password@" + ip + ":554");
map.put("output", "rtmp://localhost/live/");
map.put("codec", "h264");
map.put("fmt", "flv");
map.put("fps", "25");
map.put("rs", "640x360");
map.put("twoPart", "0");
// 执行任务,id就是ap"pName,如果执行失败返回为null
return manager.start(map);
命令可以改成使用这种方式拼接:
//执行原生ffmpeg命令(不包含ffmpeg的执行路径,该路径会从配置文件中自动读取)
manager.start("test1", "ffmpeg -i rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov -rtsp_transport tcp -vcodec copy -acodec copy -f flv -y rtmp://eguid.cc/rtmp/test");
//包含完整ffmpeg执行路径的命令
manager.start("test2,","d:/ffmpeg/ffmpeg -i rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov -rtsp_transport tcp -vcodec copy -acodec copy -f flv -y rtmp://eguid.cc/rtmp/test",true);
from ffch4j.
感谢大佬的详细解答!
非常感谢,问题已经解决真的是爽快.... 就加了那么一个命令就解决了,已经完全没有丢包情况,但是还是经常会卡顿?播放出来的视频一卡一卡.难道还是命令不够完善的问题嘛(我越发的决定我的命令不好使了...好像还有很大的改善空间)
请大佬指示!
命令如下:
manager.start("tests","ffmpeg -rtsp_transport tcp -i rtsp://admin:[email protected]:554 -vcodec h264 -f flv -an rtmp://localhost/live/tests ");
from ffch4j.
发生卡顿问题的原因很多,比如网络状况,gop,缓存,帧率、编解码效率等等,可能还有一些其他因素没有说明,但是你这个命令可以通过最简单的转封装来优化转换效率,比如改成这样:manager.start("tests","ffmpeg -rtsp_transport tcp -i rtsp://admin:[email protected]:554 -vcodec copy -f flv -an rtmp://localhost/live/tests ");
from ffch4j.
我这个是通过Nginx来进行中转的,我是不是可以从Nginx的rtmp的配置方向考虑考虑
from ffch4j.
nginx-rtmp确实有很大的优化空间
from ffch4j.
Related Issues (20)
- 运行后提示超时 HOT 1
- 打包成jar找不到配置文件 HOT 7
- 请问106.14.182.20这个服务器是用什么搭建的? HOT 5
- 执行摄像头推流,在设定一个时间段内未取流,自动关闭推流吗? HOT 1
- 代码问题 HOT 8
- KeepAliveHandler保持活动状态会导致cpu100% HOT 4
- 有没有遇到过ffmpeg运行久了,内存增大的现象 HOT 3
- 版本更新加油啊 HOT 2
- 摄像头断网问题 HOT 2
- 您好,感觉有的流断的不彻底 HOT 2
- 使用视频推流,如何感知进程结束
- 小白 请问回调地址是干嘛 HOT 2
- 为啥预览延迟挺高的
- 一个MP4文件同时推流到3个服务器。为什么不成功?是我的命令错了吗?谢谢!感激涕零!
- 用rtsp-rtmp转流多任务测试 --》rtmp转m3u8,切20个视频源,切片有多又少,不稳定怎么办
- 可以的,代码写的很漂亮
- 推流时占用CPU特别高,如何设置推流不间断? HOT 1
- 使用录播的命令,为什么录的视频没有时长呢
- 关于切换视频流的问题
- 如何循环推流MP4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffch4j.