share-social

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Video Social

视频社交媒体适配

Prepare video for social media platforms: correct aspect ratios, resolutions, bitrates, and container settings.
为社交媒体平台准备视频:调整正确的宽高比、分辨率、比特率和容器设置。

Platform Presets

平台预设

PlatformAspectMax ResolutionMax DurationVideo BitrateAudio
Instagram Feed4:5 portrait or 1:11080×1350 / 1080×108060s3.5 MbpsAAC 128k
Instagram Reels9:161080×192090s8 MbpsAAC 192k
TikTok9:161080×192010min8 MbpsAAC 192k
YouTube Shorts9:161080×192060s8 MbpsAAC 192k
YouTube Standard16:91920×1080unlimited8 Mbps (1080p)AAC 192k
Twitter / X16:9 or 1:11920×1200140s25 Mbps capAAC 128k
Facebook16:9 or 9:161920×1080240min4 MbpsAAC 128k
LinkedIn16:91920×108010min5 MbpsAAC 128k
平台宽高比最大分辨率最长时长视频比特率音频
Instagram Feed4:5竖屏或1:1方形1080×1350 / 1080×108060秒3.5 MbpsAAC 128k
Instagram Reels9:161080×192090秒8 MbpsAAC 192k
TikTok9:161080×192010分钟8 MbpsAAC 192k
YouTube Shorts9:161080×192060秒8 MbpsAAC 192k
YouTube Standard16:91920×1080无限制8 Mbps(1080p)AAC 192k
Twitter / X16:9或1:11920×1200140秒最高25 MbpsAAC 128k
Facebook16:9或9:161920×1080240分钟4 MbpsAAC 128k
LinkedIn16:91920×108010分钟5 MbpsAAC 192k

Process

处理流程

1. Identify platform

1. 确定目标平台

If the request is ambiguous (e.g., "make it vertical"), ask which platform — bitrate and audio requirements differ.
如果请求不明确(例如“改成竖屏”),询问具体平台——不同平台的比特率和音频要求不同。

2. Probe source

2. 分析源视频

bash
ffprobe -v quiet -print_format json -show_streams -show_format "$INPUT"
Extract: width, height, duration, existing bitrate, audio codec.
bash
ffprobe -v quiet -print_format json -show_streams -show_format "$INPUT"
提取信息:宽度、高度、时长、现有比特率、音频编码格式。

3. Determine required transforms

3. 确定所需转换操作

Compare probe output against the platform row in the presets table. Apply only the transforms that are actually needed:
  • Aspect ratio mismatch → crop or pad (see Key Decisions for the choice rule)
  • Resolution too large → scale down (never upscale; social platforms reject oversized files at upload)
  • Duration exceeds platform limit → trim; confirm cut point with user first
  • Bitrate over limit → re-encode with target bitrate (platforms reject or silently degrade over-bitrate uploads)
Exit condition: when all four properties (aspect ratio, resolution, duration, bitrate) are within platform bounds and
-movflags +faststart
will be set, proceed to Step 4. If source already matches all properties, skip to Step 5 with a simple re-encode plan.
将分析结果与预设表格中的平台要求对比。仅执行实际需要的转换:
  • 宽高比不匹配 → 裁剪或添加黑边(参考关键决策中的选择规则)
  • 分辨率过大 → 缩小分辨率(绝不放大;社交媒体平台会拒绝过大的上传文件)
  • 时长超过平台限制 → 剪辑;先与用户确认剪辑位置
  • 比特率超过限制 → 重新编码至目标比特率(平台会拒绝或自动降低超比特率的上传文件质量)
退出条件:当宽高比、分辨率、时长、比特率这四个属性均符合平台要求,且将设置
-movflags +faststart
时,进入步骤4。如果源视频已符合所有要求,直接跳至步骤5,仅需执行简单的重新编码计划。

4. Construct command

4. 构建命令

Crop to fit (preferred when subject is centered):
bash
undefined
裁剪适配(当主体居中时优先选择):
bash
undefined

16:9 source → 9:16 (1080×1920), center crop:

16:9源视频 → 9:16(1080×1920),居中裁剪:

ffmpeg -i "$INPUT"
-vf "crop=ih*9/16:ih,scale=1080:1920"
-c:v libx264 -b:v 8000k
-c:a aac -b:a 192k
-movflags +faststart "$OUTPUT"

**Pad to fit** (preserves full frame, adds letterbox/pillarbox):
```bash
ffmpeg -i "$INPUT"
-vf "crop=ih*9/16:ih,scale=1080:1920"
-c:v libx264 -b:v 8000k
-c:a aac -b:a 192k
-movflags +faststart "$OUTPUT"

**添加黑边适配**(保留完整画面,添加上下或左右黑边):
```bash

16:9 source → 9:16 with black bars:

16:9源视频 → 9:16并添加黑边:

ffmpeg -i "$INPUT"
-vf "scale=1080:-2,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black"
-c:v libx264 -b:v 8000k
-c:a aac -b:a 192k
-movflags +faststart "$OUTPUT"

**Square (1:1) from 16:9 — center crop:**
```bash
ffmpeg -i "$INPUT" \
  -vf "crop=ih:ih,scale=1080:1080" \
  -c:v libx264 -b:v 3500k \
  -c:a aac -b:a 128k \
  -movflags +faststart "$OUTPUT"
ffmpeg -i "$INPUT"
-vf "scale=1080:-2,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black"
-c:v libx264 -b:v 8000k
-c:a aac -b:a 192k
-movflags +faststart "$OUTPUT"

**从16:9裁剪为方形(1:1)——居中裁剪:**
```bash
ffmpeg -i "$INPUT" \
  -vf "crop=ih:ih,scale=1080:1080" \
  -c:v libx264 -b:v 3500k \
  -c:a aac -b:a 128k \
  -movflags +faststart "$OUTPUT"

5. Confirm

5. 确认方案

State: crop vs. pad choice, any trim, output resolution and bitrate, output path. Wait for approval.
告知用户:裁剪或添加黑边的选择、是否需要剪辑、输出分辨率和比特率、输出路径。等待用户确认。

6. Run and verify

6. 执行并验证

After encoding, verify bitrate:
ffprobe -v quiet -show_format "$OUTPUT" | grep bit_rate
编码完成后,验证比特率:
ffprobe -v quiet -show_format "$OUTPUT" | grep bit_rate

Key Decisions

关键决策

  • Always include
    -movflags +faststart
    — relocates the moov atom to the file start, enabling progressive playback before full download. Required for all social platforms.
  • Crop vs. pad: default to crop for talking-head or centered subjects; default to pad for wide scenic shots or text-heavy content. When the user says "don't cut anything off", use pad. When uncertain with off-center subjects, ask before running.
  • Never upscale: if source is smaller than target resolution, scale to fit within bounds or keep original dimensions.
  • 始终添加
    -movflags +faststart
    ——将moov原子移至文件开头,支持在完全下载前进行渐进式播放。所有社交媒体平台均要求此项设置。
  • 裁剪vs添加黑边:默认对访谈类或主体居中的视频进行裁剪;默认对宽幅风景或文字较多的视频添加黑边。当用户要求“不要裁剪任何内容”时,使用添加黑边的方式。若主体偏离中心且不确定时,先询问用户再执行操作。
  • 绝不放大:如果源视频分辨率小于目标分辨率,缩放至符合边界或保持原尺寸。