<commit_before><?php
/**
 * @package server-infra
 * @subpackage Media
 */
class KFFMpegThumbnailMaker extends KBaseThumbnailMaker
{
	protected $cmdPath;
	/**
	 * @param string $filePath
	 * @param string $cmdPath
	 */
	public function __construct($srcPath, $targetPath, $cmdPath = 'ffmpeg')
	{
		$this->cmdPath = $cmdPath;
		parent::__construct($srcPath, $targetPath);
	}
	
	public function createThumnail($position = null, $width = null, $height = null, $params = array())
	{
		if(!array_key_exists('frameCount', $params)){
			$params['frameCount'] = 1; 
		}
		
		if(!array_key_exists ('targetType', $params)){
			$params['targetType'] = "image2"; 
		}
		
		if(!array_key_exists ('dar', $params)){
			$params['dar'] = null;
		}
		
		if(!array_key_exists ('vidDur', $params)){
			$params['vidDur'] = null;
		}
		
		if(!array_key_exists ('scanType', $params)){
			$params['scanType'] = null;
		}
		
		KalturaLog::debug("position[$position], width[$width], height[$height], params[".serialize($params)."]");
		$dar = $params['dar'];<commit_msg>Consolidate duplicate code<commit_after><?php
/**
 * @package server-infra
 * @subpackage Media
 */
class KFFMpegThumbnailMaker extends KBaseThumbnailMaker
{
	protected $cmdPath;
	/**
	 * @param string $filePath
	 * @param string $cmdPath
	 */
	public function __construct($srcPath, $targetPath, $cmdPath = 'ffmpeg')
	{
		$this->cmdPath = $cmdPath;
		parent::__construct($srcPath, $targetPath);
	}
	
	public function createThumnail($position = null, $width = null, $height = null, $params = array())
	{
		$params = self::normalizeParams($params);
		
		KalturaLog::debug("position[$position], width[$width], height[$height], params[".serialize($params)."]");
		$dar = $params['dar'];
{'fraction_non_alphanumeric': 0.1820289855072464, 'fraction_numerical': 0.0011594202898550724, 'mean_word_length': 5.013937282229965, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6641919', 'n_tokens_mistral': 634, 'n_tokens_neox': 571, 'n_words': 113}