You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Video2X uses FFmpeg's C libraries to encode videos. Encoder options are specified in two ways:
54
+
55
+
-**Common options** shared by all encoders are stored in a [`AVCodecContext`](https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html) struct. Below are some options set through `AVCodecContext`:
56
+
- Codec
57
+
- Pixel format
58
+
- Bitrate
59
+
- Keyframe interval
60
+
- Minimum and maximum quantizer
61
+
- GOP size
62
+
-**Encoder-specific** options are stored in [`AVOption`](https://ffmpeg.org/doxygen/trunk/structAVOption.html) structs and set with the [`av_opt_set`](https://ffmpeg.org/doxygen/trunk/group__opt__set__funcs.html#ga5fd4b92bdf4f392a2847f711676a7537) function. Below are some encoder-specific options for `libx264`:
63
+
- CRF
64
+
- Preset
65
+
- Tune
66
+
- Profile
67
+
68
+
Common options can only be set through Video2X's command line arguments. You can run `video2x --help` and see the `Encoder options` section to see the supported options.
69
+
70
+
You can specify encoder-specific options in Video2X using the `--extra-encoder-option` (`-e`) argument. To view the available options for a particular codec, run:
71
+
72
+
```bash
73
+
ffmpeg -h encoder=$ENCODER
74
+
```
75
+
76
+
For example, to view the available options for `libx264`, run:
-crf <float> E..V....... Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1)
95
+
-crf_max <float> E..V....... In CRF mode, prevents VBV from lowering quality beyond this point. (from -1 to FLT_MAX) (default -1)
96
+
-qp <int> E..V....... Constant quantization parameter rate control method (from -1 to INT_MAX) (default -1)
97
+
...
98
+
```
99
+
100
+
You can then set the encoder-specific options with the `-e` argument. The `-e` argument can be used multiple times to set multiple options. For example, the following arguments set the CRF to 17, the preset to `veryslow`, and the tune to `film` for `libx264`:
0 commit comments