1

I have this command:

mediainfo --Inform="Video;%CodecID% %BitRate/String% %Height%p" ./filename.mp4

which displays:

avc1 882 kb/s 720p

but I would like it to display in MBps instead, with a max of one decimal place, like 1.1 MBps.

can I do this out of the box without using bash and numfmt? If I do need numfmt, how could I use that?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Sumomo
  • 603
  • 1
  • 5
  • 18
  • 1
    Currently there is no internal formatting possibility for bitrate, and there is also no possibility to display a byterate (MB/s is not a bitrate ;-) ), in MediaInfo. Planned, but currently not a priority. Jérôme, developer of MediaInfo. – Jérôme Martinez Jan 11 '20 at 12:51

1 Answers1

4

Remove /String to get bit rate in bps and append:

| awk '{$2=sprintf("%.1f Mbps",$2/1024/1024)}1'
Cyrus
  • 84,225
  • 14
  • 89
  • 153