
Record the screen and save it as a yuv fileįfmpeg -f x11grab -s 640x480 -i :0.0 -r 30 out.yuvįfplay -video_size 640x480 -pix_fmt bgr0 out.yuv i device number, 10 is the x offset of the capture, and 20 is the y offset of the capture 2.

Capture video and audio and save as mpg fileįfmpeg -f alsa -ac 2 -i hw:0 -f x11grab -s 1200*780 -i :0.0 +10,20 Libswscale: color conversion and scaling toolĬan be divided into the following categories:įFmpeg can query basic information, such as query version:įfmpeg -h demux=avfoundationCommand to view his parameters, mainly audio and video equipment number, pixel format, etc.ġ. Libavdevice: access to capture device and playback device interface, used to obtain from many common multimedia input/output software frameworks (including Video4Linux, Video4Linux2, VfW and ALSA) And rendering Libavfilter: various audio and video filters Libavtuil: Library containing simplified program functions, including random number generator, data structure, mathematics Routines, core multimedia utilities, etc. Libavformat: Demultiplexer and multiplexer containing multimedia container format Libavcodec: Decoder and encoder containing audio/video codec Commonly used video coding formats are: H.264, H.265, VP8 commonly used audio coding formats are: MP3, AAC įfmpeg: Convert formats between multimedia files.įfplay: A simple media player based on SDL and FFmpeg, which can play various formats of multimedia files (mp4, h.264, yuv, etc.). Different encoding formats (CODEC) have different compression rates, which will cause differences in file size and definition. Implements the mutual conversion between compressed data and original data in units of frames.īoth video and audio need to be encoded before they can be saved as a file.

One audio/video stream is called one stream, and there may be multiple audio streams in a multimedia file.

MP4, FLV, MOV and other file formats multimedia files can store video streams, subtitle streams. I have studied ffmpeg for a period of time, and I will record the learning process and the detours I have taken here to prevent everyone from stepping on the pits I have gone through.įFmpeg is a powerful open source computer program for video processing, including playback, recording, transcoding, special effects, etc., widely used in video websites and commercial fields.

Record the screen and save it as a yuv file Capture video and audio and save as mpg file FFmpeg learning summary (1) basic concepts and common commands
