original_docstring:  reads the FFMPEG info on the file and sets self.size
              and self.fps 
docstring: reads the FFMPEG info on the file and sets self.size
  and self.fps
docstring_tokens: reads the FFMPEG info on the file and sets self . size and self . fps
code: def load_infos(self, print_infos=False):
          """ reads the FFMPEG info on the file and sets self.size
              and self.fps """
          # open the file in a pipe, provoke an error, read output
          proc = sp.Popen([FFMPEG_BINARY,"-i",self.filename, "-"],
                  stdin=sp.PIPE,
                  stdout=sp.PIPE,
                  stderr=sp.PIPE)
          proc.stdout.readline()
          proc.terminate()
          infos = proc.stderr.read()
          if print_infos:
              # print the whole info text returned by FFMPEG
              print infos
              
          lines = infos.splitlines()
          
          if "No such file or directory" in lines[-1]:
              raise IOError("%s not found ! Wrong path ?"%self.filename)
              
          # get duration (in seconds)
          line = [l for l in lines if 'Duration: ' in l][0]
          match = re.search(" [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9]",line)
          hms = map(float,line[match.start()+1:match.end()].split(':'))
          self.duration = cvsecs(*hms)
          self.nframes = int(self.duration*self.fps)
code_tokens: def load_infos ( self , print_infos = False ) : proc = sp . Popen ( [ FFMPEG_BINARY , "-i" , self . filename , "-" ] , stdin = sp . PIPE , stdout = sp . PIPE , stderr = sp . PIPE ) proc . stdout . readline ( ) proc . terminate ( ) infos = proc . stderr . read ( ) if print_infos : print infos lines = infos . splitlines ( ) if "No such file or directory" in lines [ - 1 ] : raise IOError ( "%s not found ! Wrong path ?" % self . filename ) line = [ l for l in lines if 'Duration: ' in l ] [ 0 ] match = re . search ( " [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9]" , line ) hms = map ( float , line [ match . start ( ) + 1 : match . end ( ) ] . split ( ':' ) ) self . duration = cvsecs ( * hms ) self . nframes = int ( self . duration * self . fps )
short_docstring: reads the FFMPEG info on the file and sets self.size
  and self.fps
short_docstring_tokens: reads the FFMPEG info on the file and sets self . size and self . fps
comment: """ reads the FFMPEG info on the file and sets self.size
              and self.fps """$SEP$# open the file in a pipe, provoke an error, read output$SEP$# print the whole info text returned by FFMPEG$SEP$# get duration (in seconds)