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
Average bitrate #10867
Comments
+1. please add an average bitrate property. |
Please some help here (input.conf) F5 no-osd cycle-values osd-msg1 "" "${file-size}/${duration}" |
Unless an avg-bitrate property is added to mpv, you would need an external script to perform the simple math operation: |
The (keyframe based)
Video file average_bitrate calculation using filesize_Bytes/duration_s mpv script: avg-bitrate.js v0.1 by butterw |
It works good, thanks a lot !! 👌 |
The correct link (v0.11) is: https://github.com/butterw/bShaders/blob/master/mpv/settings/scripts/avg-bitrate.js Script calculation vs built-in property ? If the avg-bitrate was written to any existing unused String property (let's say: osd-msg2) when the video is loaded, you could use this property in input.conf removing the need to customize the script for a specific usage. F5 no-osd cycle-values osd-msg1 osd-msg2 "" While this hack works, it would be quite confusing when reading input.conf. |
I agree, this "average bitrate" of video should be part of the mpv core. I have a question about osd-msg: F1 no-osd cycle-values osd-msg1 "" "File: ${filename} \n Size: ${file-size} \n script-message avg-bitrate" This doesn't work. Is there a way to call your script from this line with osd-msg using input.conf? |
Instead of using osd-msg2 as suggested in my previous post, you can use a user-data property. I'm testing on Windows, with mpv 0.35.0-542-gcab54488 (Jul 16 2023). I think you need a fairly recent version of mpv for this feature. You just need to modify the script so that the the property "user-data/avg-bitrate" is set each time a new file is loaded. input.conf: EDIT: however this doesn't work exactly the way you want, because you need to cycle F1 for the OSD to update (this is also the case for the properties filename, file-size, etc). You don't have this problem with a permanent display |
Sadly I get "(error)". I use mpv 0.36 |
(error) means user-data/avg-bitrate has not been set. run mpv from terminal for testing. Could you maybe clarify what your end goal is: is it having a simplified stats display that you can toggle on/off ? |
Unrelated to the avg-bitrate property, the way you were trying to set your keybinding doesn't work (because the osd doesn't auto-update when a new file is loaded). IMO this is how you can do it: https://forum.doom9.org/showthread.php?p=1990436#post1990436 |
Maybe I did an incorrect modification, can you verified? (I added txt extension to upload here) |
v0.20: https://github.com/butterw/bShaders/blob/master/mpv/settings/scripts/avg-bitrate.js Basic use: To toggle a custom osd with a keybinding (the osd is permanently visible until disabled, it updates when a new file is loaded): |
It works!! 👏 Thanks a lot for your help 👌 |
Please add a feature to obtain the average bitrate of the videos like other players and applications do. For example with MPC-HC, Avidemux and Freemake Video Converter all the three give me exactly the same value of the video track bitrate, it never changes.
The text was updated successfully, but these errors were encountered: