Manipulating Videos Using `ffmpeg`

Extract a Portion of the Video

1
ffmpeg -ss "$start_time_in_seconds" -i "$input" -to "$end_time_in_seconds" -c copy "$output"

Reduce a Video's Resolution by Half

1
ffmpeg -i "$input" -vf "scale=iw/2:ih/2" -c:a copy "$output"
  • Use the scale filter with expressions to halve the width and height:
    • iw = input width, ih = input height.
  • -c:a copy copies the audio stream without re-encoding.

Manipulating Videos Using `ffmpeg`
https://jifengwu2k.github.io/2025/08/23/Manipulating-Videos-Using-ffmpeg/
Author
Jifeng Wu
Posted on
August 23, 2025
Licensed under