Before you start

This uses the official HandBrake 1.11.2 CLI and Fast 1080p30 preset. A preview is not a replacement for the original edit master.

What you’ll make
A landscape H.264/AAC MP4, codec probe and top-level MP4 box report.
What you’ll need
HandBrakeCLI 1.11.2 (official platform CLI), FFmpeg and ffprobe for the fixture, Python 3, Bash and an owned 16:9 SDR source or the fixture.

Step by step

  1. Prepare the CLI and fixture

    Use the approved CLI, not an unrelated package with a similar name. Locate the official CLI and verify its version and documented options. This sample creates six seconds of test patterns and one audio tone; substitute an owned landscape SDR file with one audio track.

  2. Encode for progressive playback

    Run Fast 1080p30 with MP4 optimization and disable auto-cropping by supplying zero crop on every side. Output geometry is capped by the preset, so use a 1920×1080 fixture for this exercise. The short test clip sets the minimum accepted title duration to one second.

  3. Verify the container

    Check H.264, AAC, duration and dimensions with ffprobe. Walk top-level MP4 boxes to confirm that moov precedes mdat. This verifies fast-start layout, not network performance.

  4. Check playback before delivery

    Review first and last seconds and confirm the audio track. For hosted delivery, the web server must serve video/mp4 correctly; if seeking matters, check byte-range behavior once you have an authorized staging URL. Do not upload or overwrite the master.

Commands

set -e
HandBrakeCLI --version
HandBrakeCLI --preset-list 2>&1 | grep -F 'Fast 1080p30'
ffmpeg -v error -n -f lavfi -i 'testsrc2=size=1920x1080:rate=30:duration=6' -f lavfi -i 'sine=frequency=660:sample_rate=48000:duration=6' -c:v libx264 -pix_fmt yuv420p -c:a aac master.mp4
test ! -e web-preview.mp4
HandBrakeCLI -i master.mp4 -o web-preview.mp4 -Z 'Fast 1080p30' --min-duration 1 --optimize --crop 0:0:0:0
ffprobe -v error -show_entries stream=codec_name,width,height:format=duration,size -of json web-preview.mp4 > probe.json
python3 - <<'EOF'
import json, struct, os
probe=json.load(open('probe.json'))
assert any(s.get('codec_name')=='h264' and s.get('width')==1920 and s.get('height')==1080 for s in probe['streams'])
assert any(s.get('codec_name')=='aac' for s in probe['streams'])
assert abs(float(probe['format']['duration'])-6)<0.15
path='web-preview.mp4'
end=os.path.getsize(path)
with open(path,'rb') as f:
    boxes=[]
    while f.tell()<end:
        start=f.tell()
        n,k=struct.unpack('>I4s',f.read(8))
        minimum=8
        if n==1: n=struct.unpack('>Q',f.read(8))[0]; minimum=16
        if n==0: n=end-start
        assert minimum<=n<=end-start
        boxes.append({'box':k.decode('ascii'),'at':start})
        f.seek(start+n)
o=[b['box'] for b in boxes]
assert o.index('moov')<o.index('mdat')
with open('boxes.json','w') as out:
    json.dump(boxes,out,indent=2)
EOF

Sign-in & permissions

No account, API key, or external upload. A public dependency download may be needed. Pause before a system install; do not work around a restriction.

No agent skill, plugin, or MCP connector required.

Prompt for your agent

Use with: Codex, Claude Code, or another agent with local terminal and file access. Commands use Bash or a compatible shell.

Copy the whole prompt into a supported agent. After any manual step, tell the same agent to continue from that step.

Use a clean project folder for this workflow: Make a fast-start product demo MP4 with HandBrakeCLI. Supported setup: Codex, Claude Code, or another agent with local terminal and file access. Commands use Bash or a compatible shell.. Start from the original documentation: https://handbrake.fr/docs/en/latest/cli/command-line-reference.html.

1. SET UP
Start in a new project folder and check the listed tools. Use the pinned package or official platform build, no global upgrades. Check each command against its official source and stop on missing permissions or capabilities. Download the matching CLI archive from the linked official source, verify its published checksum, extract it in a project folder, and invoke its local path in place of HandBrakeCLI. On Linux with an existing official Flatpak, use flatpak run --command=HandBrakeCLI fr.handbrake.ghb instead. Pause before any installer or approval prompt.

Documented commands or code reference (respect the comments and replace placeholders before running individual commands):
set -e
HandBrakeCLI --version
HandBrakeCLI --preset-list 2>&1 | grep -F 'Fast 1080p30'
ffmpeg -v error -n -f lavfi -i 'testsrc2=size=1920x1080:rate=30:duration=6' -f lavfi -i 'sine=frequency=660:sample_rate=48000:duration=6' -c:v libx264 -pix_fmt yuv420p -c:a aac master.mp4
test ! -e web-preview.mp4
HandBrakeCLI -i master.mp4 -o web-preview.mp4 -Z 'Fast 1080p30' --min-duration 1 --optimize --crop 0:0:0:0
ffprobe -v error -show_entries stream=codec_name,width,height:format=duration,size -of json web-preview.mp4 > probe.json
python3 - <<'EOF'
import json, struct, os
probe=json.load(open('probe.json'))
assert any(s.get('codec_name')=='h264' and s.get('width')==1920 and s.get('height')==1080 for s in probe['streams'])
assert any(s.get('codec_name')=='aac' for s in probe['streams'])
assert abs(float(probe['format']['duration'])-6)<0.15
path='web-preview.mp4'
end=os.path.getsize(path)
with open(path,'rb') as f:
    boxes=[]
    while f.tell()<end:
        start=f.tell()
        n,k=struct.unpack('>I4s',f.read(8))
        minimum=8
        if n==1: n=struct.unpack('>Q',f.read(8))[0]; minimum=16
        if n==0: n=end-start
        assert minimum<=n<=end-start
        boxes.append({'box':k.decode('ascii'),'at':start})
        f.seek(start+n)
o=[b['box'] for b in boxes]
assert o.index('moov')<o.index('mdat')
with open('boxes.json','w') as out:
    json.dump(boxes,out,indent=2)
EOF

2. PAUSE FOR ME IF NEEDED
For a host install, sign-in, permission screen, or model download that needs my consent, stop and tell me the exact app, control and what will be authorized. Do not enter passwords, OTPs or secrets in chat. Resume after I confirm.

3. BUILD THE FIRST RESULT
Build the six-second 1080p fixture or use my authorized SDR landscape master. If I supplied a real clip, measure and use its own target size and duration in the verification code. Return web-preview.mp4, probe.json and boxes.json. Keep the source untouched and check both ends of playback and the sound if possible.

4. CHECK THE RESULT
Require H.264 video, AAC audio, expected duration/geometry and moov before mdat. Check the actual copy, not just the command options. Give me the actual file paths and anything that still needs a manual action. Do not publish or make a purchase.

Sources