Closed wertpoiu closed 4 years ago
This sounds like its related to the issue I have.
ok after speaking to @wertpoiu this is definitely the same issue as I was having.
Please @kingslay try and replicate this yourself. its dead simple
@IBAction func sliderChanged(_ sender: UISlider) {
print("Slider has been changed")
playerView.seek(time: Double(sender.value))
}
then seek through a media and you will sometimes see this issue. It is very intermittent for me.
If you want a video link (although any video will have the issue) then I can send you one via email?
This issue alone is stopping me from shipping your fabulous player with my iptv app.
This works fine on the simulator but not on an actual apple tv. it also doesn't work for me on an actual iPad.
Logging from iPad Pro
KSPlayer: KSMEPlayer.swift:263 play() | play KSPlayer.KSMEPlayer
KSPlayer: KSPlayerLayer.swift:100 state | playerStateDidChange - bufferFinished
KSPlayer: KSPlayerLayer.swift:267 changeLoadState(player:) | ["decodeVideoTime": 1.3811132500122767, "openTime": 1.159458458336303, "decodeAudioTime": 1.3716274999896996, "prepareTime": 0.00011070832260884345, "findTime": 1.3485552500060294, "readAudioTime": 1.371377500006929, "readVideoTime": 1.3712795416649897, "firstTime": 4.56799208332086]
2020-08-01 18:23:15.287168+0100 [21961:1054953] [CAMetalLayerDrawable texture] should not be called after already presenting this drawable. Get a nextDrawable instead.
2020-08-01 18:23:15.288268+0100 [21961:1055003] Each CAMetalLayerDrawable can only be presented once!
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
2020-08-01 18:23:20.356041+0100 [21961:1054999] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)
2020-08-01 18:23:20.356380+0100 [21961:1054999] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)
yes its a issue with playerView.seek
you must use touchUpInside not valueChanged
open func slider(value: Double, event: ControlEvents) {
if event == .valueChanged {
toolBar.currentTime = value
} else if event == .touchUpInside {
seek(time: value)
}
}
I’m not using the built in slider. I am using my own slider.
yes i know. But when was your method called? is on valueChanged?
I don't know what you are asking me. I have a UISlider which has an action of
@IBAction func sliderChanged(_ sender: UISlider) {
playerView.seek(time: Double(sender.value))
}
this is how I detect the slider has been dragged (slided? changed?) by the end user
Do you actual apple tv to test? @kingslay
no. i only have the simulator
The same issue arises on a real ipad or iphone. Please try and replicate it as its a major deal-breaker for using your player.
The same issue arises on a real ipad or iphone. Please try and replicate it as its a major deal-breaker for using your player.
I feel like this is a problem with your code. You should only seek when the user's finger leaves the progress bar. not just seek while dragging.
ok, I will change my code to only do seek when the user stops dragging. see if this helps.
this is issue is with KSMEPlayer and seek method while using avplayer as a first player i dont find this issue, If i use playerView.seek method manually then this issue arises as well.
Can i email you video?
It can be. Can you reproduce the problem in the demo now?
It can be. Can you reproduce the problem in the demo now?
it happens in real device only
can it happens in real iPhone device? i only have a real iPhone device
can it happens in real iPhone device? i only have a real iPhone device
No its not happening in iphone, but if you will implement playerView.seek method manually then it can happen
@kingslay I've sent you an email with a very basic demo showing the issue. this demo is for iPhone or iPad. Please run on a real device because on the simulator it works ok.
seek issue is so bad on tvos that if video starts and (i seek with my manual seek method) i start seeking right away, audio dont pause and after that i play other video there is 2,3 sounds coming out of tv of same video.
@kingslay I've sent you an email with a very basic demo showing the issue. this demo is for iPhone or iPad. Please run on a real device because on the simulator it works ok.
OK . i will try it
you must use touchUpInside not valueChanged
open func slider(value: Double, event: ControlEvents) { if event == .valueChanged { toolBar.currentTime = value } else if event == .touchUpInside { seek(time: value) } }
i tried this it didnt work
@snappycode1 @wertpoiu i have update the code 5b88b7fbe7c146047ee303dab374e60a11964ff8. please try again.
@snappycode1 @wertpoiu i have update the code 5b88b7f. please try again.
it seems fixed black video issue and 2 3 sounds were playing issue. But if seek forward and backward sometimes video stucks and keep loading and dont play. I have to press play, pause 2 3 times
@snappycode1 @wertpoiu i have update the code 5b88b7f. please try again.
I still have the seek issue. The frame is frozen and the following is logged
KSPlayer: KSPlayerLayer.swift:100 state | playerStateDidChange - bufferFinished
2020-08-04 17:20:33.187684+0100 Test Seek[33429:1526278] [CAMetalLayerDrawable texture] should not be called after already presenting this drawable. Get a nextDrawable instead.
2020-08-04 17:20:33.190915+0100 Test Seek[33429:1526311] Each CAMetalLayerDrawable can only be presented once!
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
IOSurfaceCompressionFootprint of 0 used
2020-08-04 17:20:38.193815+0100 Test Seek[33429:1526315] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)
2020-08-04 17:20:38.194161+0100 Test Seek[33429:1526315] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)
the last line of this log is repeated loads of times a second.
This is using the same demo I sent to you via email.
@snappycode1 @wertpoiu i have update the code 5b88b7f. please try again.
I still have the seek issue. The frame is frozen and the following is logged
KSPlayer: KSPlayerLayer.swift:100 state | playerStateDidChange - bufferFinished 2020-08-04 17:20:33.187684+0100 Test Seek[33429:1526278] [CAMetalLayerDrawable texture] should not be called after already presenting this drawable. Get a nextDrawable instead. 2020-08-04 17:20:33.190915+0100 Test Seek[33429:1526311] Each CAMetalLayerDrawable can only be presented once! IOSurfaceCompressionFootprint of 0 used IOSurfaceCompressionFootprint of 0 used IOSurfaceCompressionFootprint of 0 used IOSurfaceCompressionFootprint of 0 used 2020-08-04 17:20:38.193815+0100 Test Seek[33429:1526315] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2) 2020-08-04 17:20:38.194161+0100 Test Seek[33429:1526315] Execution of the command buffer was aborted due to an error during execution. Caused GPU Timeout Error (IOAF code 2)
the last line of this log is repeated loads of times a second.
This is using the same demo I sent to you via email.
do you had clean Build Folder?
You can see if you have access to this method.
clear(drawable: CAMetalDrawable, renderPassDescriptor: MTLRenderPassDescriptor)
Normal doesn't go into this method.
I cleaned the build folder, built the project again and same. As soon as I seek the video it freezes and displays the above logging. On a real ipad using the demo I sent.
I checked the source code for KSPlayer to make sure the changes you made are definitely there and they are so I'm using the latest public code.
I cleaned the build folder, built the project again and same. As soon as I seek the video it freezes and displays the above logging. On a real ipad using the demo I sent.
I checked the source code for KSPlayer to make sure the changes you made are definitely there and they are so I'm using the latest public code.
You can see if you have access to this method? clear(drawable: CAMetalDrawable, renderPassDescriptor: MTLRenderPassDescriptor)
Forgive my ignorance and not knowing, but how do I check for that function? thanks.
i had update the code b7f4a55b2c710822bf98ad42827b34527ff68d46 . please try again
i had update the code b7f4a55 . please try again
Sadly still the same on the real iPad. I really appreciate your work on this.
I am sorry Black video issue is still there and multiple audio's are playing for same video even the video is paused and multiple audios are playing
Its happening with manual seek only, and one more issue with internal seek i have to press play pause 2,3 times to play video after seeking.
My side of the viewing is very stuck and cannot be reproduced. So I download 131956.mkv to local and play it. Still can't reproduce. You can replace the url in my demo to play it, and then use my own seek to see if it can reproduce the problem.
if let url = URL(string: "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8") {
objects.append(KSPlayerResource(url: url, options: KSOptions(), name: "m3u8视频"))
}
Or you can download that video and play it locally. See if it works.
@snappycode1 What is the system version of your iOS device?
@snappycode1 What is the system version of your iOS device?
I have 2 iPads. one is on iOS 13 and the other on iOS 14 beta 4
Both devices have the same issue.
My side of the viewing is very stuck and cannot be reproduced. So I download 131956.mkv to local and play it. Still can't reproduce. You can replace the url in my demo to play it, and then use my own seek to see if it can reproduce the problem.
if let url = URL(string: "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8") { objects.append(KSPlayerResource(url: url, options: KSOptions(), name: "m3u8视频")) }
Using your internal seek, the issue is black screen and audio still playing.
It is intermittent though, so sometimes works ok and others not.
you can download 131956.mkv to local and play it. So that you can check if it's a network problem
you can download 131956.mkv to local and play it. So that you can check if it's a network problem
I downloaded 131956.mkv and loaded it locally. The manual seek seems to work ok.
After more extensive testing I found that playing the file locally is generally working, but sometimes the video will freeze (audio still plays) but it recovers after a few seconds.
@kingslay any more thoughts on how we can resolve this issue please?
@snappycode1 i update the code e0fc6272df369063587a8a4af3e5b10aa0a87c3d. please try again. thank you
@snappycode1 i update the code e0fc627. please try again. thank you
Thanks. I have tested a load of videos on ipad and apple tv and they are all so far, playing perfectly. I'll keep testing and report back if I have any issues with seek still.
It's been a few days since the last code update for this issue and so far I have not had 1 problem. so for me at least, this issue is resolved.
(tvOS Only) Start Seeking right after video starts lets say after 1 or 2 seconds video will go all black had to restart video. and wait few seconds to seek. Please fix @kingslay