From 626409074188539a918fe8af7386dd0e75e2f5e7 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 27 Jul 2015 07:22:39 -0500 Subject: [PATCH] Adjustment for xvid and avc1 To test --- resources/lib/API.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/lib/API.py b/resources/lib/API.py index 767acb00..e5bc7466 100644 --- a/resources/lib/API.py +++ b/resources/lib/API.py @@ -129,10 +129,18 @@ class API(): if "Video" in type: videotrack = {} videotrack['videocodec'] = mediaStream.get('Codec') + if "mpeg4" in videotrack['videocodec']: + profile = mediaStream.get('Profile', "") + if "Advanced" in profile: + videotrack['videocodec'] = "xvid" + elif "h264" in videotrack['videocodec']: + container = item['MediaSources'][0].get('Container', "") + if "mp4" in container: + videotrack['videocodec'] = "avc1" videotrack['height'] = mediaStream.get('Height') videotrack['width'] = mediaStream.get('Width') - videotrack['aspectratio'] = mediaStream.get('AspectRatio', "1:1") videotrack['Video3DFormat'] = item.get('Video3DFormat') + videotrack['aspectratio'] = mediaStream.get('AspectRatio', "1:1") if len(videotrack['aspectratio']) >= 3: try: aspectwidth, aspectheight = videotrack['aspectratio'].split(':')