sbraz/pymediainfo

No codec found

Closed this issue · 3 comments

It's possible I have not understood usage, however using the provided example:

from pymediainfo import MediaInfo

media_info = MediaInfo.parse("path\to\file.mp4")
for track in media_info.tracks:
    if track.track_type == 'Video':
        print(track.bit_rate, track.bit_rate_mode, track.codec)

My output is the below for every file I've tried:

24948480 None None

The bitrate seems to be correct, however bit_rate_mode and codec are both "None" which is not the case.

sbraz commented

That example might be a old, libmediainfo has renamed some fields since. Just print (track.to_data() to see all available fields). They will match what mediainfo file.mp4 shows.

I will update the example from the doc.

That example might be a old, libmediainfo has renamed some fields since. Just print (track.to_data() to see all available fields). They will match what mediainfo file.mp4 shows.

I will update the example from the doc.

Yup that works, thank you.

sbraz commented

You're welcome, see the updated documentation here for more examples.