本文整理汇总了Python中video.Video类的典型用法代码示例。如果您正苦于以下问题:Python Video类的具体用法?Python Video怎么用?Python Video使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Video类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: autoAd
def autoAd(self, dir):
# Find all files in the dir
files = listFiles(os.path.join(settings.MEDIA_DIR, dir))
# Now sort the files alphabetically
files.sort()
# Get rid of files that don't have a media extension
temp = []
for file in files:
found = False
for extension in settings.SERIES_AUTOFIND_EXTENSIONS:
if file.endswith("." + extension):
found = True
if found:
temp.append(file)
files = temp
# Now make video objects for remaining files
self.videos = []
for file in files:
newVideo = Video()
newVideo.path = os.path.join(dir, file)
newVideo.number = files.index(file)
self.ads.append(newVideo)
开发者ID:bombpersons,项目名称:MYOT,代码行数:25,代码来源:block.py
示例2: __init__
def __init__(self, details):
"""Creates a new instance of a TvShow. Should be provided with media
details in a given object, including some values specific to TV."""
Video.__init__(self, details)
self.seasons = details['seasons']
self.network_url = details['network_url']
self.rating = Video.get_rating(self, TvShow.VALID_RATINGS, details['rating'])
开发者ID:arizonatribe,项目名称:udacity-nanodegree-proj1,代码行数:7,代码来源:tv.py
示例3: reset
def reset(cls):
"""Reset to default state."""
Box.reset()
Note.reset()
Figure.reset()
Table.reset()
Video.reset()
开发者ID:nunb,项目名称:MaTiSSe,代码行数:7,代码来源:theme.py
示例4: __init__
def __init__(self, dirPath):
Video.__init__(self, dirPath) # Call parent contructor
self.curTrailerName = self._getTrailerFile() # Current Trailer FileName
self.imdbUrl = None # URL to IMDB Info
self.imdbInfo = None # IMDB information
self.imdbUpdate = None # Date we last searched IMDB
self.trailerUrl = None # New TrailerAddict URL
self._newInfoFound = False # Set True when New Info is Found
开发者ID:kochbeck,项目名称:videocleaner,代码行数:8,代码来源:movie.py
示例5: do_POST
def do_POST(self):
if not self.path.startswith("/video"):
self.send_error(404, "Page Not Found")
return
header = self.headers.getheader('content-type')
content_len = int(self.headers.getheader('content-length', 0))
post_body = self.rfile.read(content_len)
if header == "application/json":
dict = json.loads(post_body)
else:
self.send_error(400, "This server only accepts application/json POST data")
v = Video()
try:
v.fromJson(dict)
videoRepository.addVideo(v)
self.send_response(200)
self.send_header("Content-type", "application/json")
self.end_headers()
self.wfile.write('{"status": "OK", "description": "Video added"}')
except(KeyError):
self.send_error(400, "Missing ['name','duration','url'].")
开发者ID:bkuzmic,项目名称:mobilecloud-14-python,代码行数:25,代码来源:video_svc_server.py
示例6: __init__
def __init__(self, title, poster_img, dur, trailer, series_start, series_end,
number_of_seasons, number_of_episodes, plot_summary):
Video.__init__(self, title, poster_img, Tvseries.__name__, dur, trailer)
self.start_date = series_start
self.end_date = series_end
self.seasons = number_of_seasons
self.episodes = number_of_episodes
self.plot = plot_summary
开发者ID:cranticumar,项目名称:IPND,代码行数:8,代码来源:tv_series.py
示例7: _set_monitoring
def _set_monitoring(value):
global is_monitoring
if value == video.ON_STRING:
is_monitoring = True
else:
is_monitoring = False
if video.recording:
Video.generate_thumbnail(video.stop_recording(), hres=args.horizontal_resolution,
vres=args.vertical_resolution)
开发者ID:stevewoolley,项目名称:IoT,代码行数:9,代码来源:video-monitor.py
示例8: main
def main(args):
"""
Mainline of application
"""
config = config_from_args(args)
if config.single['id'] != '':
id = int(config.single['id'])
v = Video(config, id)
s = SubtitleV4(config, id)
filename = '%s.srt' % (os.path.basename(v.video_url()))
s.download(filename)
v.download()
elif config.search['query'] == default_config.search['query']:
print 'Please specify a query. Example: "--search-query=Queen Seon Deok"'
sys.exit(1)
else:
searcher = ChannelSearcher(config)
channels = searcher.search(config.search['query'], config.search['method'])
for channel in channels:
sys.stdout.write('Channel: %s\n' %(channel.name))
for episode in channel.episodes():
sys.stdout.write('Episode: %s\n' % (episode.episode_num))
media_id = episode.media_id
video = Video(config, media_id)
if not config.video['skip']:
video.download()
video_info = video.video_info()
filename = video.filename()
# remove the extension
filename = os.path.splitext(filename)[0]
if config.subtitles['check_parts']:
# videos that have multiple subtitle parts will need
# to have them downloaded separately and merged
parts = VideoParts(config, episode.full_url).parts()
first = True
start_index = 0
for part in parts:
start_time = int(part['part_info']['start_time'])
subtitle = Subtitle(config, part['media_resource_id'], start_index, start_time)
if first:
subtitle.download(filename)
first = False
else:
subtitle.merge(filename)
start_index = subtitle.end_index
else:
media_resource_id = video.media_resource(video_info)
subtitle = Subtitle(config, media_resource_id)
subtitle.download(filename)
开发者ID:hekar,项目名称:viki-scraper,代码行数:57,代码来源:main.py
示例9: walk
def walk(model, samples_z, out_dir, inv_transform=None):
print('Outputting walk video')
model.phase = 'test'
walk_video = Video(os.path.join(out_dir, 'walk.mp4'))
for z in random_walk(samples_z, 150, n_dir_steps=10, change_fraction=0.1):
x = model.decode(z)
if inv_transform is not None:
x = inv_transform(x)
walk_video.append(dp.misc.img_tile(x))
开发者ID:NobodyInAmerica,项目名称:autoencoding_beyond_pixels,代码行数:9,代码来源:output.py
示例10: __init__
def __init__(self, title, story_line, poster_image_url,
trailer_youtube_url, rating, duration, release_year):
# Call base class init with appropriate init variables
Video.__init__(self, title, story_line, poster_image_url, trailer_youtube_url)
self.rating = rating
self.duration = duration
self.release_year = release_year
开发者ID:drowland,项目名称:mtw,代码行数:9,代码来源:movie.py
示例11: goGetEm
def goGetEm():
minRemovalScore = 0.0001
timeOut = 10
cleanThresh = 5
binNumber = 100
distanceWeight = 0.5
sizeWeight = 0.0
timeWeight = 0.5
weights = (distanceWeight, timeWeight, sizeWeight)
writingToFiles = True
distDev = 200
timeDev = 0.34
sizeDev = 0.25
devs = (distDev, timeDev, sizeDev)
framesback = 2
variables = [minRemovalScore, timeOut, cleanThresh, binNumber, weights, writingToFiles, devs, framesback]
vid = Video(0, variables)
# vidFile = "outvid.avi"
# csvFile = "variable.csv"
# if writingToFiles:
# vid.openVidWrite(vidFile)
# vid.openCSVWrite(csvFile)
while (True):
vid.readFrame()
vid.findFaces()
vid.display()
# vid.writeToVideo()
# exit on escape key
key = cv2.waitKey(1)
if key == 27:
break
vid.endWindow()
开发者ID:danhan52,项目名称:facial-recognition,代码行数:32,代码来源:livetrackwithface.py
示例12: __init__
def __init__(self, movie_title, movie_storyline,
poster_image,
trailer_youtube,
duration,
ratings):
Video.__init__(self, movie_title, duration)
self.storyline = movie_storyline
self.poster_image_url = poster_image
self.trailer_youtube_url = trailer_youtube
assert(ratings in self.VALID_RATINGS)
self.ratings = ratings
开发者ID:vibhkat,项目名称:Project-Movie_Trailer_Website,代码行数:11,代码来源:media.py
示例13: auto
def auto(self, dir):
# Find all files in the dir
files = listFiles(os.path.join(settings.MEDIA_DIR, dir))
# Now sort the files alphabetically
files.sort()
# Check for pickle file
temp = files
for file in files:
# Check if this file is the pickle file.
if file == ".pickle":
# Load this file
self.pickle = pickle.load(open(os.path.join(settings.MEDIA_DIR, dir, ".pickle"), "rb"))
temp.remove(file)
files = temp
# Get rid of files that don't have a media extension
temp = []
for file in files:
found = False
for extension in self.extensions:
if file.endswith("." + extension):
found = True
if found:
temp.append(file)
files = temp
# Now make video objects for remaining files
self.videos = []
for file in files:
newVideo = Video()
newVideo.path = os.path.join(dir, file)
newVideo.number = files.index(file)
# While we are here, we can check if there are any subs for this video
if "subs" in listDirs(os.path.join(settings.MEDIA_DIR, dir)):
for sub in listFiles(os.path.join(settings.MEDIA_DIR, dir, "subs")):
# Check if any of these subs match the video
if sub.split(".")[0] == file.split(".")[0]:
# Cool, this file has some subtitles
newVideo.sub_path = os.path.join(settings.MEDIA_DIR, dir, "subs", sub)
self.videos.append(newVideo)
# Make this dir our new path
self.path = os.path.join(settings.MEDIA_DIR, dir)
# Make sure we note how many files there were.
self.pickle.num = len(self.videos)
开发者ID:bombpersons,项目名称:MYOT,代码行数:54,代码来源:series.py
示例14: scrapPage
def scrapPage(self, page):
videoDOMs = self.findVideoDOMs(self.requestPage(page))
for videoDOM in videoDOMs:
link = self.formatLinkDOM(self.findLinkDOM(videoDOM))
title = self.formatTitleDOM(self.findTitleDOM(videoDOM))
duration = self.formatDurationDOM(self.findDurationDOM(videoDOM))
views = self.formatViewsDOM(self.findViewsDOM(videoDOM))
rating = self.formatRatingDOM(self.findRatingDOM(videoDOM))
vid = Video(link, title, duration, views, rating)
vid.printVid()
self.vid_list.append(vid)
开发者ID:maaadrien,项目名称:scrapping,代码行数:12,代码来源:videoScraper.py
示例15: parse
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
开发者ID:dankram,项目名称:wiredrive,代码行数:13,代码来源:feed_consumer.py
示例16: __init__
def __init__(self, parent=None, max_buf_size=500):
super(VideoWidget, self).__init__(parent)
self.video = Video(max_buf_size=max_buf_size)
self.max_buf_size = max_buf_size
self.init_ui()
self.slider.sliderReleased.connect(self.on_slider_released)
self.installEventFilter(self)
开发者ID:hellock,项目名称:labeltool,代码行数:7,代码来源:labeltool_timeslot.py
示例17: run
def run(self, information):
# On a fini de telecharger la video
self.parent._status["current_video"] = None
assert self.transcode_queue
video = Video(url=information["url"], name=information["title"],
description=information.get("description",
"Pas de description"),
date=int(time.time()),
unique_id=self.unique_id,
pipeline_name=self.pipeline_name)
video.already_downloaded = True
video.already_transcoded = False
video.local_filename = information['filepath']
self.downloaded_files.add(video)
logging.info("YoutubePostProcessor: %s finished" % video.name)
self.transcode_queue.put(video)
return information
开发者ID:BenoitLBen,项目名称:PodcastCanalPlus,代码行数:17,代码来源:gmail_youtube_fetcher.py
示例18: get_parent_video
def get_parent_video(self):
from video import Video #need to keep this here to avoid circular import...
vids = Video.get_all(filter_str="WHERE id=%d" % self.vid)
if len(vids) != 1:
self.log.error("ERROR: invalid parent video")
return None
else:
return vids[0]
开发者ID:icyflame,项目名称:software,代码行数:8,代码来源:tag.py
示例19: main
def main():
gfx = Video()
inp = Input()
gui = GUI()
# Initialize
try:
gfx.initialize()
inp.initialize()
gui.initialize()
except InitializationError as error:
print(error)
return 1
# Setup the interface
gui.setupInterface()
# Main Loop
gfx.enterMainLoop()
# Done
# - We will never actually get here.
gfx.shutdown()
return 0
开发者ID:rongzhou,项目名称:speed-dreams,代码行数:26,代码来源:main.py
示例20: add_hash
def add_hash():
SqlClass.turn_off_commits()
videos = Video.get_all()
tags = [video.get_tags() for video in videos]
# We need to get all the frame info before
# we erase the video table!
for tag_ls in tags:
for tag in tag_ls:
tag._populate_frame_dict()
for video in videos:
if not video.present():
self.log.error("Not all videos are present, cannot upgrade database!")
return False
[video.remove() for video in videos]
Video.remove_table()
Video.table_setup()
for i, video in enumerate(videos):
video.video_hash = \
hash_video(self.get_absolute_path(video.video_path))
Video.add(video)
for tag in tags[i]:
self.log.info("Adding tag %s in video %s" %(tag, video.video_path))
Tag.tag_add(tag)
SqlClass.turn_on_commits()
self.conn.commit()
return True
开发者ID:athityakumar,项目名称:software,代码行数:29,代码来源:database.py
注:本文中的video.Video类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论