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

Use mysql to record the http GET request data returned from the url

Business scenario requirements and implementation...

What is the use of the enctype field when uploading files?

The enctype attribute of the FORM element specifie...

MySQL 5.7 installation-free configuration graphic tutorial

Mysql is a popular and easy-to-use database softw...

Simple web design concept color matching

(I) Basic concepts of web page color matching (1) ...

Detailed explanation of common methods of Vue development

Table of contents $nextTick() $forceUpdate() $set...

Install MySQL 5.7 on Ubuntu 18.04

This article is compiled with reference to the My...

Methods and techniques for designing an interesting website (picture)

Have you ever encountered a situation where we hav...

HTML page native VIDEO tag hides the download button function

When writing a web project, I encountered an intr...

How to build SFTP server and image server on Linux cloud server

First of all, you can understand the difference b...

mysql8.0.11 winx64 manual installation and configuration tutorial

First of all, let me talk to you about my daily l...

About 3 common packages of rem adaptation

Preface I wrote an article about rem adaptation b...

Detailed explanation of CocosCreator message distribution mechanism

Overview This article begins to introduce content...

Various types of MySQL indexes

What is an index? An index is a data structure th...

In-depth explanation of MySQL isolation level and locking mechanism

Table of contents Brief description: 1. Four char...