USAGE.md

January 27, 2025 ยท View on GitHub

TOP-LEVEL

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

ParameterDescription
--detect_facesDetect faces in video

Worker

Commands for interfacing with celery, the multi-system part of AlabamaEncoder

Start a worker:

alabamaEncoder worker [FLAGS]

Additional flags:

ParameterDescription
--workers intAmount 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

ParameterDescription
-h, --helpShow the help message and exit
--dont_encode_audioDo not mux audio
--audio_params AUDIO_PARAMSAudio params
--celeryEncode on a Celery cluster, which is at localhost
--autocropAutomatically crop the video
--video_filters VIDEO_FILTERSOverride 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 BITRATEBitrate to use, auto for auto bitrate selection
--overshoot BITRATE_OVERSHOOTHow much the vbr_perchunk_optimisation is allowed to overshoot
--undershoot BITRATE_UNDERSHOOTHow much the vbr_perchunk_optimisation is allowed to undershoot
--vbr_perchunk_optimisationEnable automatic bitrate optimisation per chunk
--multiprocess_workers MULTIPROCESS_WORKERSNumber of workers to use for multiprocessing, if -1 the program will auto-scale
--ssim-db-target SSIM_DB_TARGETWhat SSIM dB to target when using auto bitrate, not recommended to set manually, otherwise 21.2 is a good starting point
--crf CRFWhat 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 GRAINManually 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_TARGETWhat VMAF (Video Multi-method Assessment Fusion) to target when using bitrate auto
--max_scene_length MAX_SCENE_LENGTHIf a scene is longer than this, it will recursively cut it in the middle until each chunk is within the max
--statically_sized_scenesInstead of performing scene detection, do statically sized scenes at about 30 seconds
--scene_mergeMerge scenes until they meet the max scene length
--no_crf_based_vmaf_targetingPer chunk, find a CRF that hits the target quality and encode using that
--auto_crfFind 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_OFFSETOffset from the beginning of the video (in seconds), useful for cutting intros, etc.
--end_offset END_OFFSETOffset 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_LEVELSet the log level, 0 for silent, 1 for verbose
--generate_previews, -previewsDo not generate previews for the encoded file
--generate_stats, -statsGenerate stats for the encoded file
--override_bad_wrong_cache_pathOverride the check for input file path matching in scene cache loading
--hdrEncode in HDR, if not specified and input is HDR, it will automatically tonemap
--crop_string CROP_STRINGCrop string to use (e.g., 1920:1080:0:0, 3840:1600:0:280). Obtained using the cropdetect ffmpeg filter
--scale_string SCALE_STRINGScale string to use (e.g., 1920:1080, 1280:-2, 1920:1080:force_original_aspect_ratio=decrease)
--dry_runDo not encode, just print what would be done
--title TITLETitle of the video
--encoder_flag_override ENCODER_FLAG_OVERRIDEOverride the encoder flags with this string, write all params except paths
--encoder_speed_override ENCODER_SPEED_OVERRIDEOverride the encoder speed parameter (must be in range 0..=10)
--crf_map STRINGMap of CRF <-> chunk index, for debugging purposes only
--color-primaries COLOR_PRIMARIESColor primaries
--transfer-characteristics TRANSFER_CHARACTERISTICSTransfer characteristics
--matrix-coefficients MATRIX_COEFFICIENTSMatrix coefficients
--maximum_content_light_level MAXIMUM_CONTENT_LIGHT_LEVELMaximum content light level
--frame-average-light FRAME_AVERAGE_LIGHTMaximum frame average light level
--chroma-sample-position CHROMA_SAMPLE_POSITIONChroma sample position
--sub_file SUB_FILESubtitles file (e.g., .srt or .vvt)
--vmaf_phone_modelUse VMAF phone model for auto CRF tuning
--vmaf_4k_modelUse VMAF 4K model for auto CRF tuning
--vmaf_no_motionUse VMAF no motion model for auto CRF tuning
--auto_accept_autocropAutomatically accept autocrop
--resolution_preset RESOLUTION_PRESETPreset for the scale filter, possible choices are 4K, 1440p, 1080p, 768p, 720p, 540p, 480p, 360p
--probe_count PROBE_COUNTMax number of probes for metric targeting, higher is more accurate but slower (must be in range 1..=10)
--vmaf_probe_speed VMAF_PROBE_SPEEDOverride 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_targetingUse 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_denoiseUse atadenoise on input, useful for x26 encoding with very noisy inputs and target VMAF, to be automated in the future
--dont_pin_to_coresDo not pin each chunk to a core
--niceness NICENESSNice the encoder process
--print_analysis_logsPrint content analysis logs into the console, like what CRF did VMAF target pick, etc.
--poster_url POSTER_URLURL of poster for website updates
--offload_server OFFLOAD_SERVERIf 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_targetTarget VMAF and weight it against the bitrate, useful for lossy sources that trick VMAF into low scores
--dynamic_vmaf_target_vbrVMAF 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_refDenoise the VMAF reference
--calc_final_vmafCalculate final VMAF of a chunk and save it in chunks.log
--multi_res_pipelineCreate an optimized multi-bitrate tier stream
--throughput_scalingScale the multi-process workers based on throughput

This list will be updated as new features & flags are added.