HandbrakeCLI无法识别的文件类型

时间:2018-11-26 15:26:47

标签: batch-file handbrakecli

我正在尝试设置一个简单的批处理文件以使用手刹来压缩视频。我安装了Handbrake,发现需要单独安装HandbrakeCLI。我下载了HandBrakeCLI.exe并将其放在C:\上。然后,我做了一个预设,并使用GUI将其设置为默认值。然后,我像这样呼叫handbrake

@echo off
for %%f in (*.mpg) do (
    C:\HandBrakeCLI -i 'C:\Users\rv\Desktop\Newfolder\%%f' -o 'C:\encode\%%f.mp4'
)
pause

我收到以下错误,告诉我文件类型无法识别:

[10:19:30] dvd: not a dvd - trying as a stream/file instead
[10:19:30] hb_stream_open: open 'C:\Users\rv\Desktop\Newfolder\126_812-714A_812-713_111914_san.mpg' 
failed
[10:19:30] scan: unrecognized file type
[10:19:30] libhb: scan thread found 0 valid title(s)
No title found.

关于命令行版本突然无法打开文件的任何想法?相同的文件可以在GUI中打开并进行转换。

我尝试重新安装所有内容并删除预设文件夹,即使这似乎不是问题所在。


更新: 这是对我有用的最终代码。

@echo off
set /A count_complete = 0
set /A count_total = 0
pushd %~dp0
for /R %%f in (*.mp2, *.mpg, *.vob, *.avi, *.wmv, *.mov, *.m4v, *.mpeg, *.mp4) do (
   set /A count_total+=1
)
for /R %%f in (*.mp4) do (
   echo Count is currently %count% of %count_total%
   C:\HandBrakeCLI --preset-import-gui C:\Users\xxx\Desktop\customencode.json -Z "CustomCompress" -i "%%f" -o "%%~dpf%%~nf_conv.mp4"
    if exist "%%~dpf%%~nf_conv.mp4" (
        del "%%f"
        ren "%%~dpf%%~nf_conv.mp4" "%%~nf.mp4"
        set /A count_complete+=1
    ) 
)
for /R %%f in (*.mp2, *.mpg, *.vob, *.avi, *.wmv, *.mov, *.m4v, *.mpeg) do (
   echo Count is currently %count% of %count_total%
   C:\HandBrakeCLI --preset-import-gui C:\Users\xxxxx\Desktop\customencode.json -Z "CustomCompress" -i "%%f" -o "%%~dpf%%~nf_conv.mp4"
    if exist "%%~dpf%%~nf_conv.mp4" (
        del "%%f"
        ren "%%~dpf%%~nf_conv.mp4" "%%~nf.mp4"
        set /A count_complete+=1
    )
)
popd
echo Count is: %count% out of %count_try% attempted.
pause

1 个答案:

答案 0 :(得分:0)

我需要使用双引号而不是单引号。像这样:

<td>{{ $totals->CURRENT}}</td>
<td>{{ $totals->PRIOR}}</td>
<td>{{ $totals->FULL}}</td>