ffmpeg Chinese parameter description and usage examples

ffmpeg Chinese parameter description and usage examples

1. When ffmpeg pushes video files, the encoding formats of audio and video can only be H264 and AAC.

ffmpeg -re -i "E:\片源\Avengers 720p.mov" -vcodec copy -acodec copy -f flv rtmp://192.168.11.75/live/test1
ffmpeg -re -i "E:\片源\Avengers 720p.mov" -vcodec copy -acodec copy -f flv rtmpt://192.168.11.75:8080/live/test1

2. IP camera rtsp streaming push rtmp live broadcast (but there is packet loss, please give more advice)

ffmpeg -i rtsp://ip address/original -crf 30 -preset ultrafast -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -r 25 -b:v 500k -s 640*480 -f flv rtmp://ip address/live/stram

ffmpeg parameter description:

Basic options:
-formats Export to all available formats
-f fmt Specify the format (audio or video format)
-i filename Specify the input file name. In Linux, you can also specify: 0.0 (screen recording) or camera
-y Overwrite existing files
-t duration The recording time is t
-fs limit_size Set a maximum file size
-ss time_off Starting from the specified time(s), the format of [-]hh:mm:ss[.xxx] is also supported
-itsoffset time_off Set the time offset (s). This option affects all subsequent input files. The offset is added to the input file's timestamp, defining a positive offset means that the corresponding stream is delayed by offset seconds. [-]hh:mm:ss[.xxx] format is also supported
-title string title
-timestamp time Timestamp
-author string author
-copyright string Copyright Information
-comment string Comment
-album string album name
-v verbose Log related
-target type Set the target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)
-dframes number Set the number of frames to record
Video Options:
-b Specify the bit rate (bits/s). It seems that ffmpeg is automatically VBR. If you specify it, it will be the average bit rate.
-bitexact Use standard bitrate
-vb Specify the video bit rate (bits/s)
-vframes number Set the number of frames of video to convert
-r rate Frame rate (fps) (can be changed, but non-standard frame rates will cause audio and video to be out of sync, so it can only be set to 15 or 29.97)
-s size Specify resolution (320x240)
-aspect aspect Set video aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-croptop size Set the top cutoff size (in pixels)
-cropbottom size Set bottom cutoff size (in pixels)
-cropleft size Set the left cutoff size (in pixels)
-cropright size Set the right cutoff size (in pixels)
-padtop size Set the top padding size (in pixels)
-padbottom size Bottom padding (in pixels)
-padleft size Left padding (in pixels)
-padright size Right padding (in pixels)
-padcolor color Fill in the color (000000-FFFFFF)
-vn Cancel Video
-vcodec codec Force the use of codec encoding and decoding mode ('copy' to copy stream)
-sameq Use the same video quality as source (VBR)
-pass n Select the number of passes (1 or 2). Two-pass encoding is very useful. The first pass generates statistics, the second pass generates the exact requested bitrate
-passlogfile file Select the two recorded files named file
-newvideo Add a new video stream after the current video stream
Advanced Video Options
-pix_fmt format set pixel format, 'list' as argument shows all the pixel formats supported
-intra Only available for intraframe coding
-qscale q VBR based on <value> quality, 0.01-255, lower quality is better
-loop_input Set the number of loops for the input stream (currently only valid for images)
-loop_output Set the number of loops for the output video. For example, when outputting GIF, set it to 0 for infinite loops.
-g int Set the group of images size
-cutoff int Set the cutoff frequency
-qmin int Set minimum quality, used together with -qmax (set maximum quality), e.g. -qmin 10 -qmax 31
-qmax int Set Maximum Quality
-qdiff int Maximum deviation between quantizer scales (VBR)
-bf int Use frames B frame, support mpeg1, mpeg2, mpeg4
Audio Options:
-ab Set the bit rate (unit: bit/s, maybe kb/s in the old version). When -ac is set to stereo, set it to half the bit rate, for example, 192kbps is set to 96. The default bit rate for conversion is relatively small. If you want to hear higher quality sound, it is recommended to set it to above 160kbps (80).
-aframes number Set the number of frames of audio to convert
-aq quality Set audio quality (specify encoding)
-ar rate Set the audio sampling rate (unit: Hz), PSP only recognizes 24000
-ac channels Set the number of channels, 1 is mono, 2 is stereo. To convert a mono TVrip, you can use 1 (saving half the capacity), and a high-quality DVDrip can use 2.
-an Cancel Audio
-acodec codec Specify audio encoding ('copy' to copy stream)
-vol volume Set the recording volume (default is 256) <percentage>. Some DVDrip AC3 tracks have very low volume. You can use this to increase the volume when converting. For example, 200 means twice the original volume.
-newaudio Add a new audio stream after the current audio stream
Subtitle options:
-sn Cancel subtitles
-scodec codec Set subtitle encoding ('copy' to copy stream)
-newsubtitle Add after the current subtitle
-slang code Sets the ISO 639 code used for subtitles (3 letters)
Audio/Video Capture Options:
-vc channel Set the video capture channel (DV1394 only)
-tvstd standard set up

