Added debugging extra data

This commit is contained in:
Sergio Costas 2015-09-08 17:13:16 +02:00
parent 6a40158e7b
commit 93e6c9992a
4 changed files with 157 additions and 28 deletions

View file

@ -60,6 +60,22 @@ class avprobe(devedeng.avbase.avbase):
""" 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)
command_line = ["avprobe",file_name,"-of","json","-show_streams", "-loglevel", "quiet"]
(stdout, stderr) = self.launch_process(command_line, False)
try:
stdout2 = stdout.decode("utf-8")
except:
stdout2 = stdout.decode("latin1")
self.config.append_log("AVProbe JSON data: "+str(stdout2))
return self.process_json(stdout2, file_name)
def process_json(self,stdout2,file_name):
self.audio_list=[]
self.audio_streams = 0
self.video_list=[]
@ -73,16 +89,6 @@ class avprobe(devedeng.avbase.avbase):
self.original_fps = 0
self.original_aspect_ratio = 0
self.original_file_size = os.path.getsize(file_name)
command_line = ["avprobe",file_name,"-of","json","-show_streams", "-loglevel", "quiet"]
(stdout, stderr) = self.launch_process(command_line, False)
try:
stdout2 = stdout.decode("utf-8")
except:
stdout2 = stdout.decode("latin1")
try:
video_data = json.loads(stdout2)
except:
@ -137,7 +143,7 @@ class avprobe(devedeng.avbase.avbase):
stdout2 = stdout.decode("utf-8") + "\n" + stderr.decode("utf-8")
except:
stdout2 = stdout.decode("latin1") + "\n" + stderr.decode("latin1")
self.config.append_log("Using avprobe human readable format: "+str(stdout2))
for line in stdout2.split("\n"):
line = line.strip()
if line.startswith("Duration: "):

View file

@ -46,6 +46,7 @@ class configuration(GObject.GObject):
for line in proc_file:
if (line.startswith("processor")):
self.cores += 1
proc_file.close()
is_local = None
self.log = ""

View file

@ -60,6 +60,22 @@ class ffprobe(devedeng.executor.executor):
""" 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)
command_line = ["ffprobe",file_name,"-of","json","-show_streams", "-loglevel", "quiet"]
(stdout, stderr) = self.launch_process(command_line, False)
try:
stdout2 = stdout.decode("utf-8")
except:
stdout2 = stdout.decode("latin1")
self.config.append_log("FFProbe JSON data: "+str(stdout2))
return self.process_json(file_name,stdout2)
def process_json(self,file_name,stdout2):
self.audio_list=[]
self.audio_streams = 0
self.video_list=[]
@ -73,16 +89,6 @@ class ffprobe(devedeng.executor.executor):
self.original_fps = 0
self.original_aspect_ratio = 0
self.original_file_size = os.path.getsize(file_name)
command_line = ["ffprobe",file_name,"-of","json","-show_streams", "-loglevel", "quiet"]
(stdout, stderr) = self.launch_process(command_line, False)
try:
stdout2 = stdout.decode("utf-8")
except:
stdout2 = stdout.decode("latin1")
try:
video_data = json.loads(stdout2)
except:
@ -137,7 +143,7 @@ class ffprobe(devedeng.executor.executor):
stdout2 = stdout.decode("utf-8") + "\n" + stderr.decode("utf-8")
except:
stdout2 = stdout.decode("latin1") + "\n" + stderr.decode("latin1")
self.config.append_log("Using ffprobe human readable format: "+str(stdout2))
for line in stdout2.split("\n"):
line = line.strip()
if line.startswith("Duration: "):