Comments on: FFmpeg: Compress and Rescale Video and Image https://smarttech101.com/ffmpeg-compress-rescale-video-and-image/ Do Everything in Linux Sun, 20 Aug 2023 05:41:50 +0000 hourly 1 https://wordpress.org/?v=6.6.2 By: Ajay https://smarttech101.com/ffmpeg-compress-rescale-video-and-image/#comment-576 Sun, 20 Aug 2023 05:41:50 +0000 https://smarttech101.com/?p=2075#comment-576 In reply to chandu.

you can use the loops:

src_dir=~/test-dir
dest_dir=~/compressed-videos
for video in "$src_dir"/*.mp4; do
dest_video="$dest_dir/$(basename "$video")_compressed.mp4"
ffmpeg -i "$video" "$dest_video"
done

]]>
By: Ajay https://smarttech101.com/ffmpeg-compress-rescale-video-and-image/#comment-575 Sun, 20 Aug 2023 05:30:12 +0000 https://smarttech101.com/?p=2075#comment-575 In reply to chandu.

Sorry for being so late. I was little busy. To delete original files execute:
find ~/test-dir -name '*.mp4' ! -name '*_compressed.mp4' -exec rm {} \;
For being on safe side, you can use rm -i instead of rm to get confirmation before deleting the file.

]]>
By: How to Use Loops in Bash? | SmartTech101 https://smarttech101.com/ffmpeg-compress-rescale-video-and-image/#comment-565 Thu, 17 Aug 2023 09:40:11 +0000 https://smarttech101.com/?p=2075#comment-565 […] To learn more about ffmpeg compression of videos and images, look at this article. […]

]]>
By: chandu https://smarttech101.com/ffmpeg-compress-rescale-video-and-image/#comment-339 Sat, 25 Mar 2023 08:45:45 +0000 https://smarttech101.com/?p=2075#comment-339 how to delete orignal file after converting
~$ find ~/test-dir -name ‘*.mp4’ -exec ffmpeg -i {} {}_compressed.mp4 \;

]]>
By: chandu https://smarttech101.com/ffmpeg-compress-rescale-video-and-image/#comment-338 Sat, 25 Mar 2023 07:37:50 +0000 https://smarttech101.com/?p=2075#comment-338 how to change output folder
~$ find ~/test-dir -name ‘*.mp4’ -exec ffmpeg -i {} {}_compressed.mp4 \;

]]>