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

Live Media info details #528

Closed
cdguy opened this issue Aug 18, 2023 · 31 comments
Closed

Live Media info details #528

cdguy opened this issue Aug 18, 2023 · 31 comments

Comments

@cdguy
Copy link

cdguy commented Aug 18, 2023

Since you use some MPV player libraries in Ksplayer https://github.com/kingslay/FFmpegKit I would like to know if you could implement live media info into the swiftUI Demo App?

(I will share additional screenshots via e-mail.)

IMG_5080
IMG_5081

@kingslay
Copy link
Owner

这些信息目前通过MediaPlayerTrack 和KSMEPlayer.metadata 都是可以得到的。

@cdguy
Copy link
Author

cdguy commented Aug 27, 2023

There are 3 values I could not find:

1- live bitrate (not the average value. So when this info is displayed, the value will constantly change)

2- live FPS value (you would be able to understand if the stream is dropping frames)

3- file size

how to display those 3 info?

MPV can do it (I already sent you some screenahots), the VLC desktop app can display it, the open source Qmplay2 app (it uses ffmpeg lib) can reveal it

@kingslay

@cdguy
Copy link
Author

cdguy commented Aug 27, 2023

There are 3 values I could not find:

1- live bitrate (not the average value. So when this info is displayed, the value will constantly change)

2- live FPS value (you would be able to understand if the stream is dropping frames)

3- file size

how to display those 3 info?

MPV can do it (I already sent you some screenahots), the VLC desktop app can display it, the open source Qmplay2 app (it uses ffmpeg lib) can reveal it

@kingslay

Of course adding those values directly into the test app would be a great use for everyone! :)

@kingslay
Copy link
Owner

kingslay commented Sep 2, 2023

我增加了filesize这个属性了。
1- live bitrate (not the average value. So when this info is displayed, the value will constantly change)

2- live FPS value (you would be able to understand if the stream is dropping frames)
这两个属性是需要持续计算,会造成资源的浪费。如果是指想要知道有没有丢帧的话,那可以重载方法 open func videoClockSync(main: KSClock, nextVideoTime: TimeInterval) -> ClockProcessType
如果返回的是dropNext 那代表丢帧了。

@cdguy
Copy link
Author

cdguy commented Sep 3, 2023

我增加了filesize这个属性了。 1- live bitrate (not the average value. So when this info is displayed, the value will constantly change)

2- live FPS value (you would be able to understand if the stream is dropping frames) 这两个属性是需要持续计算,会造成资源的浪费。如果是指想要知道有没有丢帧的话,那可以重载方法 open func videoClockSync(main: KSClock, nextVideoTime: TimeInterval) -> ClockProcessType 如果返回的是dropNext 那代表丢帧了。

Yes for sure the live bitrate will consume a lot of resources, but the usage/display of the live bitrate would only be triggered if a user opens the player media details UI via the settings.

So the CPU usage would only increase if someone looks at this value via player settings -> media details
@kingslay

@djokt
Copy link

djokt commented Nov 5, 2023

@kingslay
I fully agree with the proposal to add this information.

Indeed, even if it's not a feature that will interest the general public, it will be very useful for us as beta testers. Being able to display this information will enable us to better understand and analyze the data as we develop the application.

It's a feature that will make our work easier and help us in our testing and fine-tuning.

I don't think it requires too much work on the development side to retrieve the corresponding data, so it seems a pertinent proposition to me.

@cdguy
Copy link
Author

cdguy commented Nov 5, 2023

@kingslay I fully agree with the proposal to add this information.

Indeed, even if it's not a feature that will interest the general public, it will be very useful for us as beta testers. Being able to display this information will enable us to better understand and analyze the data as we develop the application.

It's a feature that will make our work easier and help us in our testing and fine-tuning.

I don't think it requires too much work on the development side to retrieve the corresponding data, so it seems a pertinent proposition to me.

The actual code displays the file size, but what us missing in my opinion are:

1- add a progressive/interlaced tag under the file size info
It would be name like this; Stream Type :

