Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once ( "acces_baza.php" );
- $folder = "../filme/test test";
- $pattern = "/^.*\.(mkv)$/";
- $dir = new RecursiveDirectoryIterator( $folder );
- $ite = new RecursiveIteratorIterator( $dir );
- $files = new RegexIterator( $ite , $pattern , RegexIterator::GET_MATCH );
- $fileList = array();
- echo '<pre>';
- print_r ($files);
- foreach ($files as $file) {
- $fileList[] = $file[ 0 ];
- }
- $arrlength = count ( $fileList );
- for ($x = 0; $x < $arrlength; $x++) {
- if (( stripos ( $fileList[ $x ] , "sample" ) == true ) || ( stripos ( $fileList[ $x ] , ".@__thumb" ) == true )) {
- $fileList[ $x ] = "";
- } else {
- $filename = pathinfo ( $fileList[ $x ] , PATHINFO_FILENAME );
- $director = pathinfo ( $fileList[ $x ] , PATHINFO_DIRNAME );
- $ext = pathinfo ( $fileList[ $x ] , PATHINFO_EXTENSION );
- $video = $director."/".$filename.'.'.$ext; echo $video."<br>";
- $new_video = $director."/".$filename.".mp4";
- if (!file_exists($new_video)) {
- $ffmpeg_path = '/opt/Qffmpeg/bin/ffmpeg';
- exec($ffmpeg_path.' -i '.$video.' -vcodec copy -acodec copy '.$new_video);
- //unlink ($video);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement