#舍得Share #ffmpeg using Syntax _image

Source: Internet
Author: User

Turn from: https://lwxshow.com/post/1076.html

FFmpeg using syntax

ffmpeg [[options]['-i ' input_file]] ... {[options] output_file} ...
If there is no input file, the video audio capture (which is only valid under Linux) will work if the audio and video device is handled as a file handle under Linux. As a general rule, options are generally used for the next specific file. If you give –b 64 option, re-election will set the next video rate. For the original input file, the formatting options may be required. By default, FFmpeg tries to do as much lossless conversion as possible, using the same audio video parameters as input to output.

FFmpeg conversion involves more options, you can refer to the FFmpeg option detailed.

FFmpeg supports a variety of file formats and a variety of audio, video encoders, can refer to the FFMEPG format, (with: Common video file format detailed) video file screenshot

To intercept a picture of a 352x240 size, formatted as JPG
Ffmpeg-i test.asf-y-F image2-t 0.001-s 352x240 a.jpg gif pictures

Convert the first 30 frames of the video into a animated Gif
Ffmpeg-i test.asf-vframes 30-y-F gif a.gif intercept a thumbnail for a specified time

Ffmpeg-i test.avi-y-F image2-ss 8-t 0.001-s 350x240 test.jpg
-ss the time unit followed by the seconds convert file to 3GP format

Ffmpeg-y-I test.mpeg-bitexact-vcodec h263-b 128-r 15-s 176x144
-acodec aac-ac 2-ar 22500-ab 24-f 3gp te ST.3GP
or
ffmpeg-y-i test.wmv-ac 1-acodec libamr_nb-ar 8000-ab 12200-s 176x144-b 128-r-test.3gp video format conversion

How to get high-quality video using ffmpeg encoding
ffmpeg.exe-i "D:\Video\Fearless\Fearless.avi"-target film-dvd-s 720x352
-padtop 64- Padbottom 64-maxrate 7350000-b 3700000-sc_threshold 1000000000
-trellis-cgop-g 12-bf 2-qblur 0.3-qcomp 0.7-me FULL-DC 10-mbd 2
-aspect 16:9-pass 2-passlogfile "D:\Video\ffmpegencode"-an-f mpeg2video "D:\FEARLESS.M2V"
Converts the specified format file to the FLV format
ffmpeg.exe-i test.mp3-ab 56-ar 22050-b 500-r 15-s 320x240 f:\test.flv
Ffmpeg.exe-i test.wmv -ab 56-ar 22050-b 500-r 15-s 320x240 f:\test.flv
transcoding decrypted vob
Ffmpeg-i snatch_1.vob-f avi-vcodec 800- G 300-BF 2-acodec mp3-ab 128 Snatch.avi
The above command line converts VOB files to AVI files, MPEG4 video and MP3 audio. Note that frame B is used in the command, so the MPEG4 stream is divx5 compatible. A GOP size of 300 means that there are intra frames every 10 seconds at 29.97 frame frequencies. This mapping is especially useful when you are in the audio language for DVD transcoding.
encode into several formats at the same time and establish a mapping between the input and output streams
ffmpeg-i/tmp/a.wav-ab 64/tmp/a.mp2-ab 128/tmp/b.mp2-map 0:0-map
0:0 the command line above A 64Kbits a.wav to 128kbits a.mp2 '-map file:index ' defines in the order of the output stream which input stream is used for each output stream. Convert file to 3GP format

Ffmpeg-i test.avi-y-B 20-s sqcif-r 10-acodec amr_wb-ab 23.85-ac 1-ar 16000 test.3gp
Note: If you want to convert to 3GP format, ffmpeg must add –ENABLE-AMR_NB–ENABLE-AMR_WB at compile time, details can refer to: Convert video to 3GPP format convert file to MP4 format (support Iphone/itouch)

Ffmpeg-y-I input.wmv-f mp4-async 1-s 480x320-acodec libfaac-vcodec libxvid-qscale 7-dts_delta_threshold 1 output.m P4
Ffmpeg-y-I Source_video.avi input-acodec libfaac-ab 128000-vcodec mpeg4-b 1200000-mbd 2-flags +4mv+trell-aic 2-c MP 2-subcmp 2-s 320x180-title X final_video.mp4 Mix a piece of audio with a video

Ffmpeg-i son.wav-i Video_origine.avi Video_finale.mpg converts a video to DVD format

Ffmpeg-i source_video.avi-target pal-dvd-ps 2000000000-aspect 16:9 finale_video.mpeg
Note: Target pal-dvd:output format PS 2000000000 maximum size for the Output file, in bits (here, 2 Gb) aspect 16:9: Widesc Reen convert a video to DivX

Ffmpeg-i video_origine.avi-s 320x240-vcodec msmpeg4v2 Video_finale.avi
Turn X images to a video sequence
Ffmpeg-f image2-i image%d.jpg Video.mpg
Note: This command would transform the images from the current directory (named Image1.jpg, image2.jpg, etc ...) to a File named Video.mpg.
Turn a video to X images
Ffmpeg-i Video.mpg image%d.jpg
Note: This command would generate the files named image1.jpg, Image2.jpg, ...
The following image formats are also AVAILABLES:PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI. Screen recording

Use FFmpeg video screen
Ffmpeg-vcodec mpeg4-b 1000-r 10-g 300-vd x11:0,0-s 1024x768 ~/test.avi
: where-VD x11:0,0 refers to the offset used by the recording for X=0 and y=0,-s 1024x768 The size of the recorded video is 1024x768. The recorded video file is Test.avi and will be saved to the user's home directory
If you only want to record an application window or a fixed area on the desktop, you can specify the offset position and the area size. You can use the Xwininfo-frame command to find the above parameters. Resize Video size

Ffmpeg-vcodec mpeg4-b 1000-r 10-g 300-i ~/test.avi-s 800x600 ~/test-800-600.avi
Note: The FFmpeg screen recording function can only be effective in a Linux environment. Video capture

Record live video of the camera and save it as a file
Ffmpeg-f video4linux-s 320*240-r 10-i/dev/video0 test.asf
For more information, refer to the discussion post at the FFmpeg Engineering Group Forum: Video capture of FFmpeg
Note: FFmpeg's video capture function can only be used in the Linux environment using ffmpeg suppressed H.264 video

Ffmpeg-threads 4-i input-r 29.97-vcodec libx264-s 480x272-flags +loop-cmp +chroma-deblockalpha 0-deblockbeta 0-c RF 24
-BT 256k-refs 1-coder 0-me umh-me_range 16-subq 5-partitions +parti4x4+parti8x8+partp8x8-g 250-keyint_min 25-leve L 30
-qmin 10-qmax 51-trellis 2-sc_threshold 40-i_qfactor 0.71-acodec libfaac-ab 128k-ar 48000-ac 2 OUTPUT
Note: Use this directive to compress the H.264 video file which is clearer and the file turns small
Use Vhook to add a watermark to a video use FFmpeg to get PCM data

Ffmpeg-i input.mpg-f s16le-ar 44100-acodec pcm_s16le OUTPUT.PCM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.