flowframes icon indicating copy to clipboard operation
flowframes copied to clipboard

Add AMD encoding option with ffmpeg (possible solution)

Open Bercraft opened this issue 3 years ago • 0 comments

Now the encoding is done only via or CPU or Nvidia GPU, i found a way to make possible for amd users to use thier gpu (maybe). Ffmpeg has the encoder for amd GPU is h264_amf and hevc_amf.

Thank you for your work.

The usable option are :

h264_amf AVOptions: -usage E..V.... Encoder Usage (from 0 to 3) (default transcoding) transcoding E..V.... Generic Transcoding ultralowlatency E..V.... lowlatency E..V.... webcam E..V.... Webcam -profile E..V.... Profile (from 66 to 257) (default main) main E..V.... high E..V.... constrained_baseline E..V.... constrained_high E..V.... -level E..V.... Profile Level (from 0 to 62) (default auto) auto E..V.... 1.0 E..V.... 1.1 E..V.... 1.2 E..V.... 1.3 E..V.... 2.0 E..V.... 2.1 E..V.... 2.2 E..V.... 3.0 E..V.... 3.1 E..V.... 3.2 E..V.... 4.0 E..V.... 4.1 E..V.... 4.2 E..V.... 5.0 E..V.... 5.1 E..V.... 5.2 E..V.... 6.0 E..V.... 6.1 E..V.... 6.2 E..V.... -quality E..V.... Quality Preference (from 0 to 2) (default speed) speed E..V.... Prefer Speed balanced E..V.... Balanced quality E..V.... Prefer Quality -rc E..V.... Rate Control Method (from -1 to 3) (default -1) cqp E..V.... Constant Quantization Parameter cbr E..V.... Constant Bitrate vbr_peak E..V.... Peak Contrained Variable Bitrate vbr_latency E..V.... Latency Constrained Variable Bitrate -enforce_hrd E..V.... Enforce HRD (default false) -filler_data E..V.... Filler Data Enable (default false) -vbaq E..V.... Enable VBAQ (default false) -frame_skipping E..V.... Rate Control Based Frame Skip (default false) -qp_i E..V.... Quantization Parameter for I-Frame (from -1 to 51) (default -1) -qp_p E..V.... Quantization Parameter for P-Frame (from -1 to 51) (default -1) -qp_b E..V.... Quantization Parameter for B-Frame (from -1 to 51) (default -1) -preanalysis E..V.... Pre-Analysis Mode (default false) -max_au_size E..V.... Maximum Access Unit Size for rate control (in bits) (from 0 to INT_MAX) (default 0) -header_spacing E..V.... Header Insertion Spacing (from -1 to 1000) (default -1) -bf_delta_qp E..V.... B-Picture Delta QP (from -10 to 10) (default 4) -bf_ref E..V.... Enable Reference to B-Frames (default true) -bf_ref_delta_qp E..V.... Reference B-Picture Delta QP (from -10 to 10) (default 4) -intra_refresh_mb E..V.... Intra Refresh MBs Number Per Slot in Macroblocks (from 0 to INT_MAX) (default 0) -coder E..V.... Coding Type (from 0 to 2) (default auto) auto E..V.... Automatic cavlc E..V.... Context Adaptive Variable-Length Coding cabac E..V.... Context Adaptive Binary Arithmetic Coding -me_half_pel E..V.... Enable ME Half Pixel (default true) -me_quarter_pel E..V.... Enable ME Quarter Pixel (default true) -aud E..V.... Inserts AU Delimiter NAL unit (default false) -log_to_dbg E..V.... Enable AMF logging to debug output (default false)


E..V.... Set the encoding usage (from 0 to 3) (default transcoding) transcoding E..V.... ultralowlatency E..V.... lowlatency E..V.... webcam E..V.... -profile E..V.... Set the profile (default main) (from 1 to 1) (default main) main E..V.... -profile_tier E..V.... Set the profile tier (default main) (from 0 to 1) (default main) main E..V.... high E..V.... -level E..V.... Set the encoding level (default auto) (from 0 to 186) (default auto) auto E..V.... 1.0 E..V.... 2.0 E..V.... 2.1 E..V.... 3.0 E..V.... 3.1 E..V.... 4.0 E..V.... 4.1 E..V.... 5.0 E..V.... 5.1 E..V.... 5.2 E..V.... 6.0 E..V.... 6.1 E..V.... 6.2 E..V.... -quality E..V.... Set the encoding quality (from 0 to 10) (default speed) balanced E..V.... speed E..V.... quality E..V.... -rc E..V.... Set the rate control mode (from -1 to 3) (default -1) cqp E..V.... Constant Quantization Parameter cbr E..V.... Constant Bitrate vbr_peak E..V.... Peak Contrained Variable Bitrate vbr_latency E..V.... Latency Constrained Variable Bitrate -header_insertion_mode E..V.... Set header insertion mode (from 0 to 2) (default none) none E..V.... gop E..V.... idr E..V.... -gops_per_idr E..V.... GOPs per IDR 0-no IDR will be inserted (from 0 to INT_MAX) (default 60) -preanalysis E..V.... Enable preanalysis (default false) -vbaq E..V.... Enable VBAQ (default false) -enforce_hrd E..V.... Enforce HRD (default false) -filler_data E..V.... Filler Data Enable (default false) -max_au_size E..V.... Maximum Access Unit Size for rate control (in bits) (from 0 to INT_MAX) (default 0) -min_qp_i E..V.... min quantization parameter for I-frame (from -1 to 51) (default -1) -max_qp_i E..V.... max quantization parameter for I-frame (from -1 to 51) (default -1) -min_qp_p E..V.... min quantization parameter for P-frame (from -1 to 51) (default -1) -max_qp_p E..V.... max quantization parameter for P-frame (from -1 to 51) (default -1) -qp_p E..V.... quantization parameter for P-frame (from -1 to 51) (default -1) -qp_i E..V.... quantization parameter for I-frame (from -1 to 51) (default -1) -skip_frame E..V.... Rate Control Based Frame Skip (default false) -me_half_pel E..V.... Enable ME Half Pixel (default true) -me_quarter_pel E..V.... Enable ME Quarter Pixel (default true) -aud E..V.... Inserts AU Delimiter NAL unit (default false) -log_to_dbg E..V.... Enable AMF logging to debug output (default false)

Ad exempla -> ffmpeg -i input.mkv -c:v hevc_amf -rc cqp -qp_p 0 -qp_i 0 -c:a copy output.mkv would be lossless

Bercraft avatar Feb 03 '23 09:02 Bercraft