How can we find bitrate of a video file in c++? Can we do this by file handling?
Thanks
How can we find bitrate of a video file in c++? Can we do this by file handling?
Thanks
Install FFMEPG it will give you all the information related to the video
e.g.
ffmpeg -i filename.flv
If you want to implement such yourself you need to be able to read the video container format (Quicktime, ASF, AVI, Matroska etc) and try to find the bitrate from the metadata.
You can use ffprobe from the ffmpeg project to get the information about your video files and get a nice JSON ouput.
Check this answer for an example.
Bitrate can be accessed from an AVFormatContext formed from an open video file. See this answer for an example of how to open the format context and access using c++.
You might also take a look at get_bit_rate(...)
from avcodec.c, which returns the correct bitrate, even when the codec_type for the format context is an audio file.