首页 > 其他分享 >FFmpeg Video Options

FFmpeg Video Options

时间:2024-11-10 10:45:50浏览次数:4  
标签:FFmpeg stream Video display video input output Options option

-vframes number (output)
Set the number of video frames to output. This is an obsolete alias for -frames:v, which you should use instead.

-r[:stream_specifier] fps (input/output,per-stream)
Set frame rate (Hz value, fraction or abbreviation).

As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps. This is not the same as the -framerate option used for some input formats like image2 or v4l2 (it used to be the same in older versions of FFmpeg). If in doubt use -framerate instead of the input option -r.

As an output option:

video encoding
Duplicate or drop frames right before encoding them to achieve constant output frame rate fps.

video streamcopy
Indicate to the muxer that fps is the stream frame rate. No data is dropped or duplicated in this case. This may produce invalid files if fps does not match the actual stream frame rate as determined by packet timestamps. See also the setts bitstream filter.

-fpsmax[:stream_specifier] fps (output,per-stream)
Set maximum frame rate (Hz value, fraction or abbreviation).

Clamps output frame rate when output framerate is auto-set and is higher than this value. Useful in batch processing or when input framerate is wrongly detected as very high. It cannot be set together with -r. It is ignored during streamcopy.

-s[:stream_specifier] size (input/output,per-stream)
Set frame size.

As an input option, this is a shortcut for the video_size private option, recognized by some demuxers for which the frame size is either not stored in the file or is configurable – e.g. raw video or video grabbers.

As an output option, this inserts the scale video filter to the end of the corresponding filtergraph. Please use the scale filter directly to insert it at the beginning or some other place.

The format is ‘wxh’ (default - same as source).

-aspect[:stream_specifier] aspect (output,per-stream)
Set the video display aspect ratio specified by aspect.

aspect can be a floating point number string, or a string of the form num:den, where num and den are the numerator and denominator of the aspect ratio. For example "4:3", "16:9", "1.3333", and "1.7777" are valid argument values.

If used together with -vcodec copy, it will affect the aspect ratio stored at container level, but not the aspect ratio stored in encoded frames, if it exists.

-display_rotation[:stream_specifier] rotation (input,per-stream)
Set video rotation metadata.

rotation is a decimal number specifying the amount in degree by which the video should be rotated counter-clockwise before being displayed.

This option overrides the rotation/display transform metadata stored in the file, if any. When the video is being transcoded (rather than copied) and -autorotate is enabled, the video will be rotated at the filtering stage. Otherwise, the metadata will be written into the output file if the muxer supports it.

If the -display_hflip and/or -display_vflip options are given, they are applied after the rotation specified by this option.

-display_hflip[:stream_specifier] (input,per-stream)
Set whether on display the image should be horizontally flipped.

See the -display_rotation option for more details.

-display_vflip[:stream_specifier] (input,per-stream)
Set whether on display the image should be vertically flipped.

See the -display_rotation option for more details.

-vn (input/output)
As an input option, blocks all video streams of a file from being filtered or being automatically selected or mapped for any output. See -discard option to disable streams individually.

As an output option, disables video recording i.e. automatic selection or mapping of any video stream. For full manual control see the -map option.

-vcodec codec (output)
Set the video codec. This is an alias for -codec:v.

-pass[:stream_specifier] n (output,per-stream)
Select the pass number (1 or 2). It is used to do two-pass video encoding. The statistics of the video are recorded in the first pass into a log file (see also the option -passlogfile), and in the second pass that log file is used to generate the video at the exact requested bitrate. On pass 1, you may just deactivate audio and set output to null, examples for Windows and Unix:

ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
-passlogfile[:stream_specifier] prefix (output,per-stream)
Set two-pass log file name prefix to prefix, the default file name prefix is “ffmpeg2pass”. The complete file name will be PREFIX-N.log, where N is a number specific to the output stream

-vf filtergraph (output)
Create the filtergraph specified by filtergraph and use it to filter the stream.

