我不太熟悉命令行,因此希望这不是一个愚蠢的问题。
如果我运行:
ffmpeg -i videofile.avi
我得到这样的输出:
ffmpeg version git-2013-11-21-6a7980e Copyright (c) 2000-2013 the FFmpeg develop ers
built on Nov 21 2013 12:06:32 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --b indir=/home/user/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable -libfdk- aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-l ibx264 --enable- nonfree
libavutil 52. 53.100 / 52. 53.100
libavcodec 55. 44.100 / 55. 44.100
libavformat 55. 21.100 / 55. 21.100
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 91.100 / 3. 91.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, avi, from 'videofile.avi':
Metadata:
encoder : Lavf52.68.0
Duration: 00:23:07.68, start: 0.000000, bitrate: 2390 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 23.98 fps, 23.98 tbr, 23.98 tbn, 1199 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 k b/s
如果我只对输出“ 640x480”的命令感兴趣,该怎么办?
我想我必须将输出传递给正则表达式并执行正则表达式吗?不知道该怎么做。谢谢!