咨询将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 0preserves all video/audio tracks and chapters (matchesChapterMarkers: trueandAudioTrackSelectionBehavior: all). - Cropping & Deinterlacing:
-vf "crop=iw:ih-556:0:278,decomb"auto-crops 278px from the top/bottom of your input (matchesPictureAutoCrop: truewith fixed top/bottom values) and applies thedecombfilter to remove interlacing (matchesPictureDeinterlaceFilter: decomb). - Video Encoding:
-c:v hevc_nvenc -preset medium -level 4.1 -crf 30uses NVIDIA GPU-accelerated H.265 encoding with a medium speed/quality preset, Level 4.1 compatibility, and CRF 30 quality control (matchesVideoEncoder: nvenc_h265,VideoPreset: medium,VideoLevel: 4.1, andVideoQualitySlider: 30.0). - Audio Handling:
-c:a copy -c:a:0 ac3 -b:a:0 160kcopies compatible audio tracks first, then falls back to AC3 encoding at 160kbps if copying isn’t possible (matchesAudioEncoder: copyandAudioEncoderFallback: ac3). - Container Optimization:
-f mp4 -movflags +faststartoutputs an MP4 file optimized for HTTP streaming (matchesFileFormat: av_mp4andMp4HttpOptimize: 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 copypreserves all subtitle tracks and copies them directly (matchesSubtitleTrackSelectionBehavior: all). - Video Level:
-level 4.0sets the H.265 Level to 4.0 instead of 4.1 (matchesVideoLevel: 4.0). - Container:
-f matroskaoutputs an MKV file instead of MP4 (matchesFileFormat: av_mkv).
Quick Notes:
- The crop filter
crop=iw:ih-556:0:278is 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 withPictureKeepRatio: 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
decombfilter (e.g.,decomb=preset=defaultto match HandBrake’s default decomb behavior).
备注:内容来源于stack exchange,提问作者Keitaro26
相关产品推荐
相关产品推荐

