Replacing AWS Media Converter with FFmpeg

Phanix
·
·
IPFS
·

In the previous article, I originally planned to use AWS Media Converter, after all, the price is reasonable, but then I thought that there are still cheap cloud instances that are idle (in google cloud, 1vCPU, 1.7G ram, 50G HDD), why don't you try running on it? ffmpeg performance.

It is actually quite easy to install ffmpeg on ubuntu 18.04lts, apt-get install can solve it, and none of the dependent libraries are leaked.
After cutting a 3xMB 1080p file (bit rate about 110000kbps) with aws media converter, there is about 28MB left, which is slightly compressed and takes about 20 seconds.
.
If you want a similar compression ratio, use ffmpeg to specify quality level 16 (parameter crf, refer to https://superuser.com/questions/525928/ffmpeg-keeping-quality-during-conversion ). It ended up taking about 50 seconds, which is noticeably slower than AWS but not overly exaggerated.

 $ ffmpeg -i 1080.mp4 -map 0 -codec:v libx264 -crf 16 -codec:a aac -f ssegment -segment_list 1080.m3u8 -segment_list_flags +live -segment_time 10 1080_out%03d.ts

Later, I thought it was wrong. Since there is not much compression, if the user does not mind the file size, it is better to specify the -codec:v copy parameter to directly cut the segment.

 $ ffmpeg -i 1080.mp4 -map 0 -codec:v copy -codec:a aac -f ssegment -segment_list 1

Original link: Phanix's Blog

CC BY-NC-ND 2.0

Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!