将一个JPG图片经过h264压缩循环输出为mp4视频
ffmpeg.exe -i INPUT.jpg -an -vcodec libx264 -coder 1 -flags +loop -cmp +chroma -subq 10 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -flags2 +dct8x8 -trellis 2 -partitions +parti8x8+parti4x4 -crf 24 -threads 0 -r 25 -g 25 -y OUTPUT.mp4
上述是在网上找到的方法,但几乎都是没有解释,这貌似是要用到x264里面的参数,求大神解释一下是什么意思。
我主要想实现将一个图片制作为一段无声视频的问题(但要有静音的音频流),在官网找到的方法如下,
Notice that ‘%d’ is replaced by the image number.
img%03d.jpg means the sequence img001.jpg, img002.jpg, etc.
Use the -start_number option to declare a starting number for the sequence. This is useful if your sequence does not start with img001.jpg but is still in a numerical order. The following example will start with img100.jpg:
ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
这意味着,如果我想生成个10秒30帧的视频,就得生成300张图片,这样不靠谱,有人可以指导下?
而且,音频问题,这样意味着我得预先准备好不同时间长度的音频,略折腾。。