Best way to get a average bit rate per stream?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to get a average bit rate per stream?

August Johansson
Hi,
I would like to store the average bit rate of every stream in my database.
I tested using ffprobe -print_format json -show_streams but this
information does not seem to be there. What would be the best way to return
this information?
Thanks
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Best way to get a average bit rate per stream?

Liam
On Tue, Sep 3, 2019 at 9:38 AM August Johansson <[hidden email]>
wrote:

> Hi,
> I would like to store the average bit rate of every stream in my database.
> I tested using ffprobe -print_format json -show_streams but this
> information does not seem to be there. What would be the best way to return
> this information?
> Thanks
> _______________________________________________


A bit off topic, but I would use mediainfo for this:

mediainfo --Inform="General;%OverallBitRate%" file.ext

That would get you the overall bitrate in bps, eg:  10236425

mediainfo --Inform="General;%OverallBitRate/String%" file.ext

That would get you the overall bitrate in a more Human readable form, eg:
10.2 Mb/s





> --
>

*William Caulfield *| *ContentBridge Systems*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Best way to get a average bit rate per stream?

August Johansson
Hi,
No i dont like this. It adds another dependency to my software. If this
really is the only way, i will try not to not use it
Thanks anyway

Den tis 3 sep. 2019 19:23William Caulfield <
[hidden email]> skrev:

> On Tue, Sep 3, 2019 at 9:38 AM August Johansson <[hidden email]>
> wrote:
>
> > Hi,
> > I would like to store the average bit rate of every stream in my
> database.
> > I tested using ffprobe -print_format json -show_streams but this
> > information does not seem to be there. What would be the best way to
> return
> > this information?
> > Thanks
> > _______________________________________________
>
>
> A bit off topic, but I would use mediainfo for this:
>
> mediainfo --Inform="General;%OverallBitRate%" file.ext
>
> That would get you the overall bitrate in bps, eg:  10236425
>
> mediainfo --Inform="General;%OverallBitRate/String%" file.ext
>
> That would get you the overall bitrate in a more Human readable form, eg:
> 10.2 Mb/s
>
>
>
>
>
> > --
> >
>
> *William Caulfield *| *ContentBridge Systems*
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Best way to get a average bit rate per stream?

August Johansson
Btw that gets overall bit rate all streams together. I need the average bit
rate for each stream.

Den tis 3 sep. 2019 19:26August Johansson <[hidden email]> skrev:

> Hi,
> No i dont like this. It adds another dependency to my software. If this
> really is the only way, i will try not to not use it
> Thanks anyway
>
> Den tis 3 sep. 2019 19:23William Caulfield <
> [hidden email]> skrev:
>
>> On Tue, Sep 3, 2019 at 9:38 AM August Johansson <[hidden email]
>> >
>> wrote:
>>
>> > Hi,
>> > I would like to store the average bit rate of every stream in my
>> database.
>> > I tested using ffprobe -print_format json -show_streams but this
>> > information does not seem to be there. What would be the best way to
>> return
>> > this information?
>> > Thanks
>> > _______________________________________________
>>
>>
>> A bit off topic, but I would use mediainfo for this:
>>
>> mediainfo --Inform="General;%OverallBitRate%" file.ext
>>
>> That would get you the overall bitrate in bps, eg:  10236425
>>
>> mediainfo --Inform="General;%OverallBitRate/String%" file.ext
>>
>> That would get you the overall bitrate in a more Human readable form, eg:
>> 10.2 Mb/s
>>
>>
>>
>>
>>
>> > --
>> >
>>
>> *William Caulfield *| *ContentBridge Systems*
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Best way to get a average bit rate per stream?

Peter van den Houten

On 03/09/2019 19:29, August Johansson wrote:

> Btw that gets overall bit rate all streams together. I need the average bit
> rate for each stream.
>
> Den tis 3 sep. 2019 19:26August Johansson <[hidden email]> skrev:
>
>> Hi,
>> No i dont like this. It adds another dependency to my software. If this
>> really is the only way, i will try not to not use it
>> Thanks anyway
>>
>> Den tis 3 sep. 2019 19:23William Caulfield <
>> [hidden email]> skrev:
>>
>>> On Tue, Sep 3, 2019 at 9:38 AM August Johansson <[hidden email]
>>>>
>>> wrote:
>>>
>>>> Hi,
>>>> I would like to store the average bit rate of every stream in my
>>> database.
>>>> I tested using ffprobe -print_format json -show_streams but this
>>>> information does not seem to be there. What would be the best way to
>>> return
>>>> this information?
>>>> Thanks
>>>> _______________________________________________
>>>
>>>
>>> A bit off topic, but I would use mediainfo for this:
>>>
>>> mediainfo --Inform="General;%OverallBitRate%" file.ext
>>>
>>> That would get you the overall bitrate in bps, eg:  10236425
>>>
>>> mediainfo --Inform="General;%OverallBitRate/String%" file.ext
>>>
>>> That would get you the overall bitrate in a more Human readable form, eg:
>>> 10.2 Mb/s
>>>
>>>

Try this and grep out the bits you need. It will accommodate files that
don't report their bit rates but there is an overhead as it does a short
scan of each file.

mediainfo --ParseSpeed=1 file.ext
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Best way to get a average bit rate per stream?

Carl Eugen Hoyos-2
In reply to this post by August Johansson
Am Di., 3. Sept. 2019 um 18:39 Uhr schrieb August Johansson
<[hidden email]>:

> I would like to store the average bit rate of every stream in my database.
> I tested using ffprobe -print_format json -show_streams but this
> information does not seem to be there. What would be the best way to return
> this information?

Something like the following prints the average bitrate for the first audio
stream (should be very accurate assuming timestamps are correct):
$ ffmpeg -i input -c copy -map 0:a:0 -f rawvideo -y /dev/null

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".