Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some transcoded live streams are dropping frames. #602

Closed
cdguy opened this issue Nov 2, 2023 · 31 comments
Closed

Some transcoded live streams are dropping frames. #602

cdguy opened this issue Nov 2, 2023 · 31 comments

Comments

@cdguy
Copy link

cdguy commented Nov 2, 2023

I thing the reason of the dropped frames are due to a codec "not fully" supported by your player.

I will send you the video file link via e-mail.

Please try the media file named "vlc-record-2023-11-02-21h16m58s--meatD2dOlJOaH97-pQ8YV5v_OPMntBb9UJwm12IP1E-"

Also, just in case it, please try again the test interlaced video file to make sure that nothing gets broken :)

Thank you @kingslay !

@kingslay
Copy link
Owner

kingslay commented Nov 3, 2023

这个有点奇怪,我用你上次发给我的视频vlc-record-2023-10-30-08h47m42s-114869-.ts。代码也是用上次的60b5b6739283f19b8507f6b518e4bf992c78cd4a 。结果一开始播放就会丢帧了。之前测试是不会有这个的问题的。我回去用tvos试下。看下会不会有这个问题。

@kingslay
Copy link
Owner

kingslay commented Nov 3, 2023

@cdguy 你是在tvOS上进行测试的吗?还是其他设备

@cdguy
Copy link
Author

cdguy commented Nov 3, 2023

@cdguy 你是在tvOS上进行测试的吗?还是其他设备

I am testing on Tvos, on ios it looks fine

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

我在tvos上试了你发给我的视频。是不是丢帧的,只有在mac上才会丢帧,mac上的丢帧问题我解决了。

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

@kingslay I only have this issue on TVOS

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

你是播放你通过vlc录制的视频会有丢帧吗?你是通过log里面的video delay来判断是否有丢帧吗?

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

@kingslay for tvos:

It dosen't matter which buffer settings I use.
when I pause the video for 1 second, the next 5 seconds are very smooth and again the sliding text is not smooth again

Please check the same shares folder. but this time open the file "vlc-record-2023-11-04-13h00m20s--meatD2dOlJOaH97-pQ8YUs89PICQvn465s5mdb8GMI-"

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

I forgot to mention: the playback is always smooth on VLC TVOS

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

@kingslay for tvos:

It dosen't matter which buffer settings I use. when I pause the video for 1 second, the next 5 seconds are very smooth and again the sliding text is not smooth again

Please check the same shares folder. but this time open the file "vlc-record-2023-11-04-13h00m20s--meatD2dOlJOaH97-pQ8YUs89PICQvn465s5mdb8GMI-"

@kingslay the first half of the video I uploaded is corrupted. I uploaded a new one named "New One.ts" please test that one

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

@cdguy 你检查下你tvOS的视频设置。看下有没有开启isDisplayCriteriaMatchingEnabled和isDisplayModeSwitchInProgress。没有开启这个的话,在播放的时候确实会不流畅。开启之后。用我的demo来播放的话,应该就不会有问题了

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

@cdguy 你检查下你tvOS的视频设置。看下有没有开启isDisplayCriteriaMatchingEnabled和isDisplayModeSwitchInProgress。没有开启这个的话,在播放的时候确实会不流畅。开启之后。用我的demo来播放的话,应该就不会有问题了

I am a bit confused:

on tracy player, it doesn’t matter if Enable FormatDescription Display Criteria is on/off. Dynamic range is triggered.

where should I look in tracy player “ DisplayCriteriaMatchingEnabled” and “ DisplayModeSwitchInProgress” ?

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

