Subsections

- - cin_pix_fmt
  - cin_bitrate
  - cin_quality
  - cin_stats_filename
  - cin_sample_fmt
  - Private Options

##
Extra “cin_” Options for Render with FFmpeg

There are several special parameters that can be used in the ffmpeg options file to pass values to the codecs that are not normally available. They're called Global Options. These are explained below.

#### cin_pix_fmt

The Render menus allows you to choose the codec input pixel format (figure 7.4). The Pixels selection provides the available pixel format options for the chosen codec type; valid choices vary for the different file types. This list represents the formats that the codec advertises. It is not always complete, and it may include options that are not legal with all parameter configurations.

Figure 7.4: Render & Video Preset menus displaying Pixel choices

- The Bitrate, Quality, and Pixels fields are only updated when the Video Options are reloaded. This occurs when you either change the ffmpeg file format, or video presets compression fields.
- If the video options preset has cin_pix_fmt defined, its value will be loaded as the default. If you override the default, the value you specify will be used.
- If the video options preset does not have cin_pix_fmt, the default pixel format will be computed by ffmpeg (avcodec_find_best_pix_fmt_of_list), using the session format as the source choice. The best is usually the format which is most similar in color and depth.
- If no choices are available, yuv420p for video will be used.
- You can also specify ffmpeg pixel formats which are not in the list. The list is provided by ffmpeg as input selection, but is more like suggestions than fact. For example, the raw formats can take almost any format, but the rawvideo codec actually specifies no legal formats. Note that if you want a very specific Bitrate you must make sure there is not conflicting parameter values set such as Quality or CRF.

Some option files provide cin_pix_fmt to suggest a choice for good quality output or to prevent parameter errors when the other provided parameters conflict with the best pixel format. This is the case in faststart_h264.mp4 where the profile=high parameter dictates pixel format must be yuv420p.

#### cin_bitrate

If you specify the bitrate, you can not specify the quality or CRF.
Example: cin_bitrate=2000000

#### cin_quality

If you specify the quality, you can not specify the bitrate.
Example: cin_quality=7

#### cin_stats_filename

This parameter is useful for 2 pass operations.
Example: cin_stats_filename /tmp/cin_video_vp9_webm

#### cin_sample_fmt

For audio the preset sample format default is computed in a similar way as stated above for video or can be set with the cin_sample_fmt parameter (figure 7.5). If no choices are provided, s16 will be used.
Example: cin_sample_fmt=s16

Figure 7.5: Render menu showing where Samples is

#### Private Options

(muxers). In the window of the wrench in addition to the View button, which allows more global options and changes to the formats, there is an additional Format button that allows you to modify the Private Options, i.e. relating to specific muxing formats. You can list private options available in a encoder with:

    	$ /path/to/cin/thirdparty/ffmpeg-X.Y/ffmpeg -h encoder='libcodec' (i.e. libx265)

More information on all these options can be found at ffmpeg.org sections 19 and 21. See also Modifying FFmpeg Format Options inside CINELERRA-GG.

Render presets in CINELERRA-GG should work Out Of the Box. You can still configure the Global Options and Private Options manually. Finding the combination of parameters that best suits your needs, or simply finding working (legal) combinations, requires studying each codec in depth. You can start by looking in Wikipedia until you get to download and study the white papers of the codecs of interest. In any case, you must then start a long experimental phase, trying presets with different configurations or creating new ones, until you get satisfactory results. If you create new presets it is a good idea to make them known on the mailing list (`https://lists.cinelerra-gg.org/mailman/listinfo/cin`) or on the MantisBT Bug Tracker (`https://www.cinelerra-gg.org/bugtracker/my_view_page.php`) so that they can be integrated into subsequent versions of CINELERRA-GG. For an introduction see Overview on Formats and Codecs.