我在一個文件夾中有許多不同的視頻文件(mov,avi,flv,mp4,3gp,wmv)。如何使用Windows的.bat文件使用ffmpeg將.mov文件轉換爲.mp4(H264)?
我需要使用一個批處理文件,將所有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