2- live bitrate info:
« Geeks » who would like to watch the highest quality stream would be able to check the live bitrate for cheking the quality

as you mentioned before, this would increase CPU usage, a button below the live bitrate could be placed, and the button might be named / Live Stream Bitrate

thank you again @kingslay

@Hayastano
Copy link

I agree with my colleagues that this is a very important feature. They've already detailed everything very well, so I don't have anything to add, I support the request if it's possible, that would be great.
Thank you for your work.

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

kingslay commented Nov 5, 2023

好的,我看下要怎么样才能低成本的增加live bitrate

@cdguy
Copy link
Author

cdguy commented Nov 5, 2023

The ideal would be to display all those media details like MPV
IMG_7315
And the remaining media details would be displayed like your tracy player (list view)
And each dev would customise the UI according to their taste.

@cdguy
Copy link
Author

cdguy commented Nov 5, 2023

Here is an example:
LillyPlayer using MPV media info details within the app:

the media details are updated if there is any change
IMG_7318
IMG_7320

@cdguy
Copy link
Author

cdguy commented Nov 5, 2023

2b35e6bf-10fa-4d89-b5a1-7d404b107a21.mp4

Here is an example:

you see the video and audio bitrate constantly updating
Besides, the stream I opened is an interlaced stream, that’s why the container FPS is 25fps (50i=25p)

The “estimated FPS” value is 50 because the stream is 50i.

@JeremTM93
Copy link

JeremTM93 commented Nov 5, 2023

Here is an example:
LillyPlayer using MPV media info details within the app:

the media details are updated if there is any change
IMG_7318
IMG_7320

This is exactly what is needed !
With complete information on the video and its colors (primaries, colormatrix, levels, gamma) to easily determine possible playback and rendering problems.

1000006884.png

@cdguy
Copy link
Author

cdguy commented Nov 6, 2023

you can also check this website:

https://www.1em0n.com/blog/2020/2020-02-28.html

under "help说明"

@Kimentanm
Copy link
Contributor

不知道这篇文章是否能帮助低成本的增加live bitrate
https://blog.csdn.net/weixin_40840000/article/details/107989355
@kingslay

@kingslay
Copy link
Owner

kingslay commented Nov 6, 2023

我增加了videoBitrate。你们可以试下

@Kimentanm
Copy link
Contributor

我增加了videoBitrate。你们可以试下

是没有提交commit吗,没有看到新的变更呢

@kingslay
Copy link
Owner

kingslay commented Nov 6, 2023

可以看 6c24a94 这个commit

@cdguy
Copy link
Author

cdguy commented Nov 7, 2023

@kingslay is it possible that you update the live bitrate every second? at the moment Tracy Player displays the average value of the stream bitrate? thank you

@kingslay
Copy link
Owner

kingslay commented Nov 7, 2023

其实这个值是会一直变的。只是我的demo里面没有做定时更新。我只是做一个简单的示例。

@chillout23
Copy link

@kingslay It would be very useful to add a overlay which shows dropped frames, this is crucial when we test different media for stability. Is it possible to add this also?

@kingslay
Copy link
Owner

kingslay commented Nov 8, 2023

@kingslay It would be very useful to add a overlay which shows dropped frames, this is crucial when we test different media for stability. Is it possible to add this also?

@chillout23 可以的,其实目前的日志就会有记录是否有丢帧了。我可以加一个变量进行统计下。这个dropped frames 是要记录每秒的平均值,还是要记录从开始播放到现在为止的累积值呢?

@cdguy
Copy link
Author

cdguy commented Nov 8, 2023

可以的,其实目前的日志就会有记录是否有丢帧了。我可以加一个变量进行统计下。这个dropped frames 是要记录每秒的平均值,还是要记录从开始播放到现在为止的累积值呢?

The ideal would be to display both:

1- cumulative dropped frames count during the playback of the same stream
2- Instant dropped frames count during the playback of the same stream

@kingslay
Copy link
Owner

kingslay commented Nov 8, 2023

