|
|
|
@ -174,6 +174,69 @@ class FileProperties():
|
|
|
|
|
return json.loads(ffprobeOutput)['streams']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def findCropParams(self):
|
|
|
|
|
"""Returns ffprobe stream data as array with elements according to the following example
|
|
|
|
|
{
|
|
|
|
|
"index": 4,
|
|
|
|
|
"codec_name": "hdmv_pgs_subtitle",
|
|
|
|
|
"codec_long_name": "HDMV Presentation Graphic Stream subtitles",
|
|
|
|
|
"codec_type": "subtitle",
|
|
|
|
|
"codec_tag_string": "[0][0][0][0]",
|
|
|
|
|
"codec_tag": "0x0000",
|
|
|
|
|
"r_frame_rate": "0/0",
|
|
|
|
|
"avg_frame_rate": "0/0",
|
|
|
|
|
"time_base": "1/1000",
|
|
|
|
|
"start_pts": 0,
|
|
|
|
|
"start_time": "0.000000",
|
|
|
|
|
"duration_ts": 1421035,
|
|
|
|
|
"duration": "1421.035000",
|
|
|
|
|
"disposition": {
|
|
|
|
|
"default": 1,
|
|
|
|
|
"dub": 0,
|
|
|
|
|
"original": 0,
|
|
|
|
|
"comment": 0,
|
|
|
|
|
"lyrics": 0,
|
|
|
|
|
"karaoke": 0,
|
|
|
|
|
"forced": 0,
|
|
|
|
|
"hearing_impaired": 0,
|
|
|
|
|
"visual_impaired": 0,
|
|
|
|
|
"clean_effects": 0,
|
|
|
|
|
"attached_pic": 0,
|
|
|
|
|
"timed_thumbnails": 0,
|
|
|
|
|
"non_diegetic": 0,
|
|
|
|
|
"captions": 0,
|
|
|
|
|
"descriptions": 0,
|
|
|
|
|
"metadata": 0,
|
|
|
|
|
"dependent": 0,
|
|
|
|
|
"still_image": 0
|
|
|
|
|
},
|
|
|
|
|
"tags": {
|
|
|
|
|
"language": "ger",
|
|
|
|
|
"title": "German Full"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
# ffmpeg -i <input.file> -vf cropdetect -f null -
|
|
|
|
|
ffprobeOutput, ffprobeError, returnCode = executeProcess(["ffmpeg" "-i",
|
|
|
|
|
self.__sourcePath,
|
|
|
|
|
"-vf", "cropdetect",
|
|
|
|
|
"-t", "180",
|
|
|
|
|
"-f", "null", "-"
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
errorLines = ffprobeError.split('\n')
|
|
|
|
|
|
|
|
|
|
for el in errorLines:
|
|
|
|
|
|
|
|
|
|
print(el)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# return json.loads(ffprobeOutput)['streams']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getMediaDescriptor(self):
|
|
|
|
|
return MediaDescriptor.fromFfprobe(self.context, self.getFormatData(), self.getStreamData())
|
|
|
|
|
|
|
|
|
|