https://support.apple.com/en-us/102277
Turn on Match Dynamic Range or Match Frame Rate on your Apple TV
Learn how to turn on frame rate and dynamic range matching.
Go to Settings > Video and Audio > Match Content, then choose from the following:
Match Dynamic Range: Turn on to have Apple TV 4K match its output to the original dynamic range of content that you’re watching.
Match Frame Rate: Turn on to have Apple TV 4K or Apple TV HD match its refresh rate to the original frame rate of content. This applies to content that's mastered at different frame rates — for example, 24fps film-based content or other international content.*
If you turn on either of these settings, Apple TV will attempt to automatically determine which dynamic ranges or frame rates your television supports. You might experience a blank screen or flickering as your television switches between formats.
*Apple TV matches the frame rate of content encoded at 60, 50, 30, 25, and 24fps. Frame rates match the refresh rate appropriate for your region, for example 29.97fps for NTSC. 25fps and 30fps content uses frame rate doubling to display at 50Hz and 60Hz when available, matching its original appearance while preserving a fluid user interface.

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

https://support.apple.com/en-us/102277 Turn on Match Dynamic Range or Match Frame Rate on your Apple TV Learn how to turn on frame rate and dynamic range matching. Go to Settings > Video and Audio > Match Content, then choose from the following: Match Dynamic Range: Turn on to have Apple TV 4K match its output to the original dynamic range of content that you’re watching. Match Frame Rate: Turn on to have Apple TV 4K or Apple TV HD match its refresh rate to the original frame rate of content. This applies to content that's mastered at different frame rates — for example, 24fps film-based content or other international content.* If you turn on either of these settings, Apple TV will attempt to automatically determine which dynamic ranges or frame rates your television supports. You might experience a blank screen or flickering as your television switches between formats. *Apple TV matches the frame rate of content encoded at 60, 50, 30, 25, and 24fps. Frame rates match the refresh rate appropriate for your region, for example 29.97fps for NTSC. 25fps and 30fps content uses frame rate doubling to display at 50Hz and 60Hz when available, matching its original appearance while preserving a fluid user interface.

I know this @kingslay and both settings are set to ON (all the time)

what is weird, is that when I switch “ Match Dynamic Range” AND “Match Frame Rate” to OFF, the sliding text is fluid all the time. When I set to ON, any one of them, or both of them, the sliding text is not fluid

I both tried with all those settings, and here are the results

  • output image: 4K SDR or 4K HDR

Match Dynamic Range” AND “Match Frame Rate” = ON -> not smooth

  • output image: 4K HDR or 4K SDR

Match Dynamic Range = ON ; Match Frame Rate = OFF -> not smooth

  • output image: 4K HDR or 4K SDR

Match Dynamic Range = OFF ; Match Frame Rate = ON -> not smooth

  • output image: 4K HDR or 4K SDR

Match Dynamic Range = OFF ; Match Frame Rate = OFF -> smooth

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

KSOptions.displayCriteriaFormatDescriptionEnabled 这个值 你是不是为false呢?不能为true。并且目前iOS 17的AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription) 这个初始化方法是不能用的。用的话,就会造成卡顿

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

Enable FormatDescription DisplayCriteria = off

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

What I try to understand is:

the stream record I sent earlier is an SDR stream. my appletv settings are:

AppleTV output image: 4K SDR
Match Dynamic Range” + “Match Frame Rate” = ON

No dynamic range is triggered (normal behaviour)

but the sliding text is not smooth

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

你是用我的demo?你的代码会走到这里吗?

displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: formatDescription.dynamicRange.rawValue)
正常来说是要走到这一行的

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

I always use your tracy demo app, so I did not touch any code, nor I customised it

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

那代码会走到这一行吗?
displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: formatDescription.dynamicRange.rawValue)

@cdguy
Copy link
Author

cdguy commented Nov 4, 2023

那代码会走到这一行吗? displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: formatDescription.dynamicRange.rawValue)

@Alanko5 mayI kindly ask you to look at this issue too? Maybe you know how to put in better words, and also try the last recommendation of Kingslay?

here is the test file:

https://collect.wetransfer.com/board/s25ysa8lwrq9liumm20231104133059/latest?token=f9da52d3-deac-49ff-84e7-644b5615c72f

@kingslay
Copy link
Owner

kingslay commented Nov 4, 2023

