-FFmpeg
1.What is FFmpeg?
I learned FFmpeg is a one of good tool to compress the video.
2.Install
It is the first time to use, so in terminal, I use Homebrew to install FFmpeg with below code.
brew install ffmpeg
Install is complete. (ffmpeg version 5.1.2)
3.TEST
3-1) TEST1
In finder, I made new folder (folder name: test_move) on Desktop.
The next, In terminal, Change file format (.mov -> .mp4) with below code.
ffmpeg -i input.mov output.mp4
Then, I compressed size (file of .mp4) several times with below code.
ffmpeg -i input.mp4 -crf 31 output.mp4
While TEST1, there was a misunderstanding.I thought that the file size might change when the files move to Download. The first my hypothesis is (Size in cloud) ≠ (Size in Download). But it is NOT. The photo show 382KB is size on the way to compress. 7.6MB is the size after compression. When working with FFmpeg, it is important to wait until compression is complete.
The Result
3-2) TEST2
In finder, I created the another new folder. (folder name: cnc)
Then, In the terminal, I compressed size of file MP4. (code is same code as TEST1)
- 1st compress -> success
- 2nd compress -> Failure. The capacity increases. I think that It's Mysterious phenomenon happened.
Add in 1-Jun:
Later, I learned below from instructor (Ivan) below. Thank you.
It depends on the codec (compression algorithm) that you use. In mp4 you are likely using the h264 codec. Let’s say that this algorithm is not good at recompressing (there is no information that can be removed).
4. advice in open time.
I joined the Global open time on 4 Feb, 2023. And I got lots of advice to solve my problems. Thank you so much to Instructors!!
5, My Impressions
- I feel scared using Terminal, so It is a task I am not good at.
- Thank you for instructors a lot!
6. Useful Links
- FFmpeg encoding
- CRF Guide
- crf is the compression. The lower, the mor compress.
- FFmpeg command list / blog (Japanese)