Reading framerate mode in pymediainfo

161 Views Asked by At

For a while now I have been traverse the world of pymediainfo and attempting to output the 'frame_rate_mode' of a video. Previously I managed to get a printout of either 'Constant' or 'Variable' so I know that I am referencing the correct section of the module, but my 'if' command don't seem to be interacting with it correctly.

My current command just prints nope if the file does not have a 'frame_rate_mode' of 'Constant' and if it does it prints 'yes'. (This is just for testing, eventually I want to pass this onto an ffmpeg command)

The file I am referencing is Constant framerate but I keep receiving a printout of 'nope'. Any help would be appreciated. Code below.

media_info = MediaInfo.parse('/Users/ra/Desktop/converts/mhl/50.mov')

for track in media_info.tracks:
    if track.other_frame_rate_mode == 'Constant':
        print ('yes')
        
else:

     print ('nope')
0

There are 0 best solutions below