Convert to flv:
ffmpeg -i test.mp3 -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 test.flv
ffmpeg -i test.wmv -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 test.flv

Convert the file format and capture the thumbnail at the same time:
ffmpeg -i "test.avi" -y -f image2 -ss 8 -t 0.001 -s 350x240 'test.jpg'

To capture an existing flv:
ffmpeg -i "test.flv" -y -f image2 -ss 8 -t 0.001 -s 350x240 'test.jpg'

Convert to 3gp:
ffmpeg -y -i test.mpeg -bitexact -vcodec h263 -b 128 -r 15 -s 176x144 -acodec aac -ac 2 -ar 22500 -ab 24 -f 3gp test.3gp
ffmpeg -y -i test.mpeg -ac 1 -acodec amr_nb -ar 8000 -s 176x144 -b 128 -r 15 test.3gp

The above is the ffmpeg Chinese parameter description and usage examples. For more related articles, please click the following related links

You may also be interested in:
  • Code for getting flv video thumbnail and video time using Ffmpeg
  • Detailed explanation of the process of building a streaming media server using nginx and ffmpeg
  • Detailed tutorial on compiling FFmpeg decoding library for Android Studio under Mac OS
  • Detailed description of ffmpeg Chinese parameters
  • Graphic tutorial on installing FFmpeg on MAC
  • Sample code for converting video using ffmpeg command line

<<:  Solution to the problem that the number of MySQL connections is limited to 214 in CentOS 7

>>:  Detailed explanation of modifying the default style of external component Vant based on Vue cli development

Recommend

In-depth explanation of the impact of NULL on indexes in MySQL

Preface I have read many blogs and heard many peo...

Summary of common problems and solutions in Vue (recommended)

There are some issues that are not limited to Vue...

How to understand JavaScript modularity

Table of contents 1. Browser support 2. export ex...

Understanding innerHTML

<br />Related articles: innerHTML HTML DOM i...

Solution to the problem that the Vue page image does not display

When making a new version of the configuration in...

A brief discussion on Yahoo's 35 rules for front-end optimization

Abstract: Whether at work or in an interview, opt...

Practice of multi-layer nested display of element table

There is a requirement for a list containing mult...

Summary of MySQL's commonly used concatenation statements

Preface: In MySQL, the CONCAT() function is used ...

Windows 2016 Server Security Settings

Table of contents System update configuration Cha...

How to use Flex layout to achieve scrolling of fixed content area in the head

The fixed layout of the page header was previousl...

How to block IP and IP range in Nginx

Written in front Nginx is not just a reverse prox...

How to convert Chinese into UTF-8 in HTML

In HTML, the Chinese phrase “學好好學” can be express...

MySql learning day03: connection and query details between data tables

Primary Key: Keyword: primary key Features: canno...

Solve the problem that ElementUI custom CSS style does not take effect

For example, there is an input box <el-input r...

In-depth explanation of Set and WeakSet collections in ES6

Table of contents Set is a special collection who...