First, installation
Download FFmpeg, configure environment variables after decompression is installed
Open the DOS interface and go to the destination folder for example: e:/CD E:\BaiduYunDownload\ffmpeg\ffmpeg_simple_player\ffmpeg_simple_player\ffmpeg_simple_ Player1\res
Second, the command parameters
Command format: ffmpeg-i [input file name] [parameter options]-f [format] [output FILE]
1. Parameter options:
(1)-an: Remove audio
(2)-acodec: Audio options, usually followed by copy to indicate copy
(3)-vcodec: Video options, typically followed by copy to indicate copy
2. Format:
(1) H264: Indicates that the output is h264 video bare stream
(2) MP4: Indicates that the output is MP4 video
(3) Mpegts: indicates TS video stream
Third, video format conversion
H264 Bare stream is no audio
1, H264 video to TS video stream:
Ffmpeg-i Test.h264-vcodec copy-f Mpegts test.ts
2, H264 video turn mp4:
Ffmpeg-i test.h264-vcodec copy-f mp4 test.mp4
3, TS video turn mp4:
Ffmpeg-i test.ts-acodec copy-vcodec copy-f mp4 test.mp4
1. Separating the video audio stream
Ffmpeg-i input_file-vcodec Copy-an output_file_video//split video stream
Ffmpeg-i input_file-acodec copy-vn output_file_audio//Split audio stream
Ffmpeg-i Input_file-vn-acodec Pcm_s16le Output_file_audio.wav
2. Video re-use
Ffmpeg–i Test.mp4–vcodec copy–an–f M4V test.264
Ffmpeg–i Test.avi–vcodec copy–an–f M4V test.264
3. Video transcoding
Ffmpeg–i test.mp4–vcodec h264–s 352*278–an–f m4v test.264//transcoding to bitstream original file
Ffmpeg–i test.mp4–vcodec h264–bf 0–g 25–s 352*278–an–f m4v test.264//transcoding to bitstream original file
Ffmpeg–i test.avi-vcodec Mpeg4–vtag xvid–qsame Test_xvid.avi//transcoding to package file
-BF b Frame number control,-g key frame interval control,-s resolution control
4. Video Encapsulation
Ffmpeg–i video_file–i audio_file–vcodec copy–acodec copy output_file
5. Video Clipping
Ffmpeg–i test.avi–r 1–f image2 image-%3d.jpeg//Extract Pictures
Ffmpeg-ss 0:1:30-t 0:0:20-i input.avi-vcodec copy-acodec copy output.avi//Cut Video
-R Extract the frequency of the image,-ss start time,-t duration
6. Video recording
Ffmpeg–i Rtsp://192.168.3.205:5555/test–vcodec Copy Out.avi
7.YUV sequence Playback
Ffplay-f rawvideo-video_size 1920x1080 INPUT.YUV
8.YUV sequence turn avi
Ffmpeg–s w*h–pix_fmt yuv420p–i input.yuv–vcodec MPEG4 Output.avi
Four, video splicing:
For video stitching, the personal feeling is best from the video of the naked stream began splicing, followed by video packaging, that is, format conversion.
Stitching command:
Ffmpeg-i "concat:test1.h264|test2.h264"-vcodec copy-f h264 out12.h264
FFmpeg Common Commands