def FfmpegFrameInfo(encodedfile):
  # Uses the ffprobe tool to give frame info.
  commandline = '%s -loglevel warning -show_frames -of json %s' % (
      encoder.Tool('ffprobe'), encodedfile)
  ffprobeinfo = subprocess.check_output(commandline, shell=True)
  probeinfo = json.loads(ffprobeinfo)
  previous_position = 0
  frameinfo = []
  for frame in probeinfo['frames']:
    current_position = int(frame['pkt_pos'])
    if previous_position != 0:
      frameinfo.append({'size': 8 * (current_position - previous_position)})
    previous_position = current_position
  frameinfo.append({'size': 8 *
                    (os.path.getsize(encodedfile) - previous_position)})
  return frameinfo
dataset/ETHPy150Open google/compare-codecs/lib/file_codec.py/FfmpegFrameInfo/original