def _mkv_screen_size(filename):
 try:
  if filename.endswith(u'.mkv'):
   with io.open(filename, u'rb') as f:
    mkv = MKV(f)
   return (mkv.video_tracks[0].width, mkv.video_tracks[0].height)
 except Exception:
  pass
 return (None, None)

def _mkv_screen_size ( filename ) : try : if filename . endswith ( u'.mkv' ) : with io . open ( filename , u'rb' ) as f : mkv = MKV ( f ) return ( mkv . video_tracks [ 0 ] . width , mkv . video_tracks [ 0 ] . height ) except Exception : pass return ( None , None )
parses mkv file for width and height .