0

我录制了一个 hls 流,在 26:30:02.81 之后出现了消息:

[http @ 0x558330f5ba80] Opening 'http://de-origin-live-be-01.3qsdn.com:8081/3279/996191_PwxkbnqRThCDGXVr/l_94_95438333_16449.ts?nimblesessionid=2106' for reading
frame=2289669 fps= 24 q=-1.0 size=25056768kB time=26:30:02.81 bitrate=2151.6kbits/s speed=   1x    
[mpegts @ 0x558330f07280] Invalid timestamps stream=0, pts=10378, dts=8589926250, size=11200
[mpegts @ 0x558330f07280] Invalid timestamps stream=0, pts=2908, dts=8589929940, size=3407
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:0; previous: 8586744840, current: -3185972; changing to 8586744841. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:1; previous: 4579598864, current: -1698561; changing to 4579598865. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:1; previous: 4579598865, current: -1697537; changing to 4579598866. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:1; previous: 4579598866, current: -1696513; changing to 4579598867. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:0; previous: 8586744841, current: -3182282; changing to 8586744842. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:1; previous: 4579598867, current: -1695489; changing to 4579598868. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:1; previous: 4579598868, current: -1694465; changing to 4579598869. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:1; previous: 4579598869, current: -1693441; changing to 4579598870. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:0; previous: 8586744842, current: -3178502; changing to 8586744843. This may result in incorrect timestamps in the output file.
[mp4 @ 0x558330f20bc0] Non-monotonous DTS in output stream 0:0; previous: 8586744843, current: -3174722; changing to 8586744844. This may result in incorrect timestamps in the output file.

此时没有更多视频写入文件,但 ffmpeg 没有停止。如果我在 30 小时后手动停止它,则文件只有 26 小时 30 分钟长。

如何重现:

ffmpeg -progress recorder.progress -reconnect 1 -user_agent 'sdn/1.0' -i http://source/playlist.m3u8 -codec copy -bsf:a aac_adtstoasc record.mp4

ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libass --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-postproc --enable-small --enable-version3 --enable-libbluray --enable-demuxer=dash --enable-decoder=hevc --enable-libxml2 --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --extra-libs=-ldl --prefix=/opt/ffmpeg
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
4

1 回答 1

4

传输流使用 1/90000 的时基和 33 位时间戳

2^33/90000 秒 = 26 小时 30 分钟 43.718 秒

当那个 33 位数字用完时,它会溢出回零。

如果 ffmpeg 没有处理时间戳溢出,这是一个错误。报告给ffmpeg。

于 2020-05-29T20:30:58.837 回答