This is an alias for -filter:v, see the -filter option.

-autorotate
Automatically rotate the video according to file metadata. Enabled by default, use -noautorotate to disable it.

-autoscale
Automatically scale the video according to the resolution of first frame. Enabled by default, use -noautoscale to disable it. When autoscale is disabled, all output frames of filter graph might not be in the same resolution and may be inadequate for some encoder/muxer. Therefore, it is not recommended to disable it unless you really know what you are doing. Disable autoscale at your own risk.

https://www.octfgroup.com/

标签:FFmpeg,stream,Video,display,video,input,output,Options,option
From: https://www.cnblogs.com/sathcal/p/18537718

相关文章

  • ffmpeg Detailed description
    ffmpeg buildsatranscodingpipelineoutofthecomponentslistedbelow.Theprogram’soperationthenconsistsofinputdatachunksflowingfromthesourcesdownthepipestowardsthesinks,whilebeingtransformedbythecomponentstheyencounteralongt......
  • ffmpeg Streamcopy
    Thesimplestpipelinein ffmpeg issingle-stream streamcopy,thatiscopyingone inputelementarystream’spacketswithoutdecoding,filtering,orencodingthem.Asanexample,consideraninputfilecalled INPUT.mkv with3elementarystreams,fromwhi......
  • ffmpeg Trancoding
    Transcoding istheprocessofdecodingastreamandthenencodingitagain.Sinceencodingtendstobecomputationallyexpensiveandinmostcasesdegradesthestreamquality(i.e.itis lossy),youshouldonlytranscodewhenyouneedtoandperformstrea......
  • FFmpeg Filtering
    Whentranscoding,audioandvideostreamscanbefilteredbeforeencoding,witheitherasimpleorcomplexfiltergraph.3.3.1SimplefiltergraphsSimplefiltergraphsarethosethathaveexactlyoneinputandoutput,bothofthesametype(audioorvideo).......
  • FFmpeg Stream selection
    ffmpegprovidesthe-mapoptionformanualcontrolofstreamselectionineachoutputfile.Userscanskip-mapandletffmpegperformautomaticstreamselectionasdescribedbelow.The-vn/-an/-sn/-dnoptionscanbeusedtoskipinclusionofvideo,......
  • ffmpeg Synopsis
    1Synopsisffmpeg[global_options]{[input_file_options]-iinput_url}...{[output_file_options]output_url}...2Descriptionffmpegisauniversalmediaconverter.Itcanreadawidevarietyofinputs-includinglivegrabbing/recordingdevices-filter,......
  • About FFmpeg
    FFmpegistheleadingmultimediaframework,abletodecode,encode,transcode,mux,demux,stream,filterandplayprettymuchanythingthathumansandmachineshavecreated.Itsupportsthemostobscureancientformatsuptothecuttingedge.Nomatteri......
  • FFmpeg Libraries for developers
    libavutilisalibrarycontainingfunctionsforsimplifyingprogramming,includingrandomnumbergenerators,datastructures,mathematicsroutines,coremultimediautilities,andmuchmore.libavcodecisalibrarycontainingdecodersandencodersforaudio......
  • php使用ffmpeg实现向视频中添加文字字幕的方法
    这篇文章主要介绍了PHP使用ffmpeg给视频增加字幕显示的方法,实例分析了php操作ffmpeg给视频增加字母的技巧,具有一定参考借鉴价值,需要的朋友可以参考下。具体如下:$dir='./';if($handle=opendir($dir)){while(false!==($file=readdir($handle))){if(is_file($dir.$......
  • PHP中的FFmpeg安装及使用
    FFmpeg简介FFmpeg是视频处理最常用的开源软件。它功能强大,用途广泛,大量用于视频网站和商业软件(比如Youtube和iTunes),也是许多音频和视频格式的标准编码/解码实现。关于FFMPEG视音频编解码的知识可以参考大神雷霄骅的系列教程https://blog.csdn.net/leixiaohua1020/article/detai......