请选择 进入手机版 | 继续访问电脑版

ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 692|回复: 3

[源码] FFmpeg 时间戳问题

[复制链接]
发表于 2020-5-26 17:51:44 | 显示全部楼层 |阅读模式
本帖最后由 learn_ffmpeg 于 2020-5-26 17:53 编辑

       最近的项目需要将不同的M3U8中的TS片动态的制作成一个M3U8列表,因为FFmpeg 目前只兼容连续递增的DTS时间戳,所以就改了HLS读取hls_read_packet()函数中的部分代码,对av_read_frame()读取出来的packet包从新打时间戳,

视频采用采用如下方式:
  1. DTS = DTS + av_rescale_q(1, fps, s->streams[pkt->stream_index]->time_base);
  2. PTS = DTS - (pkt->dts - pkt->pts);
复制代码
上述方式计算出来之后和原视频的时间戳是一致的;

音频采用如下方式:
  1. // 以AAC为例
  2. PTS += 1024 * s->streams[pkt->stream_index]->time_base.den / c->audio_sample_rate;
  3. DTS = PTS;
复制代码
但是音频的时间戳算出来反而和源时间戳不一致,计算出来的值有差距,大神帮忙看下这么计算是有什么问题吗?谢谢

下面是部分日志,befor 为av_read_frame()读取出来的pkt的时间戳,after 为转换之后的时间戳:
  1. [hls,applehttp @ 0x33a8980] befor pts = 21096522, dts = 21096522 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  2. [hls,applehttp @ 0x33a8980] after pts = 21096522, dts = 21096522 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  3. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  4.     Last message repeated 5 times
  5. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  6. [hls,applehttp @ 0x33a8980] befor pts = 21106800, dts = 21106800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  7. [hls,applehttp @ 0x33a8980] after pts = 21106800, dts = 21106800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  8. [h264 @ 0x33cc780] nal_unit_type: 9(AUD), nal_ref_idc: 0
  9. [h264 @ 0x33cc780] nal_unit_type: 6(SEI), nal_ref_idc: 0
  10. [h264 @ 0x33cc780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
  11. [h264 @ 0x33cc780] ct_type:0 pic_struct:0
  12. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  13. [hls,applehttp @ 0x33a8980] befor pts = 21121200, dts = 21110400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  14. [hls,applehttp @ 0x33a8980] after pts = 21121200, dts = 21110400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  15. [h264 @ 0x33cc780] nal_unit_type: 9(AUD), nal_ref_idc: 0
  16. [h264 @ 0x33cc780] nal_unit_type: 6(SEI), nal_ref_idc: 0
  17. [h264 @ 0x33cc780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3
  18. [h264 @ 0x33cc780] ct_type:0 pic_struct:0
  19. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  20. [hls,applehttp @ 0x33a8980] befor pts = 21114000, dts = 21114000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  21. [hls,applehttp @ 0x33a8980] after pts = 21114000, dts = 21114000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  22. [h264 @ 0x33cc780] nal_unit_type: 9(AUD), nal_ref_idc: 0
  23. [h264 @ 0x33cc780] nal_unit_type: 6(SEI), nal_ref_idc: 0
  24. [h264 @ 0x33cc780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
  25. [h264 @ 0x33cc780] ct_type:0 pic_struct:0
  26. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  27. [hls,applehttp @ 0x33a8980] befor pts = 21117600, dts = 21117600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  28. [hls,applehttp @ 0x33a8980] after pts = 21117600, dts = 21117600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  29. [h264 @ 0x33cc780] nal_unit_type: 9(AUD), nal_ref_idc: 0
  30. [h264 @ 0x33cc780] nal_unit_type: 6(SEI), nal_ref_idc: 0
  31. [h264 @ 0x33cc780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
  32. [h264 @ 0x33cc780] ct_type:0 pic_struct:0
  33. [hls,applehttp @ 0x33a8980] befor pts = 21111151, dts = 21111151 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  34. [hls,applehttp @ 0x33a8980] after pts = 21111145, dts = 21111145 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  35. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  36.     Last message repeated 5 times
  37. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  38. [hls,applehttp @ 0x33a8980] befor pts = 21132000, dts = 21121200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  39. [hls,applehttp @ 0x33a8980] after pts = 21132000, dts = 21121200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  40. [h264 @ 0x33cc780] nal_unit_type: 9(AUD), nal_ref_idc: 0
  41. [h264 @ 0x33cc780] nal_unit_type: 6(SEI), nal_ref_idc: 0
  42. [h264 @ 0x33cc780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3
  43. [h264 @ 0x33cc780] ct_type:0 pic_struct:0
  44. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  45. [hls,applehttp @ 0x33a8980] befor pts = 21124800, dts = 21124800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  46. [hls,applehttp @ 0x33a8980] after pts = 21124800, dts = 21124800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  47. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  48. [hls,applehttp @ 0x33a8980] befor pts = 21128400, dts = 21128400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  49. [hls,applehttp @ 0x33a8980] after pts = 21128400, dts = 21128400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  50. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  51. [hls,applehttp @ 0x33a8980] befor pts = 21142800, dts = 21132000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  52. [hls,applehttp @ 0x33a8980] after pts = 21142800, dts = 21132000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  53. [hls,applehttp @ 0x33a8980] befor pts = 21125780, dts = 21125780 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  54. [hls,applehttp @ 0x33a8980] after pts = 21125768, dts = 21125768 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  55. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  56.     Last message repeated 5 times
  57. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  58. [hls,applehttp @ 0x33a8980] befor pts = 21135600, dts = 21135600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  59. [hls,applehttp @ 0x33a8980] after pts = 21135600, dts = 21135600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  60. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  61. [hls,applehttp @ 0x33a8980] befor pts = 21139200, dts = 21139200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  62. [hls,applehttp @ 0x33a8980] after pts = 21139200, dts = 21139200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  63. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  64. [hls,applehttp @ 0x33a8980] befor pts = 21153600, dts = 21142800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  65. [hls,applehttp @ 0x33a8980] after pts = 21153600, dts = 21142800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  66. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  67. [hls,applehttp @ 0x33a8980] befor pts = 21146400, dts = 21146400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  68. [hls,applehttp @ 0x33a8980] after pts = 21146400, dts = 21146400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  69. [hls,applehttp @ 0x33a8980] befor pts = 21140408, dts = 21140408 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  70. [hls,applehttp @ 0x33a8980] after pts = 21140391, dts = 21140391 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  71. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  72.     Last message repeated 5 times
  73. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  74. [hls,applehttp @ 0x33a8980] befor pts = 21150000, dts = 21150000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  75. [hls,applehttp @ 0x33a8980] after pts = 21150000, dts = 21150000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  76. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  77. [hls,applehttp @ 0x33a8980] befor pts = 21164400, dts = 21153600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  78. [hls,applehttp @ 0x33a8980] after pts = 21164400, dts = 21153600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  79. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  80. [hls,applehttp @ 0x33a8980] befor pts = 21157200, dts = 21157200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  81. [hls,applehttp @ 0x33a8980] after pts = 21157200, dts = 21157200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  82. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  83. [hls,applehttp @ 0x33a8980] befor pts = 21160800, dts = 21160800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  84. [hls,applehttp @ 0x33a8980] after pts = 21160800, dts = 21160800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  85. [hls,applehttp @ 0x33a8980] befor pts = 21155037, dts = 21155037 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  86. [hls,applehttp @ 0x33a8980] after pts = 21155014, dts = 21155014 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  87. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  88.     Last message repeated 5 times
  89. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  90. [hls,applehttp @ 0x33a8980] befor pts = 21175200, dts = 21164400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  91. [hls,applehttp @ 0x33a8980] after pts = 21175200, dts = 21164400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  92. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  93. [hls,applehttp @ 0x33a8980] befor pts = 21168000, dts = 21168000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  94. [hls,applehttp @ 0x33a8980] after pts = 21168000, dts = 21168000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  95. [hls,applehttp @ 0x33a8980] All info found
  96. [hls,applehttp @ 0x33a8980] Setting avg frame rate based on r frame rate
  97. [hls,applehttp @ 0x33a8980] After avformat_find_stream_info() pos: 341 bytes read:341 seeks:0 frames:56
  98. Input #0, hls,applehttp, from '/home/nvod/channal/3.m3u8':
  99.   Duration: N/A, start: 234.405800, bitrate: N/A
  100.   Program 0
  101.     Metadata:
  102.       variant_bitrate : 0
  103.     Stream #0:0, 21, 1/90000: Video: h264 (High), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(left), 720x576 [SAR 16:15 DAR 4:3], 0/1, 25 fps, 25 tbr, 90k tbn, 50 tbc
  104.     Metadata:
  105.       variant_bitrate : 0
  106.     Stream #0:1, 35, 1/90000: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
  107.     Metadata:
  108.       variant_bitrate : 0
  109. Successfully opened the file.
  110. Parsing a group of options: output url udp://10.160.34.117:53001?pkt_size=1316&overrun_nonfatal=1&fifo_size=286720&ttl=64.
  111. Applying option c (codec name) with argument copy.
  112. Applying option f (force format) with argument mpegts.
  113. Successfully parsed a group of options.
  114. Opening an output file: udp://10.160.34.117:53001?pkt_size=1316&overrun_nonfatal=1&fifo_size=286720&ttl=64.
  115. [udp @ 0x33bb900] No default whitelist set
  116. Successfully opened the file.
  117. create zmq thread succsess
  118. create ovt bitrate control thread succsess
  119. ts->pids = (null)
  120. [mpegts @ 0x33bd440] muxrate VBR, pcr every 9000 pkts, sdt every 200, pat/pmt every 40 pkts
  121. Output #0, mpegts, to 'udp://10.160.34.117:53001?pkt_size=1316&overrun_nonfatal=1&fifo_size=286720&ttl=64':
  122.   Metadata:
  123.     encoder         : Lavf58.20.100
  124.     Stream #0:0, 0, 1/90000: Video: h264 (High), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(left), 720x576 (0x0) [SAR 16:15 DAR 4:3], 0/1, q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
  125.     Metadata:
  126.       variant_bitrate : 0
  127.     Stream #0:1, 0, 1/90000: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
  128.     Metadata:
  129.       variant_bitrate : 0
  130. Stream mapping:
  131.   Stream #0:0 -> #0:0 (copy)
  132.   Stream #0:1 -> #0:1 (copy)
  133. Press [q] to stop, [?] for help
  134. stream_index[0], set bitrate[0]
  135. stream_index[1], set bitrate[0]
  136. ots sb malloc success
  137. cur_dts is invalid (this is harmless if it occurs once at the start per stream)
  138.     Last message repeated 20 times
  139. program_num = 0
  140. first data size [0], last data size [0], first pts [0], last pts [0], first pts[0]
  141. calucate bitrate faild, ots_data_size = 0 ots_pts = 0, last_pts=46279
  142. first data size [0], last data size [0], first pts [0], last pts [0], first pts[0]
  143. calucate bitrate faild, ots_data_size = 0 ots_pts = 0, last_pts=41785
  144. frame=   14 fps=0.0 q=-1.0  bitrate_0=N/A bitrate_1=N/A size=      33kB time=00:00:00.51 bitrate= 520.6kbits/s speed=  -0x timestamps cc:     
  145. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  146. [hls,applehttp @ 0x33a8980] befor pts = 21171600, dts = 21171600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  147. [hls,applehttp @ 0x33a8980] after pts = 21171600, dts = 21171600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  148. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  149. [hls,applehttp @ 0x33a8980] befor pts = 21186000, dts = 21175200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  150. [hls,applehttp @ 0x33a8980] after pts = 21186000, dts = 21175200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 0
  151. [hls,applehttp @ 0x33a8980] befor pts = 21169665, dts = 21169665 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  152. [hls,applehttp @ 0x33a8980] after pts = 21169637, dts = 21169637 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  153. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  154.     Last message repeated 5 times
  155. [hls,applehttp @ 0x33a8980] befor pts = 21184294, dts = 21184294 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  156. [hls,applehttp @ 0x33a8980] after pts = 21184260, dts = 21184260 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player233.ts , avtype = 1
  157. [AVIOContext @ 0x33ae000] Statistics: 78208 bytes read, 0 seeks
  158. [hls,applehttp @ 0x33a8980] Opening '/home/nvod/channal/3.m3u8' for reading
  159. [hls,applehttp @ 0x33a8980] Media sequence change (21132 -> 21133) reflected in first_timestamp: 234400000 -> 235400000
  160. [AVIOContext @ 0x358cf80] Statistics: 341 bytes read, 0 seeks
  161. [hls,applehttp @ 0x33a8980] HLS request for url '/opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts', offset 0, playlist 0
  162. [hls,applehttp @ 0x33a8980] Opening '/opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts' for reading
  163. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  164. [hls,applehttp @ 0x33a8980] befor pts = 21178800, dts = 21178800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  165. [hls,applehttp @ 0x33a8980] after pts = 21178800, dts = 21178800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  166. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  167. [hls,applehttp @ 0x33a8980] befor pts = 21182400, dts = 21182400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  168. [hls,applehttp @ 0x33a8980] after pts = 21182400, dts = 21182400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  169. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  170. [hls,applehttp @ 0x33a8980] befor pts = 21189600, dts = 21186000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  171. [hls,applehttp @ 0x33a8980] after pts = 21189600, dts = 21186000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  172. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  173. [hls,applehttp @ 0x33a8980] befor pts = 21200400, dts = 21189600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  174. [hls,applehttp @ 0x33a8980] after pts = 21200400, dts = 21189600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  175. program_num = 0
  176. first data size [0], last data size [0], first pts [0], last pts [0], first pts[0]
  177.     Last message repeated 1 times
  178. frame=   27 fps=0.0 q=-1.0  bitrate_0= 767.2kbits/s bitrate_1= 128.9kbits/s size=      80kB time=00:00:01.03 bitrate= 632.6kbits/s speed=62.9x timestamps cc:     
  179. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  180. [hls,applehttp @ 0x33a8980] befor pts = 21193200, dts = 21193200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  181. [hls,applehttp @ 0x33a8980] after pts = 21193200, dts = 21193200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  182. [hls,applehttp @ 0x33a8980] befor pts = 21186384, dts = 21186384 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  183. [hls,applehttp @ 0x33a8980] after pts = 21186349, dts = 21186349 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  184. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  185.     Last message repeated 5 times
  186. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  187. [hls,applehttp @ 0x33a8980] befor pts = 21196800, dts = 21196800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  188. [hls,applehttp @ 0x33a8980] after pts = 21196800, dts = 21196800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  189. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  190. [hls,applehttp @ 0x33a8980] befor pts = 21211200, dts = 21200400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  191. [hls,applehttp @ 0x33a8980] after pts = 21211200, dts = 21200400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  192. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  193. [hls,applehttp @ 0x33a8980] befor pts = 21204000, dts = 21204000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  194. [hls,applehttp @ 0x33a8980] after pts = 21204000, dts = 21204000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  195. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  196. [hls,applehttp @ 0x33a8980] befor pts = 21207600, dts = 21207600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  197. [hls,applehttp @ 0x33a8980] after pts = 21207600, dts = 21207600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  198. [hls,applehttp @ 0x33a8980] befor pts = 21201010, dts = 21201010 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  199. [hls,applehttp @ 0x33a8980] after pts = 21200972, dts = 21200972 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  200. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  201.     Last message repeated 5 times
  202. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  203. [hls,applehttp @ 0x33a8980] befor pts = 21222000, dts = 21211200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  204. [hls,applehttp @ 0x33a8980] after pts = 21222000, dts = 21211200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  205. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  206. [hls,applehttp @ 0x33a8980] befor pts = 21214800, dts = 21214800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  207. [hls,applehttp @ 0x33a8980] after pts = 21214800, dts = 21214800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  208. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  209. [hls,applehttp @ 0x33a8980] befor pts = 21218400, dts = 21218400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  210. [hls,applehttp @ 0x33a8980] after pts = 21218400, dts = 21218400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  211. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  212. [hls,applehttp @ 0x33a8980] befor pts = 21232800, dts = 21222000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  213. [hls,applehttp @ 0x33a8980] after pts = 21232800, dts = 21222000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  214. [hls,applehttp @ 0x33a8980] befor pts = 21215641, dts = 21215641 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  215. [hls,applehttp @ 0x33a8980] after pts = 21215595, dts = 21215595 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  216. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  217.     Last message repeated 6 times
  218. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  219. [hls,applehttp @ 0x33a8980] befor pts = 21225600, dts = 21225600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  220. [hls,applehttp @ 0x33a8980] after pts = 21225600, dts = 21225600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  221. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  222. [hls,applehttp @ 0x33a8980] befor pts = 21229200, dts = 21229200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  223. [hls,applehttp @ 0x33a8980] after pts = 21229200, dts = 21229200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  224. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  225. [hls,applehttp @ 0x33a8980] befor pts = 21243600, dts = 21232800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  226. [hls,applehttp @ 0x33a8980] after pts = 21243600, dts = 21232800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  227. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  228. [hls,applehttp @ 0x33a8980] befor pts = 21236400, dts = 21236400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  229. [hls,applehttp @ 0x33a8980] after pts = 21236400, dts = 21236400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  230. program_num = 0
  231. first data size [0], last data size [0], first pts [0], last pts [0], first pts[0]
  232.     Last message repeated 1 times
  233. frame=   40 fps=0.0 q=-1.0  bitrate_0= 515.0kbits/s bitrate_1= 128.4kbits/s size=     128kB time=00:00:01.55 bitrate= 675.5kbits/s speed=2.01x timestamps cc:     
  234. [hls,applehttp @ 0x33a8980] befor pts = 21232357, dts = 21232357 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  235. [hls,applehttp @ 0x33a8980] after pts = 21232307, dts = 21232307 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  236. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  237.     Last message repeated 5 times
  238. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  239. [hls,applehttp @ 0x33a8980] befor pts = 21240000, dts = 21240000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  240. [hls,applehttp @ 0x33a8980] after pts = 21240000, dts = 21240000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  241. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  242. [hls,applehttp @ 0x33a8980] befor pts = 21254400, dts = 21243600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  243. [hls,applehttp @ 0x33a8980] after pts = 21254400, dts = 21243600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  244. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  245. [hls,applehttp @ 0x33a8980] befor pts = 21247200, dts = 21247200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  246. [hls,applehttp @ 0x33a8980] after pts = 21247200, dts = 21247200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  247. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  248. [hls,applehttp @ 0x33a8980] befor pts = 21250800, dts = 21250800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  249. [hls,applehttp @ 0x33a8980] after pts = 21250800, dts = 21250800 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  250. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  251. [hls,applehttp @ 0x33a8980] befor pts = 21265200, dts = 21254400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  252. [hls,applehttp @ 0x33a8980] after pts = 21265200, dts = 21254400 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  253. [hls,applehttp @ 0x33a8980] befor pts = 21246988, dts = 21246988 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  254. [hls,applehttp @ 0x33a8980] after pts = 21246930, dts = 21246930 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  255. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  256.     Last message repeated 5 times
  257. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  258. [hls,applehttp @ 0x33a8980] befor pts = 21258000, dts = 21258000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  259. [hls,applehttp @ 0x33a8980] after pts = 21258000, dts = 21258000 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  260. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  261. [hls,applehttp @ 0x33a8980] befor pts = 21261600, dts = 21261600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  262. [hls,applehttp @ 0x33a8980] after pts = 21261600, dts = 21261600 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  263. [NULL @ 0x33ca780] ct_type:0 pic_struct:0
  264. [hls,applehttp @ 0x33a8980] befor pts = 21276000, dts = 21265200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  265. [hls,applehttp @ 0x33a8980] after pts = 21276000, dts = 21265200 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 0
  266. [hls,applehttp @ 0x33a8980] befor pts = 21261616, dts = 21261616 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  267. [hls,applehttp @ 0x33a8980] after pts = 21261553, dts = 21261553 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  268. [hls,applehttp @ 0x33a8980] invalid pts = -9223372036854775808, dts = -9223372036854775808 , filename = /opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player234.ts , avtype = 1
  269.     Last message repeated 5 times
  270. [AVIOContext @ 0x358cf80] Statistics: 84976 bytes read, 0 seeks
  271. [hls,applehttp @ 0x33a8980] Opening '/home/nvod/channal/3.m3u8' for reading
  272. [hls,applehttp @ 0x33a8980] Media sequence change (21133 -> 21134) reflected in first_timestamp: 235400000 -> 236400000
  273. [AVIOContext @ 0x358cf80] Statistics: 341 bytes read, 0 seeks
  274. [hls,applehttp @ 0x33a8980] HLS request for url '/opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player235.ts', offset 0, playlist 0
  275. [hls,applehttp @ 0x33a8980] Opening '/opt/Film18/NVodUpload/电影/2020/5月/2020-5-11@12-28-32//player235.ts' for reading
复制代码
回复

使用道具 举报

 楼主| 发表于 2020-6-2 19:28:41 | 显示全部楼层
优化了下处理逻辑,通过ext-x-discontinuity 检测到有不连续的时间戳到来,然后只对这个时间戳衔接的部分自己计算时间戳,衔接好了之后再原有的时间戳基础上增加差值,达到时间戳连续的目的,目前测试没有问题,可以流畅的衔接!

但是上面为什么音频的时间戳计算有问题,还需要高人指点,谢谢
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-6-2 19:29:21 | 显示全部楼层
优化了下处理逻辑,通过ext-x-discontinuity 检测到有不连续的时间戳到来,然后只对这个时间戳衔接的部分自己计算时间戳,衔接好了之后再原有的时间戳基础上增加差值,达到时间戳连续的目的,目前测试没有问题,可以流畅的衔接!

但是上面为什么音频的时间戳计算有问题,还需要高人指点,谢谢
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-6-2 19:29:38 | 显示全部楼层
优化了下处理逻辑,通过ext-x-discontinuity 检测到有不连续的时间戳到来,然后只对这个时间戳衔接的部分自己计算时间戳,衔接好了之后再原有的时间戳基础上增加差值,达到时间戳连续的目的,目前测试没有问题,可以流畅的衔接!

但是上面为什么音频的时间戳计算有问题,还需要高人指点,谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2020-7-15 19:13 , Processed in 0.055600 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表