Board logo

标题: [文本处理] ffmpeg在cmd可以运行但在bat无法运行 [打印本页]

作者: lzcl    时间: 2023-3-27 14:17     标题: ffmpeg在cmd可以运行但在bat无法运行

做了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!



跪求大神帮忙解决!!!!!!
作者: 77七    时间: 2023-3-27 14:40

%%d.tga

这是文件名还是代码没写完整?
作者: lzcl    时间: 2023-3-27 14:47

这是tag格式的序列,应该是完整的了
作者: newswan    时间: 2023-3-27 15:16

本帖最后由 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,试试
作者: Five66    时间: 2023-3-27 19:30

malloc of size 28876917 failed
作者: Batcher    时间: 2023-3-28 09:17

回复 1# lzcl


请把你的bat文件上传我看看。
如果需要上传文件,可以用阿里云盘或百度网盘。




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2