<?php
if ( $config['htmlcomm'] == true ) echo ("<!-- preview.php BEGIN -->
");
if ( $ready2go_source == true ) {
echo (" <br>
".$lang['wish_preview']."<br>
<table border=\"1\" rules=\"all\">
<tr>
<td align=\"center\">
".$lang['wish_preview_c']."
</td>
<td align=\"center\">
".$lang['wish_preview_f']."
</td>
<td align=\"center\">
".$lang['wish_preview_h']."
</td>
<td align=\"center\">
".$lang['wish_preview_q']."
</td>
</tr>
<tr>
<td align=\"center\">
1
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_1_1\""); if ( $wish_preview == "yes_1_1" ) echo (" checked"); echo (">
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_1_2\""); if ( $wish_preview == "yes_1_2" ) echo (" checked"); echo (">
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_1_4\""); if ( $wish_preview == "yes_1_4" ) echo (" checked"); echo (">
</td>
</tr>
<tr>
<td align=\"center\">
5
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_5_1\""); if ( $wish_preview == "yes_5_1" ) echo (" checked"); echo (">
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_5_2\""); if ( $wish_preview == "yes_5_2" ) echo (" checked"); echo (">
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_5_4\""); if ( $wish_preview == "yes_5_4" ) echo (" checked"); echo (">
</td>
</tr>
<tr>
<td align=\"center\">
10
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_10_1\""); if ( $wish_preview == "yes_10_1" ) echo (" checked"); echo (">
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_10_2\""); if ( $wish_preview == "yes_10_2" ) echo (" checked"); echo (">
</td>
<td align=\"center\">
<input type=\"radio\" name=\"wish_preview\" value=\"yes_10_4\""); if ( $wish_preview == "yes_10_4" ) echo (" checked"); echo (">
</td>
</tr>
<tr>
<td align=\"center\">
".$lang['none']."
</td>
<td align=\"center\" colspan=\"3\">
<input type=\"radio\" name=\"wish_preview\" value=\"none\""); if ( $wish_preview == "none" ) echo (" checked"); echo (">
</td>
</tr>
</table>
");
}
$wish_preview_fork = explode('_',$wish_preview);
$wish_preview_fork_yn = $wish_preview_fork[0];
if ( $wish_preview_fork[0] == "yes" ) {
$number_of_preview = $wish_preview_fork[1];
if ( $wish_preview_fork[2] == 1 ) {
if ( $set_image_format == 43 ) $set_real_image_format = "704x576";
if ( $set_image_format == 169 ) $set_real_image_format = "704x406";
}
if ( $wish_preview_fork[2] == 2 ) {
if ( $set_image_format == 43 ) $set_real_image_format = "352x264";
if ( $set_image_format == 169 ) $set_real_image_format = "352x198";
}
if ( $wish_preview_fork[2] == 4 ) {
if ( $set_image_format == 43 ) $set_real_image_format = "176x132";
if ( $set_image_format == 169 ) $set_real_image_format = "176x100";
}
echo (" <br><br>
");
}
if ( ( $wish_preview_fork_yn == "yes" ) OR ( $wish_preview == "none" ) ) $ready2go_source = true; else $ready2go_source = false;
if ( $ready2go_source == true ) {
// echo $source_media_real_path;
// $fullpath = $function_source_config['path']."/".$source_media_real_path.".".$function_source_config['extension'];
$fullpath = $source_media_real_path;
if ( $wish_preview != "none" ) {
$count = 1;
$tmpfolder = ($config['TempFolder']."/preview");
if(!file_exists($tmpfolder))
mkdir ($tmpfolder);
while ( $count <= $number_of_preview ) {
exec("nice -n19 ffmpeg -y -i \"".$fullpath."\" -t 0.001 -ss ".( $count * 60 )." -vframes 1 -f mjpeg -s ".$set_real_image_format." \"".$tmpfolder."/".$count.".jpg\" > \"".$tmpfolder."/".$count.".txt\" 2>&1");
echo (" <img src=\"".$tmpfolder."/".$count.".jpg\" alt=\"preview_".$count."\">
<br><br>
");
$count++;
}
}
}
if ( $config['htmlcomm'] == true ) echo ("<!-- preview.php END -->
");
?>