FFMPEG 警告 pkt->duration = 0

FFMPEG 警告 pkt->duration = 0

当我尝试捕获 HLS 流时,我在 FFMPEG 的日志中看到一条奇怪的警告消息。

这是为了避免与老板产生矛盾而更改的一些信息的日志:

[info] Input #0, hls, from 'https://cdn.youtube.com/w/application/stream_key/playlist.m3u8':
[info]   Duration: N/A, start: 421.372522, bitrate: N/A
[info]   Program 0
[info]     Metadata:
[info]       variant_bitrate : 3534714
[info]     Stream #0:0, 0, 1/90000: Data: timed_id3 (ID3  / 0x20334449), 0/1
[info]     Metadata:
[info]       variant_bitrate : 3534714

[info]     Stream #0:1, 21, 1/90000: Video: h264 (High), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p, 1280x720, 0/1, 60 tbr, 90k tbn, 180k tbc
[info]     Metadata:
[info]       variant_bitrate : 3534714
[info]     Stream #0:2, 33, 1/90000: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
[info]     Metadata:
[info]       variant_bitrate : 3534714
[debug] Successfully opened the file.
[debug] Parsing a group of options: output url application/stream_key/playlist.m3u8.
[debug] Applying option c (codec name) with argument copy.
[debug] Applying option f (force format) with argument hls.
[debug] Successfully parsed a group of options.
[debug] Opening an output file: application/stream_key/playlist.m3u8.

[debug] Successfully opened the file.

[mpegts @ 0x400b000] [verbose] service 1 using PCR in pid=256, pcr_period=0ms
[mpegts @ 0x400b000] [verbose] muxrate VBR, sdt every 1073741822000 ms, pat/pmt every 1073741822000 ms
[file @ 0x3fc0040] [debug] Setting default whitelist 'file,crypto,data'
[hls muxer @ 0x4049e40] [debug] Found playlist sequence number: 0
[AVIOContext @ 0x4107900] [verbose] Statistics: 132 bytes read, 0 seeks
[info] Output #0, hls, to 'application/stream_key/playlist.m3u8':
[info]   Metadata:
[info]     encoder         : Lavf58.65.100

[info]     Stream #0:0, 0, 1/90000: Video: h264 (High), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p, 1280x720 (0x0), 0/1, q=2-31, 60 tbr, 90k tbn, 90k tbc
[info]     Metadata:
[info]       variant_bitrate : 3534714
[info]     Stream #0:1, 0, 1/90000: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
[info]     Metadata:
[info]       variant_bitrate : 3534714
[info] Stream mapping:
[info]   Stream #0:1 -> #0:0 (copy)
[info]   Stream #0:2 -> #0:1 (copy)
[info] Press [q] to stop, [?] for help
[debug] cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[debug] cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[debug] cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[debug] cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[debug] cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[hls @ 0x4076e00]
[warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise

[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise
[hls @ 0x4076e00] [warning] pkt->duration = 0, maybe the hls segment duration will not precise

使用的FFMPEG命令:

ffmpeg -hide_banner -loglevel repeat+level+debug -y \
-xerror -i cdn.youtube.com/w/application/stream_key/playlist.m3u8 \
-c copy -f hls -hls_list_size 0 -hls_segment_filename \
application/stream_key/chunck_list_JMV%d.ts -hls_flags \
append_list application/stream_key/playlist.m3u8

FFMPEG 版本

ffmpeg -version 
ffmpeg version 4.2.4-1ubuntu0.1 
Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-10ubuntu2) 
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

我想知道这是什么pkt->持续时间 = 0意思是。是输出有问题还是输入有问题?

从现在起,谢谢。

  • 如果您需要更多信息,请写下来,我会尽力提供。

相关内容