• ffmpeg rtsp问题总结


    ffmpeg rtsp问题总结
    //--------------------------------------------------------------------------------------------------
    https://www.cnblogs.com/jixiaohua/p/14543076.html
    发生场景
    使用live555 mediaServer启动rtsp server,然后使用testRTSPClient程序拉流,ffmpeg解码,在视频开头几帧出现该警告,结果导致播放画面闪烁,rtsp client不论使用UDP还是TCP均有该问题,接收缓存足够大

    解决方法
    经Google[h264 @ 0x28819a0] Increasing reorder buffer to 1相关问题,可以在解码时设置-strict 1参数,让ffmpeg使用更高的重排序计数,代码:

    AVDictionary *dict = NULL;
    av_dict_set(&dict, "strict", "1", 0);
    avcodec_open2(ctx, codec, dict); // 参数 AVCodecContext *ctx, AVCodec *codec
    av_dict_free(&dict);
    
    • 1
    • 2
    • 3
    • 4

    //--------------------------------------------------------------------------------------------------
    https://www.zhangshilong.cn/work/405366.html
    场景:读取本地文件
    错误:

    error while decoding MB 98 45, bytestream -6error while decoding MB 64 60, bytestream -8error while decoding MB 73 52, bytestream -12missing picture in access unit with size 12116 No start code is found. Error splitting the input into NAL units.
    解决办法:
    读取文件时调用av_usleep(1000)

    总结:不管读取本地还是网络视频,都不能一股脑读取,中间需要sleep
    //--------------------------------------------------------------------------------------------------
    https://www.codeprj.com/blog/ab2d3c1.html
    问题现象

    [rtsp @ 0000000000122bc0] max delay reached. need to consume packet
    [rtsp @ 0000000000122bc0] RTP: missed 33 packets
    [rtsp @ 0000000000122bc0] max delay reached. need to consume packet
    [rtsp @ 0000000000122bc0] RTP: missed 166 packets
    [h264 @ 0000000002f4b280] out of range intra chroma pred mode
    [h264 @ 0000000002f4b280] error while decoding MB 27 39
    [h264 @ 0000000002f4b280] concealing 502 DC, 502 AC, 502 MV errors in P f
    [h264 @ 0000000002ed08c0] Increasing reorder buffer to 8
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    解决方法:

    采用以下命令进行拉流转发,运行了几个小时,几乎没有出现丢包现象

    ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.168/0 -vcodec copy -f rtsp rtsp://192.168.1.28/11
    
    • 1

    //--------------------------------------------------------------------------------------------------

  • 相关阅读:
    软考知识点---11关系型数据库SQL语言
    zookeeper入门篇之分布式锁
    C语言中malloc(),free(),calloc(),realloc()
    order by注入与limit注入
    Halcon (3):窗体常用语法使用
    设计模式——责任链模式(Chain of Responsibility Pattern)+ Spring相关源码
    硬核Vue3响应式原理解析,为你保驾护航渡过寒冬
    Linux的scp命令远程传输文件
    数据分析三剑客之Pandas
    如何使用Windows GPU 云服务器搭建深度学习环境?
  • 原文地址:https://blog.csdn.net/wzw88486969/article/details/128075812