找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 18914|回复: 5

[文本处理] ffmpeg在cmd可以运行但在bat无法运行

[复制链接]
发表于 2023-3-27 14:17:33 | 显示全部楼层 |阅读模式
做了ffmpeg的两个带通道的序列帧叠加输出视频设置
ffmpeg -f image2 -framerate 25 -i d:\\test\\%d.tga -loop 1 -i d:\\test2\\%d.tga -filter_complex overlay=shortest=1 d:\\out8.mp4            在cmd可以运行

但编辑成.bat文件后为:
echo off
ffmpeg -f image2 -framerate 25 -i d:\\test\\%%d.tga -loop 1 -i d:\\test2\\%%d.tga -filter_complex overlay=shortest=1 d:\\out8.mp4
pause




报错无法运行,转换报错如下:
Input #0, image2, from 'd:\\test\\%d.tga':
  Duration: 00:00:00.12, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: targa, bgra, 4096x4096, 25 tbr, 25 tbn, 25 tbc
Input #1, image2, from 'd:\\test2\\%d.tga':
  Duration: 00:00:00.12, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: targa, bgra, 4096x4096, 25 tbr, 25 tbn, 25 tbc
File 'd:\\out8.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 (targa) -> overlay:main
  Stream #1:0 (targa) -> overlayverlay
  overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[libx264 @ 000001f6a5fc4f80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [error]: malloc of size 28876917 failed
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[image2 @ 000001f6a5fc1580] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Conversion failed!



跪求大神帮忙解决!!!!!!
发表于 2023-3-27 14:40:10 | 显示全部楼层
%%d.tga

这是文件名还是代码没写完整?
 楼主| 发表于 2023-3-27 14:47:45 | 显示全部楼层
这是tag格式的序列,应该是完整的了
发表于 2023-3-27 15:16:53 | 显示全部楼层
本帖最后由 newswan 于 2023-3-27 15:20 编辑

ffmpeg %d.tga 是什么?
可以用echo 看看,批处理预处理后的命令

  1. echo off
  2. echo ffmpeg -f image2 -framerate 25 -i d:\\test\\%%d.tga -loop 1 -i d:\\test2\\%%d.tga -filter_complex overlay=shortest=1 d:\\out8.mp4
  3. pause

复制代码
或者用 cmd/c start 执行 ffmpeg,试试
发表于 2023-3-27 19:30:50 | 显示全部楼层
malloc of size 28876917 failed
发表于 2023-3-28 09:17:15 | 显示全部楼层
回复 1# lzcl


请把你的bat文件上传我看看。
如果需要上传文件,可以用阿里云盘或百度网盘。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-19 01:03 , Processed in 0.017818 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表