Monibuca / plugin-hls

HLS协议的实现,提供HLS协议拉流,和HLS的写磁盘功能
MIT License
40 stars 40 forks source link

ll-hls implementation, video flash #5

Closed fastfading closed 2 years ago

fastfading commented 2 years ago

I am trying to implement ll hls recently base on this doc
502_introducing_lowlatency_hls.pdf

we met an issue . the clock in the video is flashing

https://user-images.githubusercontent.com/8351732/147813865-a9352d24-3186-4fec-947e-29a8628400c9.mov

to simplify this issue I made a little change base on origin code , so we can quick duplicate this issue. image

in this change, I cut the ts into more small segment. for example , IDR is each 6s, but I cut ts each 1s. push rtmp with obs. open hls link with safari, it will get above video result.

I am not sure why .

fastfading commented 2 years ago

we found this may related to obs tune image if we set tune to other option except zerolatency , it will get above result. if we set tune to zerolatency, there will be no flash back issue. but will get another issue like below. image

Does anyone know why ?

fastfading commented 2 years ago

we just find the master release also has this issue.
nothing has been changed . this should be a bug .

https://user-images.githubusercontent.com/8351732/148019790-2ea145b0-db75-491c-a177-5bffa022943d.mov

fastfading commented 2 years ago

image 应该和这段代码有关 这里 pts = dts 那么就要求编码的时候不能有B 帧 pts 和dts 最好能从源获得, 这里实现是不是有些问题

langhuihui commented 2 years ago

这段代码已经修改了,可以拉取最新代码看看

DavidYou commented 2 years ago

pts和dts问题已经修复。

还有2个问题

  1. 上面提到的B帧出现马赛克
  2. 最新版本TS和m3u8都在一个目录,但是m3u8里面ts会多出一级路径。 例如: stream url: rtmp://localhost:1935/live

m3u8

EXTINF:2.000,

live/1641534494.ts

EXTINF:2.000,

live/1641534496.ts

fastfading commented 2 years ago
  1. 上面提到的B帧出现马赛克
    说的是这个问题 if we set tune to zerolatency, there will be no flash back issue. but will get another issue like below. image
DavidYou commented 2 years ago

if we set tune to zerolatency, there will be no flash back issue. but will get another issue like below.

看来是sliced-threads=1导致的

DavidYou commented 2 years ago

看来是sliced-threads=1导致的

最新版本已经解决

JuanMorenoS commented 2 years ago

Hello @fastfading do you have this feature public?