USAGE.md
January 27, 2025 ยท View on GitHub
Automatic Thumbnail Generation
AlabamaEncoder will gather multiple statistics about each frame,
to then pick nine frames that will make the most appealing thumbnail.
Generated thumbnails will be saved in the same directory as [INPUT FILE]
Usage:
alabamaEncoder autothumbnailer [INPUT FILE] [flags]
Additional Thumbnail Generation Flags
| Parameter | Description |
|---|---|
--detect_faces | Detect faces in video |
Worker
Commands for interfacing with celery, the multi-system part of AlabamaEncoder
Start a worker:
alabamaEncoder worker [FLAGS]
Additional flags:
| Parameter | Description |
|---|---|
--workers int | Amount of multiprocess workers |
Clear the celery queue:
alabamaEncoder clear
Encoder
Encode video using AlabamaEncoder!
Usage:
alabamaEncoder encode [-h] [INPUT FILE] [OUTPUT FILE] [flags]
Encode flags
| Parameter | Description |
|---|---|
-h, --help | Show the help message and exit |
--dont_encode_audio | Do not mux audio |
--audio_params AUDIO_PARAMS | Audio params |
--celery | Encode on a Celery cluster, which is at localhost |
--autocrop | Automatically crop the video |
--video_filters VIDEO_FILTERS | Override the crop, put your vf ffmpeg filter there (e.g., scale=-2:1080:flags=lanczos,zscale=t=linear...) Make sure ffmpeg on all workers has support for the filters you use |
--bitrate BITRATE | Bitrate to use, auto for auto bitrate selection |
--overshoot BITRATE_OVERSHOOT | How much the vbr_perchunk_optimisation is allowed to overshoot |
--undershoot BITRATE_UNDERSHOOT | How much the vbr_perchunk_optimisation is allowed to undershoot |
--vbr_perchunk_optimisation | Enable automatic bitrate optimisation per chunk |
--multiprocess_workers MULTIPROCESS_WORKERS | Number of workers to use for multiprocessing, if -1 the program will auto-scale |
--ssim-db-target SSIM_DB_TARGET | What SSIM dB to target when using auto bitrate, not recommended to set manually, otherwise 21.2 is a good starting point |
--crf CRF | What CRF (Constant Rate Factor) to use (must be in range 0..=255) |
--encoder {X265,SVT_AV1,AOMENC,X264,VPX_VP9,VPX_VP8,VAAPI_H265,VAAPI_H264,RAV1E,NVENC_H264} | What encoder to use |
--grain GRAIN | Manually give the grainsynth value, 0 to disable, -1 for auto, -2 for auto per scene, -3 for new fast per scene grain |
--vmaf_target VMAF_TARGET | What VMAF (Video Multi-method Assessment Fusion) to target when using bitrate auto |
--max_scene_length MAX_SCENE_LENGTH | If a scene is longer than this, it will recursively cut it in the middle until each chunk is within the max |
--statically_sized_scenes | Instead of performing scene detection, do statically sized scenes at about 30 seconds |
--scene_merge | Merge scenes until they meet the max scene length |
--no_crf_based_vmaf_targeting | Per chunk, find a CRF that hits the target quality and encode using that |
--auto_crf | Find a CRF that hits the target VMAF, calculate a peak bitrate cap, and encode using that |
--chunk_order {random,sequential,length_desc,length_asc,reverse,even} | Encode chunks in a specific order |
--start_offset START_OFFSET | Offset from the beginning of the video (in seconds), useful for cutting intros, etc. |
--end_offset END_OFFSET | Offset from the end of the video (in seconds), useful for cutting end credits, outtros, etc. |
--bitrate_adjust_mode {chunk,global} | Do a complexity analysis on each chunk individually and adjust bitrate based on that (can overshoot/undershoot a lot), or do complexity analysis on all chunks ahead of time and budget it to hit the target by normalizing the bitrate |
--log_level LOG_LEVEL | Set the log level, 0 for silent, 1 for verbose |
--generate_previews, -previews | Do not generate previews for the encoded file |
--generate_stats, -stats | Generate stats for the encoded file |
--override_bad_wrong_cache_path | Override the check for input file path matching in scene cache loading |
--hdr | Encode in HDR, if not specified and input is HDR, it will automatically tonemap |
--crop_string CROP_STRING | Crop string to use (e.g., 1920:1080:0:0, 3840:1600:0:280). Obtained using the cropdetect ffmpeg filter |
--scale_string SCALE_STRING | Scale string to use (e.g., 1920:1080, 1280:-2, 1920:1080:force_original_aspect_ratio=decrease) |
--dry_run | Do not encode, just print what would be done |
--title TITLE | Title of the video |
--encoder_flag_override ENCODER_FLAG_OVERRIDE | Override the encoder flags with this string, write all params except paths |
--encoder_speed_override ENCODER_SPEED_OVERRIDE | Override the encoder speed parameter (must be in range 0..=10) |
--crf_map STRING | Map of CRF <-> chunk index, for debugging purposes only |
--color-primaries COLOR_PRIMARIES | Color primaries |
--transfer-characteristics TRANSFER_CHARACTERISTICS | Transfer characteristics |
--matrix-coefficients MATRIX_COEFFICIENTS | Matrix coefficients |
--maximum_content_light_level MAXIMUM_CONTENT_LIGHT_LEVEL | Maximum content light level |
--frame-average-light FRAME_AVERAGE_LIGHT | Maximum frame average light level |
--chroma-sample-position CHROMA_SAMPLE_POSITION | Chroma sample position |
--sub_file SUB_FILE | Subtitles file (e.g., .srt or .vvt) |
--vmaf_phone_model | Use VMAF phone model for auto CRF tuning |
--vmaf_4k_model | Use VMAF 4K model for auto CRF tuning |
--vmaf_no_motion | Use VMAF no motion model for auto CRF tuning |
--auto_accept_autocrop | Automatically accept autocrop |
--resolution_preset RESOLUTION_PRESET | Preset for the scale filter, possible choices are 4K, 1440p, 1080p, 768p, 720p, 540p, 480p, 360p |
--probe_count PROBE_COUNT | Max number of probes for metric targeting, higher is more accurate but slower (must be in range 1..=10) |
--vmaf_probe_speed VMAF_PROBE_SPEED | Override the speed for target VMAF probes (must be in range 0..=10) |
--vmaf_reference_display {HD,FHD,UHD} | HD, FHD, or UHD |
--vmaf_ai_assisted_targeting | Use VMAF AI-assisted targeting |
--vmaf_target_repesentation {mean,min,max,harmonic_mean,percentile_1,percentile_5,percentile_10,percentile_25,percentile_50} | VMAF target representation, default is mean |
--simple_denoise | Use atadenoise on input, useful for x26 encoding with very noisy inputs and target VMAF, to be automated in the future |
--dont_pin_to_cores | Do not pin each chunk to a core |
--niceness NICENESS | Nice the encoder process |
--print_analysis_logs | Print content analysis logs into the console, like what CRF did VMAF target pick, etc. |
--poster_url POSTER_URL | URL of poster for website updates |
--offload_server OFFLOAD_SERVER | If filled with a server address, will try to send a serialized job to that server |
--metric_to_target {vmaf,ssimu2} | Uses all the VMAF target logic but a different metric |
--dynamic_vmaf_target | Target VMAF and weight it against the bitrate, useful for lossy sources that trick VMAF into low scores |
--dynamic_vmaf_target_vbr | VMAF targeting but instead of tuning CRF, it tunes the bitrate and uses variable bitrate encoding |
--tune {fidelity,appeal,balanced} | Tune the encoder setting for a specific use case |
--denoise_vmaf_ref | Denoise the VMAF reference |
--calc_final_vmaf | Calculate final VMAF of a chunk and save it in chunks.log |
--multi_res_pipeline | Create an optimized multi-bitrate tier stream |
--throughput_scaling | Scale the multi-process workers based on throughput |
This list will be updated as new features & flags are added.