简体   繁体   中英

FFmpeg mp4 compression

I'm developing photo and video social network ( partially like instagram ). And i'm using ffmpeg for mp4 to mp4 file size compression. I achieved 3 time scale factor for file size ( from 13 mb to 2,5 mb ) but very stupidly - 3 times converting output files by the following command-line string :

./ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4

I'm a newbee in video-audio codec theory, so i completely lost audio while such compression. So my question is - where is audio? Which option should i use? Thanks in advance!

MP2 is MPEG-1 Layer 2 audio codec, not expected by many players in a MP4 container. Use AAC or MP3 instead.

The command below will use the default codecs (H264 and AAC):

ffmpeg -i input.mp4 output.mp4

For web use, you should include the following two, to be safe:

ffmpeg -i input.mp4 -pix_fmt yuv420p -movflags +faststart output.mp4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM