gpt4 book ai didi

video - 丢弃数据包而不是导致 DTS 错误

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

我有 2 个 ffmpeg 实例,它们正在通过一个用 C 编写的缓冲区。
ffmpeg 实例之一是创建 FLV 输出并将其发送到连接到 C 程序的 TCP 套接字。 C 正在填充一个数组,然后将数据包发送到另一个 ffmpeg 实例。
关键是第一个 ffmpeg 实例可以断开连接,并且可以重新启动。
另一个 ffmpeg 实例如下所示:

ffmpeg \
-re \
-fflags +igndts \
-fflags flush_packets \
-fflags discardcorrupt \
-r 25 \ \
-i $INPUT_VIDEO_STREAM \
-safe 0 \
-i music.txt \
-fflags +genpts \
-c:a mp3 \
-b:a 320k \
-c:v copy \
-frame_drop_threshold 1.0
-preset ultrafast \
-f flv rtmp://live.twitch.tv/app/live_KEY \
-async 1 \
-vsync 2
问题是,如果我停止另一个 ffmpeg 实例并重新启动它,我会收到“Packet lost”错误,之后,我会收到一堆 Non-monotonous DTS in output stream 错误。

[flv @ 0x55acf23632a0] Packet mismatch -1135911011 34757 9695626ate=1560.2kbits/s speed= 1x


...[flv @ 0x55acf23d0ec0] Non-monotonous DTS in output stream 0:0; previous: 62560, current: 19080; changing to 62560. This may result in incorrect timestamps in the output file.[flv @ 0x55acf23d0ec0] Non-monotonous DTS in output stream 0:0; previous: 62560, current: 19120; changing to 62560. This may result in incorrect timestamps in the output file.[flv @ 0x55acf23d0ec0] Non-monotonous DTS in output stream 0:0; previous: 62560, current: 19160; changing to 62560. This may result in incorrect timestamps in the output file.[flv @ 0x55acf23d0ec0] Non-monotonous DTS in output stream 0:0; previous: 62560, current: 19200; changing to 62560. This may result in incorrect timestamps in the output file.[flv @ 0x55acf23d0ec0] Non-monotonous DTS in output stream 0:0; previous: 62560, current: 19240; changing to 62560. This may result in incorrect timestamps in the output file.[flv @ 0x55acf23d0ec0] Non-monotonous DTS in output stream 0:0; previous: 62560, current: 19280; changing to 62560. This may result in incorrect timestamps in the output file.[flv @ 0x55acf23d0ec0] Non-monotonous DTS in output stream 0:0; previous: 62560, current: 19320; changing to 62560. This may result in incorrect timestamps in the output file....


我想要发生的是继续播放 mp3 并丢弃坏的视频包,视频剪辑可以被剪切并且新剪辑可以开始播放。如果视频在几秒钟内表现得很奇怪,即使这样也可以,但是流需要是连续的。
我已经尝试过的事情:
  • 几个异步/垂直同步选项(垂直同步 1、垂直同步 2、垂直同步下降)
  • “-fflags +igndts”,删除此选项,将其添加到输出中
  • -fflags +genpts
  • 将 probesize 设置为 32
  • fflags 丢弃损坏

  • 我也开始写一个 setpts 过滤器,但不知道语法
    如何以视频时间戳不连续的方式流式传输 mp3 列表,有时会发生丢包?

    最佳答案

    似乎是“-c:v copy”导致了问题。
    我改了-c:v copy-c:v libx264现在它按预期工作。
    我还添加了 -re在音频输入之前。

    关于video - 丢弃数据包而不是导致 DTS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63583613/

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