gpt4 book ai didi

batch-file - 如何使用 Windows .bat 文件使用 ffmpeg 将 .mov 文件转换为 .mp4 (H264)?

转载 作者:行者123 更新时间:2023-12-04 22:46:21 46 4
gpt4 key购买 nike

我的文件夹中有许多不同的视频文件(mov、avi、flv、mp4、3gp、wmv)。

我需要使用一个批处理文件来转换文件夹中的所有 mov、avi、wmv、3gp 文件我还需要跳过任何 flv、mp4 文件

我有这个命令,但它给出错误并生成 0 大小的文件:

for %%F in (*.mov) do ffmpeg.exe -i "%%~fF" -vcodec copy -acodec copy "%%~dpF\%%~nF.mp4"

上面的行只是尝试处理 mov 文件。我对 avi 文件得到相同的结果。

我想保持文件名相同。我正确获取文件名,但出现错误:

    ffmpeg version N-54691-g7f4a1fd Copyright (c) 2000-2013 the FFmpeg developers
built on Jul 12 2013 16:31:48 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil 52. 39.100 / 52. 39.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.102 / 55. 12.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 80.101 / 3. 80.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'C:\musa\Challenge\FFMPEG\Test\file5.AVI':
Metadata:
encoder : OPTURA20
Duration: 00:00:10.01, start: 0.000000, bitrate: 1518 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p, 320x240, 14.99 fps,
14.99 tbr, 14.99 tbn, 14.99 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16,
256 kb/s
[mp4 @ 00000000024bc980] Tag [1][0][0][0]/0x00000001 incompatible with output co
dec id '65536' ([0][0][0][0])
Output #0, mp4, to 'C:\musa\Challenge\FFMPEG\Test\\file5.mp4':
Metadata:
encoder : OPTURA20
Stream #0:0: Video: mjpeg (l[0][0][0] / 0x006C), yuvj422p, 320x240, q=2-31,
14.99 fps, 90k tbn, 14.99 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, 256 k
b/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invali
d data found when processing input

最佳答案

PCM 音频流与 MP4 容器不兼容,请查看 specs和您的错误消息:

Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s [mp4 @ 00000000024bc980] Tag [1][0][0][0]/0x00000001 incompatible with output codec id '65536' ([0][0][0][0])

请注意:MP4视频容器格式和 H.264视频流格式是两种不同的东西。 MP4 视频容器还可以“包含”其他视频流格式,例如。 Xvid 甚至 MJPEG。

关于batch-file - 如何使用 Windows .bat 文件使用 ffmpeg 将 .mov 文件转换为 .mp4 (H264)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17625516/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com