标题: [文件操作] 视频截图分割的批处理出现了could not find ref with poc 24如何解决 [打印本页]
作者: wip 时间: 2022-10-10 13:27 标题: 视频截图分割的批处理出现了could not find ref with poc 24如何解决
rt,在用批处理进行视频截图分割的时候出现了这个问题,而且截取出来的图像是灰色的- @echo off
- setlocal enabledelayedexpansion
-
- set index=0
-
- for %%f in (*.mp4) do (
- set files[!index!]=%%~nf
- echo !index!. %%~nf
- set /a index+=1
- )
- set /p select_index=Select:
- for /l %%i in (!select_index!, 1, !select_index!) do (
- if defined files[%%i] (
- call :cut_mp4 !files[%%i]!
- )
- )
-
- exit /b 0
-
- :convert_mp4
- ffmpeg -i %~1.mp4 ^
- -c:a copy ^
- -c:v hevc_nvenc ^
- -vf scale=1920:-1 ^
- -preset slow ^
- -crf 20 ^
- output/%~1.mp4
- exit /b 0
-
- :cut_mp4
- md output\%~1
-
- for /f "tokens=2 delims=, " %%a in ('ffmpeg -i %~1.mp4 2^>^&1 ^| find "Duration:"') do (
- set duration=%%a
- set /a duration_seconds=!duration:~0,2!*3600+!duration:~3,2!*60+!duration:~6,2!
- set /a frames=!duration_seconds!/30
- )
-
- for /l %%j in (1, 1, !frames!) do (
- set /a hours=%%j/120
- if !hours! lss 10 (set hours=0!hours!)
- set /a minutes=%%j/2-!hours!*60
- if !minutes! lss 10 (set minutes=0!minutes!)
- set /a seconds=%%j*30-!hours!*3600-!minutes!*60
- if !seconds! lss 10 (set seconds=0!seconds!)
- set times=!hours!:!minutes!:!seconds!
-
- ffmpeg -loglevel error ^
- -ss !times! ^
- -i %~1.mp4 ^
- -f image2 ^
- -frames:v 1 ^
- -q:v 1 ^
- output/%~1/!hours!_!minutes!_!seconds!-0.jpg
- )
- exit /b 0
-
- pause
复制代码
作者: Batcher 时间: 2022-10-10 13:35
回复 1# wip
这不是BAT语法报错,而是ffmpeg在报错。
请参考Q-01观察一下哪行代码在报错以及详细的报错信息:
https://mp.weixin.qq.com/s/Koje4FufWxWBs7ioDy_LJA
然后调整那一行的ffmpeg参数。
作者: wip 时间: 2022-10-10 14:00
回复 2# Batcher
好的,谢谢您,刚刚按照您说的进行了修改,但是好像还是没有具体位置,那个结果出来就是一连串的
[hevc @ 0001232360a58900] Could not find ref with POC24
[hevc @ 数字] Could not find ref with POC23
[hevc @ 数字] Could not find ref with POC22
[hevc @ 数字] Could not find ref with POC22
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |