本文整理汇总了Python中video.Video.get_bitrate方法的典型用法代码示例。如果您正苦于以下问题:Python Video.get_bitrate方法的具体用法?Python Video.get_bitrate怎么用?Python Video.get_bitrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类video.Video
的用法示例。
在下文中一共展示了Video.get_bitrate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse
# 需要导入模块: from video import Video [as 别名]
# 或者: from video.Video import get_bitrate [as 别名]
def parse(self):
"""
Consume the feed.
"""
feed = feedparser.parse(self.rss_url)
for entry in feed.entries:
entry['published_parsed'] = str(entry.get('published_parsed'))
entry['thumbnail'] = Image.get_smallest_image(entry.media_thumbnail)
if len(entry.media_content) > 0:
entry['duration'] = Video.get_duration(entry.media_content[0])
entry['video_codec'] = Video.get_codec(entry.media_content[0])
entry['bitrate'] = Video.get_bitrate(entry.media_content[0])
return feed.entries
示例2: test_bad_get_bitrate
# 需要导入模块: from video import Video [as 别名]
# 或者: from video.Video import get_bitrate [as 别名]
def test_bad_get_bitrate(self, m_gd):
m_gd.return_value = 235
video = self.video.copy()
video.pop('filesize')
bitrate = Video.get_bitrate(video)
self.assertIsNone(bitrate)
示例3: test_get_bitrate
# 需要导入模块: from video import Video [as 别名]
# 或者: from video.Video import get_bitrate [as 别名]
def test_get_bitrate(self, m_gd):
m_gd.return_value = 235
bitrate = Video.get_bitrate(self.video)
self.assertEqual(bitrate, 140368)