draw graph of encoded bit rate of video vs play location

1k views Asked by At

I am trying to measure the variation in the bandwidth required when a video is played over the network. For this purpose, i need to make a graph of the bandwidth required to play the video continuously at any time during the video.

I tried processing the video with gstreamer but it gives me the bit rate of the decoded[not encoded] video which is more or less constant.

Is there a way to get the encoded bit rate of a video over time?

1

There are 1 answers

0
ConfusedAboutCPP On BEST ANSWER

Since i got no answers here, i will post the solution that i found for myself so that it may help others.

Vlc python bindings expose a python api to the vlc media player. They also provide a MediaStats class that can be used to determine video statistics.

class MediaStats(_Cstruct):
_fields_ = [
    ('read_bytes',          ctypes.c_int  ),
    ('input_bitrate',       ctypes.c_float),
    ('demux_read_bytes',    ctypes.c_int  ),
    ('demux_bitrate',       ctypes.c_float),
    ('demux_corrupted',     ctypes.c_int  ),
    ('demux_discontinuity', ctypes.c_int  ),
    ('decoded_video',       ctypes.c_int  ),
    ('decoded_audio',       ctypes.c_int  ),
    ('displayed_pictures',  ctypes.c_int  ),
    ('lost_pictures',       ctypes.c_int  ),
    ('played_abuffers',     ctypes.c_int  ),
    ('lost_abuffers',       ctypes.c_int  ),
    ('sent_packets',        ctypes.c_int  ),
    ('sent_bytes',          ctypes.c_int  ),
    ('send_bitrate',        ctypes.c_float),
]