YaK:: How to crop with ffmpeg [Changes]   [Calendar]   [Search]   [Index]   [PhotoTags]   
[mega_changes]
[photos]

How to crop with ffmpeg

https://varun.ch/posts/videowall/

#!/bin/bash

# incase anyone ever has this insane use case again

input_video="input.mp4"
prefix="v8"

width=1366
height=768

segments=10

for ((i=1; i<=segments; i++)); do
    x_offset=$(((i - 1) * width))
    output_file="${prefix}-${i}.mp4"

    ffmpeg -i "$input_video" -vf "crop=$width:$height:$x_offset:0" -c:a copy "$output_file"
done

echo "Splitting complete!"
(unless otherwise marked) Copyright 2002-2014 YakPeople. All rights reserved.
(last modified 2025-03-01)       [Login]
(No back references.)