From 735a208796f634398d98f0286a92df248e3fee98 Mon Sep 17 00:00:00 2001 From: Sergio Costas Date: Sat, 21 Nov 2015 00:09:29 +0100 Subject: [PATCH] Removed support for mplayer as movie identifier --- HISTORY.md | 3 + setup.py | 2 +- src/devedeng/converter.py | 2 +- src/devedeng/mplayer.py | 124 +------------------------------------- 4 files changed, 6 insertions(+), 125 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f7e06b7..7899d6f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,8 @@ ## History of versions ## +* version 4.4.0 (2015-11-07) + * Removed MPlayer as an option for getting movie information + * version 4.3.2 (2015-11-07) * Added extra debug info in the log diff --git a/setup.py b/setup.py index c313a57..cafab3a 100755 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ except: setup( name='devedeng', - version='4.3.2', + version='4.4.0', description='A video DVD creator', long_description = "A program that allows to create video DVDs", diff --git a/src/devedeng/converter.py b/src/devedeng/converter.py index 426e7dc..6745463 100644 --- a/src/devedeng/converter.py +++ b/src/devedeng/converter.py @@ -252,4 +252,4 @@ class converter: if (self.config.mkiso == None) or (self.config.mkiso not in self.mkiso): return self.default_mkiso else: - return self.mkiso[self.config.mkiso] \ No newline at end of file + return self.mkiso[self.config.mkiso] diff --git a/src/devedeng/mplayer.py b/src/devedeng/mplayer.py index 5b31fbb..4c2c2ef 100644 --- a/src/devedeng/mplayer.py +++ b/src/devedeng/mplayer.py @@ -24,7 +24,7 @@ import os class mplayer(devedeng.executor.executor): - supports_analize = True + supports_analize = False supports_play = True supports_convert = False supports_menu = False @@ -59,125 +59,3 @@ class mplayer(devedeng.executor.executor): def process_stderr(self,data): return - - def get_film_data(self, file_name): - """ processes a file, refered by the FILE_MOVIE movie object, and fills its - main data (resolution, FPS, length...) """ - - self.original_file_size = os.path.getsize(file_name) - (video, audio, length) = self.analize_film_data(file_name, True) - - if (video != 0): - self.analize_film_data(file_name, False) - return False # no error - else: - return True # the file is not a video file; maybe an audio-only file, or another thing - - def analize_film_data(self,file_name,check_audio): - - if (check_audio): - frames = "0" - else: - frames = "5" - - command_line = ["mplayer","-loop","1","-identify", "-vo", "null", "-ao", "null", "-frames", frames , file_name] - - (stdout, stderr) = self.launch_process(command_line, False) - - stream_number = 0 - minimum_audio=-1 - self.audio_list=[] - self.audio_streams = 0 - minimum_video=-1 - self.video_list=[] - self.video_streams = 0 - self.original_width = 0 - self.original_height = 0 - self.original_length = 0 - self.original_videorate = 0 - self.original_audiorate = 0 - self.original_audiorate_uncompressed = 0 - self.original_fps = 0 - self.original_aspect_ratio = 0 - - try: - stdout2 = stdout.decode("utf-8") - except: - stdout2 = stdout.decode("latin1") - - for line in stdout2.split("\n"): - line=self.remove_ansi(line) - if line == "": - continue - position=line.find("ID_") - if position==-1: - continue - line=line[position:] - - pos2 = line.find("=") - if (pos2 != -1): - command = line[0:pos2] - parameter = line[pos2+1:] - else: - continue - - if command=="ID_VIDEO_BITRATE": - self.original_videorate=int(int(parameter)/1000) - self.config.append_static_log("ID_VIDEO_BITRATE: "+str(self.original_videorate)) - if command=="ID_VIDEO_WIDTH": - self.original_width=int(parameter) - self.config.append_static_log("ID_VIDEO_WIDTH: "+str(self.original_width)) - if command=="ID_VIDEO_HEIGHT": - self.original_height=int(parameter) - self.config.append_static_log("ID_VIDEO_HEIGHT: "+str(self.original_height)) - if command=="ID_VIDEO_ASPECT": - self.original_aspect_ratio=float(parameter) - self.config.append_static_log("ID_VIDEO_ASPECT: "+str(self.original_aspect_ratio)) - if command=="ID_VIDEO_FPS": - self.original_fps=float(parameter) - self.config.append_static_log("ID_VIDEO_FPS: "+str(self.original_fps)) - if command=="ID_AUDIO_BITRATE": - self.original_audiorate=int(int(parameter)/1000) - self.config.append_static_log("ID_AUDIO_BITRATE: "+str(self.original_audiorate)) - if command=="ID_AUDIO_RATE": - self.original_audiorate_uncompressed=int(parameter) - self.config.append_static_log("ID_AUDIO_RATE: "+str(self.original_audiorate_uncompressed)) - if command=="ID_LENGTH": - self.original_length=int(float(parameter)) - self.config.append_static_log("ID_LENGTH: "+str(self.original_length)) - - if command=="ID_VIDEO_ID": - self.video_streams+=1 - video_track=int(parameter) - if (minimum_video == -1) or (minimum_video>video_track): - minimum_video=video_track - self.video_list.append(stream_number) - self.config.append_static_log("ID_VIDEO_ID: "+str(stream_number)) - if command=="ID_AUDIO_ID": - self.audio_streams+=1 - audio_track=int(parameter) - if (minimum_audio == -1) or (minimum_audio>audio_track): - minimum_audio=audio_track - self.audio_list.append(stream_number) - self.config.append_static_log("ID_AUDIO_ID: "+str(stream_number)) - - # increment the stream_number counter in this case to also count - # subtitles and other stream types - if (command == "ID_VIDEO_ID") or (command == "ID_AUDIO_ID") or (command == "ID_SUBTITLE_ID"): - stream_number += 1 - - if (check_audio): - return (self.video_streams, self.audio_streams, self.original_length) - else: - self.original_size = str(self.original_width)+"x"+str(self.original_height) - if (self.original_aspect_ratio == None) or (self.original_aspect_ratio <= 1.0): - if (self.original_height != 0): - self.original_aspect_ratio = (float(self.original_width))/(float(self.original_height)) - - if (self.original_aspect_ratio != None): - self.original_aspect_ratio = (float(int(self.original_aspect_ratio*1000.0)))/1000.0 - - if (self.video_streams == 0): - return False - else: - return True