Audio and video processing artifact FFmpeg

A platform supported by FFmpeg

Download the official link: http://ffmpeg.org/download.html

The threshold for using FFmpeg is that some machines may have some dependent versions or involve the separate installation of some libraries, which is a little troublesome, but most of them can be solved by searching.

Two: Examples of FFmpeg common functions

1. Extract video ffmpeg -i input.mp4 -vcodec copy -an out.mp4 

2. Extract sound

ffmpeg -i input.mp4 -vn -y -acodec copy out.aac

ffmpeg -i input.mp4 out.mp3

3. Video transcoding ffmpeg -i input.mov -vcodec h264 out.mp4

ffmpeg -i input.mp4 output.avi

ffmpeg -i input.avi output.mp4

4. Compression parameter setting

ffmpeg -i input.mp4 -s 1080x1248 -b:v 3000k -vcodec h264 -r 60 out.mp4

Interpretation: -s 1080x1248 resolution -b:v 3000k video bit rate -r 60 frame rate

5. To capture a video from 6 seconds to 18 seconds from the long video input.mp4, you can use the following command

ffmpeg -ss 00:00:06 -t 00:00:12 -i input.mp4 -vcodec copy -acodec copy small.mp4

6. Video capture:

ffmpeg -i input.mp4 -r 1 -f image2 image-%d.jpg Take a screenshot from input.mp4 from the video file, grab one every second, and name the screenshots as image1, image2, image3, image4 ....

7. Image synthesis video ffmpeg -f image2 -i image-%d.jpg -vcodec libx264 out.mp4 Synthesize video satisfying image-%d.jpg

Guess you like

Origin blog.csdn.net/forgetmiss/article/details/107787773