@cdguy 你对这一行代码加一下断点 。看下是否可以在这边停下来
image

@cdguy
Copy link
Author

cdguy commented Nov 5, 2023

@kingslay please correct me if I am wrong, but DisplayLayer (Use DisplayLayer in tracy player) is used for PIP feature right?

DisplayLayer is an instance property of AVPictureInPictureController.ContentSource

I remember you telling me that PIP can't be used on TVos.

If what I say is correct, in my opinion, you should update your code by disabling the "Use DisplayLayer" for the TVos version.

I hope that helps! @kingslay

@kingslay
Copy link
Owner

kingslay commented Nov 5, 2023

嗯,你的描述是对的。这个是一个好主意。我改下isUseDisplayLayer的默认配置

@cdguy
Copy link
Author

cdguy commented Nov 5, 2023

thank you @kingslay I am closing the thread!
can you also please update the tracy player beta just in case?

@cdguy cdguy closed this as completed Nov 5, 2023
@kingslay
Copy link
Owner

kingslay commented Nov 5, 2023

我正在看你说的另外一个音频的问题。晚上我在一起更新下

kingslay added a commit that referenced this issue Nov 5, 2023
@JeremTM93
Copy link

嗯,你的描述是对的。这个是一个好主意。我改下isUseDisplayLayer的默认配置

I don't know if this thread is appropriate, but if the "Use DisplayLayer" option is disabled we lose HDR10+, only HDR10 is recognized.

@cdguy
Copy link
Author

cdguy commented Nov 8, 2023

嗯,你的描述是对的。这个是一个好主意。我改下isUseDisplayLayer的默认配置

I don't know if this thread is appropriate, but if the "Use DisplayLayer" option is disabled we lose HDR10+, only HDR10 is recognized.

@kingslay If what @JeremTM93 is true let me know if you need hdr10+ content

@kingslay
Copy link
Owner

kingslay commented Nov 8, 2023

嗯,你的描述是对的。这个是一个好主意。我改下isUseDisplayLayer的默认配置

I don't know if this thread is appropriate, but if the "Use DisplayLayer" option is disabled we lose HDR10+, only HDR10 is recognized.

还是会有开关支持用户打开Use DisplayLayer。 @JeremTM93 你可以是否可以发给我 hdr10+ content的url。我试下用metal是否可以播放 hdr10+ content。 不如最终不行的话,那我就在改下isUseDisplayLayer的默认值

@kingslay
Copy link
Owner

kingslay commented Nov 8, 2023

不用了,我在电脑找到一个测试文件了 hdr10+test_lake_2021_02_01 这个确实会有导致屏幕太亮。我看下能不能改下

kingslay added a commit that referenced this issue Nov 8, 2023
@JeremTM93
Copy link

嗯,你的描述是对的。这个是一个好主意。我改下isUseDisplayLayer的默认配置

I don't know if this thread is appropriate, but if the "Use DisplayLayer" option is disabled we lose HDR10+, only HDR10 is recognized.

还是会有开关支持用户打开Use DisplayLayer。 @JeremTM93 你可以是否可以发给我 hdr10+ content的url。我试下用metal是否可以播放 hdr10+ content。 不如最终不行的话,那我就在改下isUseDisplayLayer的默认值

I've passed the information on to @cdguy who will do what's necessary, thanks to him.
Please also remember to update TracyPlayer regularly, mentioning the commit(s) affected by the update, it will be much easier to follow up 🙏

theonlymo pushed a commit to theonlymo/KSPlayer that referenced this issue Nov 16, 2023
* 'develop' of github.com:kingslay/KSPlayer:
  add videoBitrate and audioBitrate
  add Stream Type kingslay#528
  解决AirPods 的问题
  fix kingslay#609
  fix kingslay#602
  AudioUnitPlayer add mute
  add AudioUnitPlayer kingslay#607
theonlymo pushed a commit to theonlymo/KSPlayer that referenced this issue Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants