def _display_file_info(media_file): clip = current_sequence().create_file_producer_clip(media_file.path) width = clip.get("width") height = clip.get("height") size = str(width) + " x " + str(height) length = utils.get_tc_string(clip.get_length()) try: img = guiutils.get_gtk_image_from_file(media_file.icon_path, 300) except: print "_display_file_info() failed to get thumbnail" video_index = clip.get_int("video_index") audio_index = clip.get_int("audio_index") long_video_property = "meta.media." + str(video_index) + ".codec.long_name" long_audio_property = "meta.media." + str(audio_index) + ".codec.long_name" sample_rate_property = "meta.media." + str(audio_index) + ".codec.sample_rate" channels_property = "meta.media." + str(audio_index) + ".codec.channels" vcodec = clip.get(str(long_video_property)) acodec = clip.get(str(long_audio_property)) channels = str(clip.get_int(str(channels_property))) frequency = str(clip.get_int(str(sample_rate_property))) + "Hz" try: num = float(clip.get("meta.media.frame_rate_num")) # from producer_avformat.c den = float(clip.get("meta.media.frame_rate_den")) # from producer_avformat.c fps = str(num/den) except: fps ="N/A" dialogs.file_properties_dialog((media_file, img, size, length, vcodec, acodec, channels, frequency, fps))
def _display_file_info(media_file): # get info clip = current_sequence().create_file_producer_clip(media_file.path) info = utils.get_file_producer_info(clip) width = info["width"] height = info["height"] size = str(width) + " x " + str(height) length = utils.get_tc_string(info["length"]) try: img = guiutils.get_gtk_image_from_file(media_file.icon_path, 300) except: print "_display_file_info() failed to get thumbnail" vcodec = info["vcodec"] acodec = info["acodec"] channels = str(info["channels"]) frequency = str(info["frequency"]) + "Hz" try: num = info["fps_num"] den = info["fps_den"] fps = float(num/den) except: fps ="N/A" dialogs.file_properties_dialog((media_file, img, size, length, vcodec, acodec, channels, frequency, fps))
def _display_file_info(media_file): # get info clip = current_sequence().create_file_producer_clip(media_file.path) info = utils.get_file_producer_info(clip) width = info["width"] height = info["height"] size = str(width) + " x " + str(height) length = utils.get_tc_string(info["length"]) try: img = guiutils.get_gtk_image_from_file(media_file.icon_path, 300) except: print "_display_file_info() failed to get thumbnail" vcodec = info["vcodec"] acodec = info["acodec"] channels = str(info["channels"]) frequency = str(info["frequency"]) + "Hz" try: num = info["fps_num"] den = info["fps_den"] fps = float(num / den) except: fps = "N/A" dialogs.file_properties_dialog((media_file, img, size, length, vcodec, acodec, channels, frequency, fps))
def _display_file_info(media_file): # get info clip = current_sequence().create_file_producer_clip(media_file.path) info = utils.get_file_producer_info(clip) width = info["width"] height = info["height"] if media_file.type == appconsts.IMAGE: graphic_img = Image.open(media_file.path) width, height = graphic_img.size size = str(width) + " x " + str(height) length = utils.get_tc_string(info["length"]) try: img = guiutils.get_gtk_image_from_file(media_file.icon_path, 300) except: print "_display_file_info() failed to get thumbnail" vcodec = info["vcodec"] acodec = info["acodec"] if vcodec == None: vcodec = _("N/A") if acodec == None: acodec = _("N/A") channels = str(info["channels"]) frequency = str(info["frequency"]) + "Hz" if media_file.type == appconsts.VIDEO: match_profile_index = mltprofiles.get_closest_matching_profile_index( info) match_profile_name = mltprofiles.get_profile_name_for_index( match_profile_index) else: match_profile_name = _("N/A") if media_file.type == appconsts.VIDEO: if media_file.matches_project_profile(): matches_project_profile = _("Yes") else: matches_project_profile = _("No") else: matches_project_profile = _("N/A") try: num = info["fps_num"] den = info["fps_den"] fps = float(num / den) except: fps = _("N/A") dialogs.file_properties_dialog( (media_file, img, size, length, vcodec, acodec, channels, frequency, fps, match_profile_name, matches_project_profile))
def _display_file_info(media_file): # get info clip = current_sequence().create_file_producer_clip(media_file.path) info = utils.get_file_producer_info(clip) width = info["width"] height = info["height"] if media_file.type == appconsts.IMAGE: graphic_img = Image.open(media_file.path) width, height = graphic_img.size size = str(width) + " x " + str(height) length = utils.get_tc_string(info["length"]) try: img = guiutils.get_gtk_image_from_file(media_file.icon_path, 300) except: print "_display_file_info() failed to get thumbnail" vcodec = info["vcodec"] acodec = info["acodec"] if vcodec == None: vcodec = _("N/A") if acodec == None: acodec = _("N/A") channels = str(info["channels"]) frequency = str(info["frequency"]) + "Hz" if media_file.type == appconsts.VIDEO: match_profile_index = mltprofiles.get_closest_matching_profile_index(info) match_profile_name = mltprofiles.get_profile_name_for_index(match_profile_index) else: match_profile_name = _("N/A") if media_file.type == appconsts.VIDEO: if media_file.matches_project_profile(): matches_project_profile = _("Yes") else: matches_project_profile = _("No") else: matches_project_profile = _("N/A") try: num = info["fps_num"] den = info["fps_den"] fps = float(num/den) except: fps = _("N/A") dialogs.file_properties_dialog((media_file, img, size, length, vcodec, acodec, channels, frequency, fps, match_profile_name, matches_project_profile))