Video-Hub-App icon indicating copy to clipboard operation
Video-Hub-App copied to clipboard

Add kb/s for videos in details

Open whyboris opened this issue 5 years ago • 10 comments

Seems easy to add, may be useful to some 🤔

whyboris avatar Nov 27 '21 18:11 whyboris

Hello, could I be assigned to this issue? :)

jozefkopcak avatar Dec 09 '21 16:12 jozefkopcak

Hello Boris, I'm a bit lost in the project. I have inserted "bitrate" to ImageElement interface and have made function getBitrate in main-support.ts. I am struggling with what to do next, I can't find where exactly to use it now to make it show in video details. Could you help me? :)

jozefkopcak avatar Dec 13 '21 12:12 jozefkopcak

You're doing great! I'm glad you were able to get the bitrate from the FFprobe output 🎉

The last part should be rather straight-forward 🤞 Once the bitrate is part of the ImageElement - you just have to display it: https://github.com/whyboris/Video-Hub-App/blob/main/src/app/components/meta/meta.component.html#L37 Add a line there and it should show up for every details view 😎

whyboris avatar Dec 13 '21 16:12 whyboris

image

I think i got it, my formula for calculating bitrate was ((fileSize/1000)/duration). Do u want it like that? Or should i change it to ((fileSize/1024)/duration)? In the end, I rounded it up, so it looks better.

jozefkopcak avatar Dec 13 '21 16:12 jozefkopcak

Looks great 😍

Rounding up is a great idea. Calculation I'm unsure whether 1000 or 1024 is the right approach - I wonder if Windows does it correctly (when you right-click on video, go to details and see the bitrate). But don't sweat it too much, I could double-check later too 👌

I wonder if it's most-common nowadays to have bitrates of closer to 5,000 - so maybe mb/s rather than kb/s is better? 🤔

whyboris avatar Dec 13 '21 16:12 whyboris

image

(my windows is in my native language, dont get too scared :D ) So, windows shows in video details, that bitrate is 1205 kbps which converted to kb/s is 150.6, rounded up is 151 kb/s.

image

So that means, my calculations should be okay :D

If you want mb/s, it's not a problem. I know, when you have like 60GB Blurays, it can be a bit too many numbers :D

jozefkopcak avatar Dec 13 '21 16:12 jozefkopcak

image

This is what I got now :) Should I create pull request, so you can take a look? :)

jozefkopcak avatar Dec 13 '21 20:12 jozefkopcak

Looks beautiful! I bet I'll accept the PR with no requests for modification 😉 🤝 😁

whyboris avatar Dec 13 '21 20:12 whyboris

Thank you for the PR 🙇 #714 -- looking forward to merging soon 😁

whyboris avatar Dec 14 '21 00:12 whyboris

Thank you @jozefkopcak for adding this feature to Video Hub App 🎉 I appreciate it 😊

whyboris avatar Dec 14 '21 04:12 whyboris