有一个bash / batch文件脚本:
ffmpeg -i `youtube-dl https://www.twitch.tv/zero` -vf fps=fps=60, scale=1920x1080 -c:v libx264 -b:v 500k -preset superfast -c:a copy -f segment -segment_time 60 test.mp4
该脚本不是我的脚本,但它允许您以恒定的帧速率录制视频。不幸的是,在cmd中它不适用于我。已经尝试了一切,我不知道错误是什么。
我得到No such file or directory
。
尝试过'youtube-dl https://www.twitch.tv/zero'
,同样的错误
我尝试了"youtube-dl https://www.twitch.tv/zero"
,错误:youtube-dl https://www.twitch.tv/zero: Invalid argument
我在做什么错?作者保证他可以在linux上工作
更新
我尝试了ffmpeg -i $ (youtube-dl -f best -g https://www.twitch.tv/zero) ....
相同的错误
更新2
为什么视频大小超过500 Mb?我在做什么错了?
代码
cls && @echo off & setlocal enableextensions enabledelayedexpansion
set "_tag_00=https://www.twitch.tv/avagg"
set "_tag_01=--ignore-errors --abort-on-error --ignore-config --flat-playlist --geo-bypass "
set "_tag_02=--restrict-filenames --no-part --no-cache-dir --write-thumbnail --prefer-ffmpeg "
set "_tag_03=--ffmpeg-location .\ --postprocessor-args -i "%%(title)s.%%(ext)s" -vf fps^=fps^=60^,"
set "_tag_04=scale^=1920x1080 -c:v libx264 -b:v 500k -preset superfast -c:a copy -f segment -segment_time "
set "_tag_05=60 %%^(title^)s.mp4"
youtube-dl "!_tag_00!" -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "%%^(title^)s.%%^(ext^)s" !_tag_1!!_tag_2!!_tag_3!!_tag_4!!_tag_5!
Pause
更新3
答案 0 :(得分:1)
请注意到以下一些要点:
ffmpeg.exe
的路径在变量中,以便youtube-dl
可以找到它。ffmepg.exe
在相同的文件夹/路径= .\\
中。 我将通过名称 yt-DL.cmd
仅通过以下方式复制特定时间::仅编辑 _tag_1
值: -t 00:60:00
cls && @echo off & setlocal enableextensions enabledelayedexpansion
:: do some with the bat file, after then, for all links need `call :_yd_dl` %1
call :_yd_dl %1
echo/ is done^^!!
goto :eof
:_yd_dl
set "_tag_00=%1"
set "_tag_01= -t 00:60:00 -v error -stats -vf fps=fps=60,scale=1920x1080 -c:v libx264 -preset superfast -c:a copy "
for /f %%i in ('.\youtube-dl.exe -g !_tag_00! ^<nul ') do .\ffmpeg.exe -i "%%i" !_tag_01! .\output.mp4
exit /b
通过以下方式复制完整视频:
cls && @echo off & setlocal enableextensions enabledelayedexpansion
:: do some with the bat file, after then, for all links need `call :_yd_dl` %1
call :_yd_dl %1
echo/ is done^^!!
goto :eof
:_yd_dl
set "_tag_00=%1"
set "_tag_01=--ignore-errors --abort-on-error --ignore-config --flat-playlist --geo-bypass "
set "_tag_02=--restrict-filenames --no-part --no-cache-dir --write-thumbnail --prefer-ffmpeg "
set "_tag_03=--ffmpeg-location .\ --postprocessor-args -i "%%(title)s.%%(ext)s" -vf fps^=fps^=60^,"
set "_tag_04=scale^=1920x1080 -c:v libx264 -b:v 500k -preset superfast -c:a copy -f segment -segment_time "
set "_tag_05=60 %%^(title^)s.mp4"
youtube-dl "!_tag_00!" -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "%%^(title^)s.%%^(ext^)s" !_tag_1!!_tag_2!!_tag_3!!_tag_4!!_tag_5!
exit /b