parameters: (yuv_file_name, yuv_frame_width, yuv_frame_height,
                               output_directory, ffmpeg_path)
return_statement: return True
docstring: Converts a YUV video file into PNG frames.
  
    The function uses ffmpeg to convert the YUV file. The output of ffmpeg is in
    the form frame_xxxx.png, where xxxx is the frame number, starting from 0001.
  
    Args:
      yuv_file_name(string): The name of the YUV file.
      yuv_frame_width(int): The width of one YUV frame.
      yuv_frame_height(int): The height of one YUV frame.
      output_directory(string): The output directory where the PNG frames will be
        stored.
      ffmpeg_path(string): The path to the ffmpeg executable. If None, the PATH
        will be searched for it.
  
    Return:
      (bool): True if the conversion was OK.
docstring_summary: Converts a YUV video file into PNG frames.
docstring_tokens: Converts a YUV video file into PNG frames .
function: def convert_yuv_to_png_files(yuv_file_name, yuv_frame_width, yuv_frame_height,
                               output_directory, ffmpeg_path):
    """Converts a YUV video file into PNG frames.
  
    The function uses ffmpeg to convert the YUV file. The output of ffmpeg is in
    the form frame_xxxx.png, where xxxx is the frame number, starting from 0001.
  
    Args:
      yuv_file_name(string): The name of the YUV file.
      yuv_frame_width(int): The width of one YUV frame.
      yuv_frame_height(int): The height of one YUV frame.
      output_directory(string): The output directory where the PNG frames will be
        stored.
      ffmpeg_path(string): The path to the ffmpeg executable. If None, the PATH
        will be searched for it.
  
    Return:
      (bool): True if the conversion was OK.
    """
    size_string = str(yuv_frame_width) + 'x' + str(yuv_frame_height)
    output_files_pattern = os.path.join(output_directory, 'frame_%04d.png')
    if not ffmpeg_path:
      ffmpeg_path = 'ffmpeg.exe' if sys.platform == 'win32' else 'ffmpeg'
    command = [ffmpeg_path, '-s', '%s' % size_string, '-i', '%s'
               % yuv_file_name, '-f', 'image2', '-vcodec', 'png',
               '%s' % output_files_pattern]
    try:
      print 'Converting YUV file to PNG images (may take a while)...'
      print ' '.join(command)
      helper_functions.run_shell_command(
          command, fail_msg='Error during YUV to PNG conversion')
    except helper_functions.HelperError, err:
      print 'Error executing command: %s. Error: %s' % (command, err)
      return False
    except OSError:
      print ('Did not find %s. Have you installed it?' % ffmpeg_path)
      return False
    return True
function_tokens: def convert_yuv_to_png_files ( yuv_file_name , yuv_frame_width , yuv_frame_height , output_directory , ffmpeg_path ) : size_string = str ( yuv_frame_width ) + 'x' + str ( yuv_frame_height ) output_files_pattern = os . path . join ( output_directory , 'frame_%04d.png' ) if not ffmpeg_path : ffmpeg_path = 'ffmpeg.exe' if sys . platform == 'win32' else 'ffmpeg' command = [ ffmpeg_path , '-s' , '%s' % size_string , '-i' , '%s' % yuv_file_name , '-f' , 'image2' , '-vcodec' , 'png' , '%s' % output_files_pattern ] try : print 'Converting YUV file to PNG images (may take a while)...' print ' ' . join ( command ) helper_functions . run_shell_command ( command , fail_msg = 'Error during YUV to PNG conversion' ) except helper_functions . HelperError , err : print 'Error executing command: %s. Error: %s' % ( command , err ) return False except OSError : print ( 'Did not find %s. Have you installed it?' % ffmpeg_path ) return False return True