mpv是展示那个信息呢?是累积值还是每秒的平均值呢?

@cdguy
Copy link
Author

cdguy commented Nov 8, 2023

mpv是展示那个信息呢?是累积值还是每秒的平均值呢?

It displays the total count of dropped frames.

also in the image below, the "A/V Sync Diff" field displays if the video and sound is in sync.

This would be beneficial for the user and the dev in 2 ways:

1- the user would see in seconds is the audio is behind, and add an audio delay to fix the issue.
2- users would be able to report to the app developper that implemented Ksplayer, if the app has an audio/video sync issue.

For instance, as audiorenderer library still has an "audio out of sync", this can be a good starting point to identify if the audio and video "out of sync" value is constant or increases for longer playback

261261231-d0db2837-29bf-40e0-8951-ebea405d3dcc

@chillout23
Copy link

@kingslay it would be nice to have this information directly in TracyPlayer GUI. As this app is built for testing purposes it would make sense. In MPV the info is updated every 5 seconds I think, which I believe should be easier on CPU.

@Hayastano
Copy link

Talking to Skrew, the LillyPlayer developer, about the live media info detail so that he could integrate it into his app, he advised me to pass this on to you:

Ideally, you'll need to send data as you get it, some of which will be refreshed the same number of times as the video's FPS, while others will need to be refreshed manually by the app (lillyplayer), every second for example. For this, you can create a protocol with events, for example.

That's how MPV sends its data, and it's thanks to this "dynamic" format that you can see weird things like FPS going from 25 to 50 fps.

I hope this will help you or give you an idea of how to integrate more options or improve what you've already done.

I'm only a user and don't have the necessary code skills to help you or go into detail about this, so I'm sorry, but you've done a remarkable job since the beginning, and I wish you all the best.

@cdguy
Copy link
Author

cdguy commented Nov 10, 2023

since you last commits, can you please update tracy player testflight app? @JeremTM93 would love to try the live media details

Thank you

@kingslay
Copy link
Owner

live media details 是可以显示出来了。但是我还没在demo里面做每秒显示一次的功能。但是开发者可以先用了

kingslay added a commit that referenced this issue Nov 11, 2023
@cdguy
Copy link
Author

cdguy commented Nov 12, 2023

@kingslay can you please add the option to see if the content is SDR/HDR/HDR10+/DV
thank you

kingslay added a commit that referenced this issue Nov 13, 2023
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
* 'develop' of github.com:kingslay/KSPlayer:
  解决本地依赖问题
  解决字幕无法显示的问题
  fix kingslay#624
  fix kingslay#528
  add log
  fix  kingslay#618
  fix  kingslay#618
  fix build
  fix kingslay#627
  add sponsor
  fix build
  fix kingslay#528

# Conflicts:
#	Sources/KSPlayer/MEPlayer/FFmpegAssetTrack.swift
#	Sources/KSPlayer/MEPlayer/FFmpegDecode.swift
#	Sources/KSPlayer/MEPlayer/MEPlayerItem.swift
theonlymo pushed a commit to theonlymo/KSPlayer that referenced this issue Nov 16, 2023
* 'develop' of github.com:kingslay/KSPlayer: (22 commits)
  优化同步
  add AudioEngineDynamicsPlayer kingslay#584
  fix kingslay#619
  fix kingslay#634
  Update issue templates
  Update issue templates
  不使用deprecated api
  add  video type kingslay#528
  udpate swiftui demo
  update
  update
  fix
  fix
  fix
  解决依赖问题
  解决依赖问题
  解决spm的问题
  解决spm依赖的问题
  去除packeage.resolved
  更新ffmpeg
  ...

# Conflicts:
#	FFmpegKit
@cdguy
Copy link
Author

cdguy commented Dec 11, 2023

@kingslay since a few commits, “Audio Bitrate” and “Video Bitrate” fields display wrong values. Sometimes the audio bitrate value is displayed as “0” however the content has audio

thanks!

kingslay added a commit that referenced this issue Dec 12, 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

7 participants