AdditionallyI-frames can be classified as IDR frames and non-IDR frames. The difference is that frames following an IDR frame cannot reference any frame that comes before the IDR frame, while in the case of a non-IDR frame there are no limitations.
Every GOP starts with an I-frame, also called a keyframe, but may contain more than one. To create further confusion, a GOP can start with an IDR frame or with a non-IDR frame. This means that frames in the GOP can sometimes refer to previous GOPs (in this case the GOP is said to be "open"), and sometimes not (in this case it's closed).
Most video encoders apply temporal compression i.e. most frames only store the difference in image content relative to other frames, thus saving storage space, while a few frames store the whole image. The frames with whole pictures are called key frames since they are required in order to reconstruct the whole picture of frames which only store differences. IDR frame in H264 stream denotes a keyframe.
min-keyint=24 sets the minimum keyframe distance. The encoder may decide to place a keyframe on its own even if keyint # of frames haven't elapsed if it comes across an image which is more efficient to store as a complete picture rather than as a set of differences. min-keyint tells the encoder to never do this if the distance isn't at least 24. Since in this case keyint is the same value as min-keyint, all KFs will be 24 frames apart.
no-scenecut - scenecut is the value used by the encoder to calculate if it should force a keyframe if min-keyint allows it to. It can range from 0-100. no-scenecut tells the encoder to skip this evaluation.
This is a follow-up question from my previous question posted HERE. So basically using FFmpeg, I'm trying to detect scenes after choosing a good scenecut threshold, and grab a single representative frame out of each scene.
My eventual goal is to identify the scenes, and only save a single frame out of that scene as an image (say middle frame of that scene) instead of encoding and saving the whole scene videos. Is there a fast way to achieve that?
If there is an extra command line argument (not an option or an optionvalue) the CLI will treat it as the input filename. This effectivelymakes the --input specifier optional for the input file. Ifthere are two extra arguments, the second is treated as the outputbitstream filename, making --output also optional if the inputfilename was implied. This makes x265 in.y4m out.hevc a validcommand line. If there are more than two extra arguments, the CLI willconsider this an error and abort.
I/P cost ratio: The ratio between the cost when a frame is decided as anI frame to that when it is decided as a P frame as computed from thequarter-resolution frame in look-ahead. This, in combination with other parameterssuch as position of the frame in the GOP, is used to decide scene transitions.
DecideWait ms number of milliseconds the frame encoder had towait, since the previous frame was retrieved by the API thread,before a new frame has been given to it. This is the latencyintroduced by slicetype decisions (lookahead).
Row0Wait ms number of milliseconds since the frame encoderreceived a frame to encode before its first row of CTUs is allowedto begin compression. This is the latency introduced by referenceframes making reconstructed and filtered rows available.
Avg WPP the average number of worker threads working on thisframe, at any given time. This value is sampled at the completion ofeach CTU. This shows the effectiveness of Wavefront ParallelProcessing.
Row Blocks the number of times a worker thread had to abandonthe row of CTUs it was encoding because the row above it was not farenough ahead for the necessary reference data to be available. Thisis more of a problem for P frames where some blocks are much moreexpensive than others.
Number of concurrently encoded frames. Using a single frame threadgives a slight improvement in compression, since the entire referenceframes are always available for motion compensation, but it hassevere performance implications. Default is an autodetected countbased on the number of CPU cores and whether WPP is enabled or not.
Frame encoders are distributed between the available thread pools,and the encoder will never generate more thread pools than--frame-threads. The pools are used for WPP and fordistributed analysis and motion search.
On Windows, the native APIs offer sufficient functionality todiscover the NUMA topology and enforce the thread affinity thatlibx265 needs (so long as you have not chosen to target XP orVista), but on POSIX systems it relies on libnuma for thisfunctionality. If your target POSIX system is single socket, thenbuilding without libnuma is a perfectly reasonable option, as itwill have no effect on the runtime behavior. On a multiple-socketsystem, a POSIX build of libx265 without libnuma will be less workefficient. See thread pools for more detail.
Enable Wavefront Parallel Processing. The encoder may begin encodinga row as soon as the row above it is at least two CTUs ahead in theencode process. This gives a 3-5x gain in parallelism for about 1%overhead in compression efficiency.
Sets parameters to preselected values, trading off compression efficiency againstencoding speed. These parameters are applied before all other input parameters areapplied, and so you can override any parameters that these values control. Seepresets for more detail.
These options all describe the input video sequence or, in the case of--dither, operations that are performed on the sequence priorto encode. All options dealing with files (names, formats, offsets orframe counts) are only applicable to the CLI application.
The number of frames intended to be encoded. It may be leftunspecified, but when it is specified rate control can make use ofthis information. It is also used to determine if an encode isactually a stillpicture profile encode (single frame)
HEVC encodes interlaced content as fields. Fields must be provided tothe encoder in the correct temporal order. The source dimensionsmust be field dimensions and the FPS must be in units of fields persecond. The decoder must re-combine the fields in their correctorientation for display.
Bitdepth of output HEVC bitstream, which is also the internal bitdepth of the encoder. If the requested bit depth is not the bitdepth of the linked libx265, it will attempt to bind libx265_mainfor an 8bit encoder, libx265_main10 for a 10bit encoder, orlibx265_main12 for a 12bit encoder, with the same API version as thelinked libx265.
First frame of the chunk. Frames preceding this in display order willbe encoded, however, they will be discarded in the bitstream. Thisfeature can be enabled only in closed GOP structures.Default 0 (disabled).
Last frame of the chunk. Frames following this in display order will beused in taking lookahead decisions, but they will not be encoded.This feature can be enabled only in closed GOP structures.Default 0 (disabled).
Enforce the requirements of the specified profile, ensuring theoutput stream will be decodable by a decoder which supports thatprofile. May abort the encode if the specified profile isimpossible to be supported by the compile options chosen for theencoder (a high bit depth encoder will be unable to outputbitstreams compliant with Main or MainStillPicture).
Minimum decoder requirement level. Defaults to 0, which impliesauto-detection by the encoder. If specified, the encoder willattempt to bring the encode specifications within that specifiedlevel. If the encoder is unable to reach the level it issues awarning and aborts the encode. If the requested requirement level ishigher than the actual level, the actual requirement level issignaled.
Max number of L0 references to be allowed. This number has a linearmultiplier effect on the amount of work performed in motion searchbut will generally have a beneficial effect on compression anddistortion.
Note that x265 allows up to 16 L0 references but the HEVCspecification only allows a maximum of 8 total reference frames. Soif you have B frames enabled only 7 L0 refs are valid and if youhave --b-pyramid enabled (which is enabled by default inall presets), then only 6 L0 refs are the maximum allowed by theHEVC specification. If x265 detects that the total reference countis greater than 8, it will issue a warning that the resulting streamis non-compliant and it signals the stream as profile NONE and levelNONE and will abort the encode unless--allow-non-conformance it specified. Compliant HEVCdecoders may refuse to decode such streams.
Allow libx265 to generate a bitstream with profile and level NONE.By default, it will abort any encode which does not meet strict levelcompliance. The two most likely causes for non-conformance are--ctu being too small, --ref being too high,or the bitrate or resolution being out of specification.
Enable Ultra HD Blu-ray format support. If specified with incompatibleencoding options, the encoder will attempt to modify/set the rightencode specifications. If the encoder is unable to do so, this optionwill be turned OFF. Highly experimental.
--profile, --level-idc, and--high-tier are only intended for use when you aretargeting a particular decoder (or decoders) with fixed resourcelimitations and must constrain the bitstream within those limits.Specifying a profile or level may lower the encode qualityparameters to meet those requirements but it will never raisethem. It may enable VBV constraints on a CRF encode.
Also note that x265 determines the decoder requirement profile andlevel in three steps. First, the user configures an x265_paramstructure with their suggested encoder options and then optionallycalls x265_param_apply_profile() to enforce a specific profile(main, main10, etc). Second, an encoder is created from thisx265_param instance and the --level-idc and--high-tier parameters are used to reduce bitrate or otherfeatures in order to enforce the target level. Finally, the encoderre-examines the final set of parameters and detects the actualminimum decoder requirement level and this is what is signaled inthe bitstream headers. The detected decoder level will only use Hightier if the user specified a High tier level.
3a8082e126