ffmpeg
PNG 序列 to webm
https://developers.google.com/web/updates/2013/07/Alpha-transparency-in-Chrome-video
下载 ffmpeg https://www.ffmpeg.org/
放到
/usr/local/bin/
转换
ffmpeg -i img_%5d.png output.webm
压缩等级(没什么卵用)
Vales go from 0 to 12. Default is 5.
The FLAC encoder works with either 16 or 32 bit samples. Other sizes will be stored as one of these two options.
https://stackoverflow.com/questions/44836653/ffmpegs-flac-compression-levels-defaults-settings
ffmpeg -i in.wav -compression_level 8 out.flac
bitrate (有用)
ffmpeg -i img_%5d.png -c:v libvpx-vp9 -minrate 5000k -b:v 12000k -maxrate 16000k output_h.webm
video to image array
It's very simple with ffmpeg, and it can output one frame every N seconds without extra scripting. To export as an image sequence just use myimage_%04d.png or similar as the output. The %0xd bit is converted to a zero-padded integer x digits long - the example I gave gets output as myimage_0000.png myimage_0001.png etc.. You can use lots of still image formats, png, jpeg, tga, whatever (see ffmpeg -formats for a full list).
Ok so to export as an image sequence we can use an image format as the output with a sequential filename, but we don't want to export every single frame. So simply change the frame rate of the output to whatever we want using the -r n option where n is the number of frames per second. 1 frame per second would be -r 1, one frame every four seconds would be -r 0.25, one frame every ten seconds would be -r 0.1 and so on.
So to put it all together, this is how it would look to save one frame of input.mov every four seconds to output_0000.png, output_0001.png etc.:
ffmpeg -i input.mp4 -r 0.25 output_%04d.png
导出每一帧
ffmpeg -i input.mp4 -r 0.25 output_%04d.png
https://superuser.com/questions/135117/how-to-convert-video-to-images
合并视频和音频
ffmpeg -i vid.mp4 -i aud.aac -codec copy -shortest output.mp4
从视频抽出音频
ffmpeg -i vid.mp4 -vn -acodec copy output-audio.aac
https://stackoverflow.com/questions/9913032/ffmpeg-to-extract-audio-from-video
MOV to MP4
ffmpeg -i my-video.mov -vcodec h264 -acodec mp2 my-video.mp4