Skip to content

Commit 02ef148

Browse files
committed
ffmpeg: crop video from the top
1 parent aa0e0e4 commit 02ef148

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

media/ffmpeg.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,16 @@ ffmpeg -i "$($_.FullName)" -vn -ar 44100 -ac 2 -b:a 192k "$($_.FullName.Replace(
3232
# -b:a 320k - sets the audio bitrate
3333
# -shortest - this option ensures that the output video will be as long as the shortest input.
3434
# output.mp4 - name of the output video file
35-
ffmpeg -loop 1 -i img.jpg -i audio.mp3 -c:v libx264 -c:a aac -b:a 320k -shortest output.mp4
35+
ffmpeg -loop 1 -i img.jpg -i audio.mp3 -c:v libx264 -c:a aac -b:a 320k -shortest output.mp4
36+
37+
# Crop video from the top
38+
# This command crops the video by removing 440 pixels from the top, effectively shifting the video down by that amount.
39+
# -i input.mp4 - specifies the input video file
40+
# -vf "crop=iw:ih-440:0:440" - applies a video filter (vf) to crop the video.
41+
# - iw Input width (keeps the full width of the video).
42+
# - ih-440 Input height minus 440 pixels
43+
# - 0 X offset (starts cropping from the left edge).
44+
# - 440 Y offset (starts cropping from 440 pixels down from the top).
45+
# -c:a copy - copies the audio stream without re-encoding it
46+
# output.mp4 - name of the output video file
47+
ffmpeg -i .\input.mp4 -vf "crop=iw:ih-440:0:440" -c:a copy output.mp4

0 commit comments

Comments
 (0)