ffmepg的常见使用

ffmpeg -i a.mp4 -i b.wav -shortest -q:v 0 a_av.mp4 -loglevel error -y

Add an audio to a silent video. The -y means overwriting same output video.

ffmpeg -i a.wav -ss ${hour}:${min}:${sec} clip.wav -loglevel error -y

Clip the audio from a specific time step.

ffmpeg -i a.mp4 b.acc -y
ffmpeg -i b.acc b.wav -y

Extract the wav audio from a mp4 video.

ffmpeg -i a.mp4 -vf "crop=out_w:out_h:x:y" -y b.mp4

x:y specify the top left corner of the output rectangle.

ffmpeg -i a.mp4 -i b.mp4 -q:v 0 -filter_complex hstack=inputs=2  o.avi

Merge two videos in hstack manner. -q:v 0 indicates no quality loss. inputs=2 means how many inputs. -shortest assign the shortest video as the final length of merged video.

你可能感兴趣的:(ffmpeg)