Compress your video clips to save tons of file space - And they look the same!! FFMPEG transcoder

Compress your video clips to save tons of file space - And they look the same!! FFMPEG transcoder

JoyeMusic.com

3 года назад

1,052 Просмотров

This awesome transcoder, FFMPEG, is cross-platform (Windows, Mac, Linux) and allows you to compress your videos without reducing resolution or frame rate by HUGE factors (typically 4x to 28x) without any noticeable loss of quality! It saved me from having to buy a new SSD hard drive tos tore my video clips!

I forgot to mention it in my video, but you need to copy & paste the script I wrote (below) for Ubuntu Linux into a shell file called "{whatever you want}.sh", right-click it and change permissions to "executable", and put it in with the videos that you want to compress. Then open a command window (Ctrl+Alt+T), use "cd' to get to the folder you saved that file in, and then run it by the command "./{whatever you called it}.sh" and it will start right away compressing your files.

Read up on FFMPEG too, there are a huge number of compression codecs and tricks you can do to really make professionally-compressed files (ever wonder how they fit an entire 90-min movie on a tiny 4.7GB DVD? Clever compression).


========== UBUNTU 18.04/20.04 SHELL SCRIPT ==============
# This script uses FFMPEG to recompress video files. I've found that they
# end up 1.5x to 12x smaller in size with minor reduction in quality!!
# This is possible because a phone/camera simply doesn't have the processing
# power to compress the files optimally, so it keeps them large and relies
# on the user handle the unoptimized files.
# This script copies the large, original files to a folder called "_orig_"
# that you should delete after you determine that the compressions have been
# completed satisfactorily. It then changes the name of the compressed file
# from _comp_XYZ.MOV to the original name XYZ.MOV
#
#! bash shell

# Create a folder for the original video files, which you delete at the end.
mkdir _orig_

# Loop through the video files and compress them:
for i in *.{avi,flv,m4v,mov,MOV,wmv,mp4,MP4,TS,mkv};
do ffmpeg -n -i "$i" -vcodec libx265 -crf 20 "_comp_${i}";
# Check to make sure the file was created:
if test -f "_comp_${i}"; then
# Move the original file out of the way to a temp folder:
mv $i "_orig_/$i"
# Change the names of the compressed file:
mv "_comp_${i}" $i
# Clean up the temporary folder. NOTE: This is where your original files are
# after compression. If something goes wrong, you can retrieve them here! So
# you might want to skip this part.
# rmdir _orig_
fi
done

# ffmpeg options:
# -n : Don't overwrite files ("-y" is supposed to, but it doesn't work!)
# -loglevel error : Only display errors (omit for verbose output)
# -i : Indicates input file (no option needed for output file)
# -vcodec libx265 : indicates to use the H.265 codec, which takes longer
# to compress than H.264, but results in a smaller file size.
# -c:a copy : [?check the syntax] Copies over the audio without recompressing it.
# -crf 24 : Compresses to a constant bit rate, level "24". 18-28 gives
# reasonable results, but can go as high as about 50, where
# the smaller number is larger file size and higher quality.
# Last token: Output file name. =================================================




Please subscribe for more!!!
Ссылки и html тэги не поддерживаются


Комментарии: