Fetch movie FPS from MPlayer output or return given default.
165130
def detectFps(self, movieFile = None, default = 23.976):
        """"""

        if movieFile is None:
            movieFile = self._searchForMovieFile()
        return File.detectFpsFromMovie(movieFile, default)
957138
def image_display(element, max_frames, fmt):
    
    if fmt not in Store.display_formats:
        return None
    info = process_object(element)
    if info:
        display(HTML(info))
        return

    backend = Store.current_backend
    if type(element) not in Store.registry[backend]:
        return None
    renderer = Store.renderers[backend]
    plot = renderer.get_plot(element)

    # Current renderer does not support the image format
    if fmt not in renderer.params('fig').objects:
        return None

    data, info = renderer(plot, fmt=fmt)
    return {info['mime_type']: data}, {}
81903
function () {

			var images = {};
			var blobs = {};

			if ( 'Video' in fbxTree.Objects ) {

				var videoNodes = fbxTree.Objects.Video;

				for ( var nodeID in videoNodes ) {

					var videoNode = videoNodes[ nodeID ];

					var id = parseInt( nodeID );

					images[ id ] = videoNode.RelativeFilename || videoNode.Filename;

					// raw image data is in videoNode.Content
					if ( 'Content' in videoNode ) {

						var arrayBufferContent = ( videoNode.Content instanceof ArrayBuffer ) && ( videoNode.Content.byteLength > 0 );
						var base64Content = ( typeof videoNode.Content === 'string' ) && ( videoNode.Content !== '' );

						if ( arrayBufferContent || base64Content ) {

							var image = this.parseImage( videoNodes[ nodeID ] );

							blobs[ videoNode.RelativeFilename || videoNode.Filename ] = image;

						}

					}

				}

			}

			for ( var id in images ) {

				var filename = images[ id ];

				if ( blobs[ filename ] !== undefined ) images[ id ] = blobs[ filename ];
				else images[ id ] = images[ id ].split( '\\' ).pop();

			}

			return images;

		}
724084
public function getFrameRate()
    {
        if ($this->frameRate === null) {
            $match = [];
            preg_match(self::$REGEX_FRAME_RATE, $this->output, $match);
            $this->frameRate = (float)(array_key_exists(1, $match) ? $match[1] : 0.0);
        }

        return $this->frameRate;
    }
306334
def getVideoStreamTextureSize(self, nDeviceIndex, eFrameType):
        """"""

        fn = self.function_table.getVideoStreamTextureSize
        pTextureBounds = VRTextureBounds_t()
        pnWidth = c_uint32()
        pnHeight = c_uint32()
        result = fn(nDeviceIndex, eFrameType, byref(pTextureBounds), byref(pnWidth), byref(pnHeight))
        return result, pTextureBounds, pnWidth.value, pnHeight.value
1220295
def fps(self,value):
		
		if not value is None:
			if not type(value) == float:
				raise ValueError("fps needs to be specified as a float")
			if value<1.0:
				raise ValueError("fps needs to be greater than 1.0")
		self.__fps = value
1138757
def get_video_start_time(video_file):
    """"""
    if not os.path.isfile(video_file):
        print("Error, video file {} does not exist".format(video_file))
        return None
    video_end_time = get_video_end_time(video_file)
    duration = get_video_duration(video_file)
    if video_end_time == None or duration == None:
        return None
    else:
        video_start_time = (
            video_end_time - datetime.timedelta(seconds=duration))
        return video_start_time
808803
def debug_video_writer_factory(output_dir):
  """"""
  if FLAGS.disable_ffmpeg:
    return common_video.IndividualFrameWriter(output_dir)
  else:
    output_path = os.path.join(output_dir, "video.avi")
    return common_video.WholeVideoWriter(
        fps=10, output_path=output_path, file_format="avi"
    )
1255864
def quality_comparator(video_data):
        """"""
        def parse_resolution(res: str) -> Tuple[int, ...]:
            return tuple(map(int, res.split('x')))

        raw_resolution = video_data['resolution']
        resolution = parse_resolution(raw_resolution)
        return resolution
404728
def get_vtt_files(inputfile):
    """"""
    vtts = []

    for f in inputfile:
        filename = f.split('.')
        filename = '.'.join(filename[0:-1])
        vtt = glob(filename + '*.vtt')
        if len(vtt) > 0:
            vtts.append({'vtt': vtt[0], 'video': f})

    if len(vtts) == 0:
        print("[!] No vtt files were found.")
        return False

    return vtts
562794
def get_frame(self, index=None, onset=None):
        ''' 
        '''
        if onset:
            index = int(onset * self.fps)

        return super(VideoStim, self).get_frame(index)
14396
def read_data(self, timeout=10.0):
        """"""
        # Read from stdout in a separate thread and consume data from
        # the queue.
        start_time = time.time()
        while True:
            # Wait for data to be available or a timeout.
            data = None
            try:
                data = self.stdout_reader.queue.get(timeout=timeout)
                if data:
                    yield data
                else:
                    # End of file.
                    break
            except queue.Empty:
                # Queue read timed out.
                end_time = time.time()
                if not data:
                    if end_time - start_time >= timeout:
                        # Nothing interesting has happened for a while --
                        # FFmpeg is probably hanging.
                        raise ReadTimeoutError('ffmpeg output: {}'.format(
                            ''.join(self.stderr_reader.queue.queue)
                        ))
                    else:
                        start_time = end_time
                        # Keep waiting.
                        continue
636177
def _get_movie_raw_metadata():
    

    path = _get_movielens_path()

    if not os.path.isfile(path):
        _download_movielens(path)

    with zipfile.ZipFile(path) as datafile:
        return datafile.read('ml-100k/u.item').decode(errors='ignore').split('\n')
873438
def getMovie():
        
        if not XLoaderWidget.MOVIE:
            filename = projexui.resources.find('img/ajax_loader.gif')
            XLoaderWidget.MOVIE = QMovie()
            XLoaderWidget.MOVIE.setFileName(filename)
            XLoaderWidget.MOVIE.start()
        
        return XLoaderWidget.MOVIE
549147
def libvlc_video_get_size(p_mi, num):
    '''
    '''
    f = _Cfunctions.get('libvlc_video_get_size', None) or \
        _Cfunction('libvlc_video_get_size', ((1,), (1,), (2,), (2,),), None,
                    ctypes.c_int, MediaPlayer, ctypes.c_uint, ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint))
    return f(p_mi, num)
586280
def libvlc_video_get_adjust_float(p_mi, option):
    '''
    '''
    f = _Cfunctions.get('libvlc_video_get_adjust_float', None) or \
        _Cfunction('libvlc_video_get_adjust_float', ((1,), (1,),), None,
                    ctypes.c_float, MediaPlayer, ctypes.c_uint)
    return f(p_mi, option)
933837
def retime_by_framerate(have, want)
      ratio = want.fps.to_f / have.fps.to_f
      have.subtitles.each do |subtitle|
        subtitle[:start] *= ratio
        subtitle[:end] *= ratio
      end
    end