当前位置: 首页>>代码示例>>Python>>正文


Python video.Video类代码示例

本文整理汇总了Python中video.Video的典型用法代码示例。如果您正苦于以下问题:Python Video类的具体用法?Python Video怎么用?Python Video使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Video类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的video.Video类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。