Browse Source

for windows video

feature/for_windows_video_compress_sxs20200923
zmiffang 5 years ago
parent
commit
6cf9847476
6 changed files with 10671 additions and 1010 deletions
  1. +5
    -0
      .idea/php.xml
  2. +14
    -7
      app/Services/HandBrakeService.php
  3. +3106
    -1003
      composer.lock
  4. +7544
    -0
      composer.lock.back
  5. +1
    -0
      video.ps1
  6. +1
    -0
      video1.ps1

+ 5
- 0
.idea/php.xml View File

@ -158,6 +158,11 @@
<path value="$PROJECT_DIR$/vendor/nexmo/client-core" />
<path value="$PROJECT_DIR$/vendor/mgp25/instagram-php" />
<path value="$PROJECT_DIR$/vendor/mhor/php-mediainfo" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php80" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php70" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
<path value="$PROJECT_DIR$/vendor/league/mime-type-detection" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />


+ 14
- 7
app/Services/HandBrakeService.php View File

@ -6,19 +6,22 @@ namespace App\Services;
class HandBrakeService
{
public function handleVideos($dir = "/Users/shixuesen/Documents/tmp/福利姬 软软趴在床单上-铃木美咲(Misaki Suzuki) 合集-TLoB/")
public function handleVideos($dir = "N:\\v\\91麻豆国产原创剧情片\\")
{
setlocale(LC_ALL, ['zh_CN.gbk', 'zh_CN.gb2312', 'zh_CN.gb18030']);
$files = scandir($dir);
// $files = array_slice($files, 128);
foreach ($files as $file) {
if ($file == "." || $file == "..") {
continue;
}
$subDir = implode("/", [$dir, $file]);
$subDir = implode("\\", [$dir, $file]);
$isDir = is_dir($subDir);
if ($isDir) {
$subFiles = scandir($subDir);
foreach ($subFiles as $subFile) {
$subPathFile = implode("/", [$subDir, $subFile]);
$subPathFile = implode("\\", [$subDir, $subFile]);
if (is_dir($subPathFile) || $subFile == ".DS_Store") {
continue;
}
@ -32,13 +35,17 @@ class HandBrakeService
if (ends_with($fileInfo["filename"], "-1")) {
continue;
}
if (is_file($fileInfo["dirname"] . '/' .$fileInfo["filename"] . '-1'. '.' . $fileInfo["extension"])) {
$subPathFileArr = explode("." . $fileInfo["extension"], $subPathFile);
if (is_file($subPathFileArr[0] . '-1'. '.' . $fileInfo["extension"])) {
unlink($subPathFile);
continue;
}
$targetFile = $fileInfo["dirname"] . '/' .$fileInfo["filename"] . '-1'. '.' . $fileInfo["extension"];
dump("targetFile", [$targetFile]);
$targetFile = $subPathFileArr[0] . '-1'. '.' . $fileInfo["extension"];
// $result = shell_exec("handBrakeCli -Z 'Very Fast 720p30' -i '". $subPathFile ."' -o '". $targetFile . " && echo 'success'");
$result = shell_exec("handBrakeCli -Z 'Very Fast 720p30' -i '". $subPathFile ."' -o '". $targetFile . "'");
// dump("D:\Software\HandBrakeCLI-1.3.3-win-x86_64\HandBrakeCLI.exe -Z \"Very Fast 720p30\" -i '". $subPathFile ."' -o '". $targetFile . "'");exit;
file_put_contents("video.ps1", iconv('UTF-8', 'GBK', "D:\Software\HandBrakeCLI-1.3.3-win-x86_64\HandBrakeCLI.exe -Z \"Very Fast 720p30\" -i '". $subPathFile ."' -o '". $targetFile . "'"));
// $result = shell_exec("D:\Software\HandBrakeCLI-1.3.3-win-x86_64\HandBrakeCLI.exe -Z \"Very Fast 720p30\" -i '". $subPathFile ."' -o '". $targetFile . "");
$result = shell_exec( 'powershell.exe -executionpolicy bypass -NoProfile -File ".\video.ps1"');
dump($result);
}


+ 3106
- 1003
composer.lock
File diff suppressed because it is too large
View File


+ 7544
- 0
composer.lock.back
File diff suppressed because it is too large
View File


+ 1
- 0
video.ps1 View File

@ -0,0 +1 @@
D:\Software\HandBrakeCLI-1.3.3-win-x86_64\HandBrakeCLI.exe -Z "Very Fast 720p30" -i 'N:\v\91麻豆国产原创剧情片\\91侍小妖8部合集\侍小妖 - 高清露脸极品美女抽搐到高潮,年度最佳.mp4' -o 'N:\v\91麻豆国产原创剧情片\\91侍小妖8部合集\侍小妖 - 高清露脸极品美女抽搐到高潮,年度最佳-1.mp4'

+ 1
- 0
video1.ps1 View File

@ -0,0 +1 @@
D:\Software\HandBrakeCLI-1.3.3-win-x86_64\HandBrakeCLI.exe -Z "Very Fast 720p30" -i 'N:\v\ÁõîÚ¶ù ºÏ¼¯-TLoB\\ÁõîÚ¶ùÊÓÆµ\008.mp4' -o 'N:\v\ÁõîÚ¶ù ºÏ¼¯-TLoB\ÁõîÚ¶ùÊÓÆµ\008-1.mp4'

Loading…
Cancel
Save