How to change Kbps to Mbps

Any questions? Need some help?
Post Reply
AleX69
Posts: 1
Joined: 09 Apr 2017, 06:11

How to change Kbps to Mbps

Post by AleX69 » 09 Apr 2017, 06:20

hi,
i use string:

Code: Select all

{n} {s00e00} {t}.{y}.{source.lower()}.{af.lower()}.{ac.lower()}.{video[0].frameRate}fps.{media.overallBitRateString.replaceAll(/ /)}.{vc.lower()}.{vf}
Big Little Lies S01E01 Somebody's Dead.2017.hdtv.2ch.ac3.fps.2479Kbps.x264.720p

I want to convert kbps to mbps, how to do it?

User avatar
rednoah
The Source
Posts: 13530
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to change Kbps to Mbps

Post by rednoah » 09 Apr 2017, 07:46

Here's how you get the bitrate in megabit, with and without decimals, and 2-decimal precision:

Code: Select all

{bitrate / 1e6}

Code: Select all

{bitrate / 1e6 as int}

Code: Select all

{(bitrate / 1e6d).round(2)}

EDIT:

{mbps} binding has been added with r5007.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

yhm28
Posts: 15
Joined: 24 Jan 2018, 07:20

Re: How to change Kbps to Mbps

Post by yhm28 » 24 Jan 2018, 07:24

rednoah wrote:
09 Apr 2017, 07:46
Here's how you get the bitrate in megabit, with and without decimals, and 2-decimal precision:

Code: Select all

{bitrate / 1e6}

Code: Select all

{bitrate / 1e6 as int}

Code: Select all

{(bitrate / 1e6d).round(2)}

EDIT:

{mbps} binding has been added with r5007.
so the correct groovy format to force Mbps (not Mb/s) with a single decimal would be +media.overallBitRateString.replace('/', 'p').XXXXXXX ?

any way to add framerate?

User avatar
rednoah
The Source
Posts: 13530
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to change Kbps to Mbps

Post by rednoah » 24 Jan 2018, 09:10

1.
You can use {mbps} for the first one.


2.
There is no convenience binding for the frame rate, so you'll have to grab it from the video stream directly:

Code: Select all

{video[0].FrameRate}
@see viewtopic.php?f=5&t=4285
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

yhm28
Posts: 15
Joined: 24 Jan 2018, 07:20

Re: How to change Kbps to Mbps

Post by yhm28 » 24 Jan 2018, 09:24

rednoah wrote:
24 Jan 2018, 09:10
1.
You can use {mbps} for the first one.


2.
There is no convenience binding for the frame rate, so you'll have to grab it from the video stream directly:

Code: Select all

{video[0].FrameRate}
@see viewtopic.php?f=5&t=4285
I don't follow for the mbps. What is the exact code I would enter? Right now I am using

Code: Select all

+media.overallBitRateString.replace('/', 'p')

User avatar
rednoah
The Source
Posts: 13530
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to change Kbps to Mbps

Post by rednoah » 24 Jan 2018, 13:05

You can enter mbps. It's a top-level binding same as n or s00e00.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests