You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

咨询将HandBrake预设转换为FFmpeg预设的可靠方法

咨询将HandBrake预设转换为FFmpeg预设的可靠方法

Hey there, let's break down your HandBrake presets into equivalent FFmpeg commands step by step. I’ve mapped every key setting from your presets to FFmpeg’s command-line flags so you can replicate the exact behavior without guesswork.


Preset 1: PS4 English (GPU) (MP4 Output)

This preset targets PS4 compatibility with GPU-accelerated H.265 encoding and optimized MP4 streaming. Here’s the matching FFmpeg command:

ffmpeg -i input_file \
  -map 0:v -map 0:a -map_chapters 0 \
  -vf "crop=iw:ih-556:0:278,decomb" \
  -c:v hevc_nvenc -preset medium -level 4.1 -crf 30 \
  -c:a copy -c:a:0 ac3 -b:a:0 160k \
  -f mp4 -movflags +faststart \
  output_file.mp4

Key Setting Mappings:

  • Track/Chapter Handling: -map 0:v -map 0:a -map_chapters 0 preserves all video/audio tracks and chapters (matches ChapterMarkers: true and AudioTrackSelectionBehavior: all).
  • Cropping & Deinterlacing: -vf "crop=iw:ih-556:0:278,decomb" auto-crops 278px from the top/bottom of your input (matches PictureAutoCrop: true with fixed top/bottom values) and applies the decomb filter to remove interlacing (matches PictureDeinterlaceFilter: decomb).
  • Video Encoding: -c:v hevc_nvenc -preset medium -level 4.1 -crf 30 uses NVIDIA GPU-accelerated H.265 encoding with a medium speed/quality preset, Level 4.1 compatibility, and CRF 30 quality control (matches VideoEncoder: nvenc_h265, VideoPreset: medium, VideoLevel: 4.1, and VideoQualitySlider: 30.0).
  • Audio Handling: -c:a copy -c:a:0 ac3 -b:a:0 160k copies compatible audio tracks first, then falls back to AC3 encoding at 160kbps if copying isn’t possible (matches AudioEncoder: copy and AudioEncoderFallback: ac3).
  • Container Optimization: -f mp4 -movflags +faststart outputs an MP4 file optimized for HTTP streaming (matches FileFormat: av_mp4 and Mp4HttpOptimize: true).

Preset 2: Movies (MKV Output)

This preset focuses on retaining all media tracks (including subtitles) with GPU-accelerated H.265 encoding in an MKV container. Here’s the matching FFmpeg command:

ffmpeg -i input_file \
  -map 0:v -map 0:a -map 0:s -map_chapters 0 \
  -vf "crop=iw:ih-556:0:278,decomb" \
  -c:v hevc_nvenc -preset medium -level 4.0 -crf 30 \
  -c:a copy -c:a:0 ac3 -b:a:0 160k \
  -c:s copy \
  -f matroska \
  output_file.mkv

Key Differences from the PS4 Preset:

  • Subtitle Handling: -map 0:s -c:s copy preserves all subtitle tracks and copies them directly (matches SubtitleTrackSelectionBehavior: all).
  • Video Level: -level 4.0 sets the H.265 Level to 4.0 instead of 4.1 (matches VideoLevel: 4.0).
  • Container: -f matroska outputs an MKV file instead of MP4 (matches FileFormat: av_mkv).

Quick Notes:

  • The crop filter crop=iw:ih-556:0:278 is dynamic—it uses the input’s original width (iw) and height (ih) to apply the 278px top/bottom crop, so it works regardless of your source video’s resolution (aligns with PictureKeepRatio: true).
  • FFmpeg defaults to variable frame rate (VFR) matching your source, so no extra flag is needed for VideoFramerateMode: vfr.
  • If you need to tweak deinterlacing settings, you can add parameters to the decomb filter (e.g., decomb=preset=default to match HandBrake’s default decomb behavior).

备注:内容来源于stack exchange,提问作者Keitaro26

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 07:28:02