Created
August 26, 2017 02:53
-
-
Save idawnlight/cda6da0ed1c4fb84d423e19692cab4cf to your computer and use it in GitHub Desktop.
Revisions
-
idawnlight created this gist
Aug 26, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ <?php echo "Making a list..." . "\n"; foreach(scandir("./") as $name) { if (preg_match_all("/[0-9]+-(.*)-hd.flv/", $name, $id)) { $file[$id[1][0]] = $name; } } if (empty($file)) { echo "Can't find any video.\nExit."; exit; } $list = ""; for ($i = 1; true; $i++) { if (!isset($file[$i+1])) { $list .= "file '" . $file[$i] . "'"; break; } $list .= "file '" . $file[$i] . "'\n"; } file_put_contents("./ff.txt", $list); echo "Using ffmpeg to merge..." . "\n"; passthru("ffmpeg -f concat -i ./ff.txt -c copy output.mp4"); echo "Done.";