標籤:ast load min htm fas 解析度 dmi 等等 需要
ffmpeg -i test.mp4 -threads 4 -vcodec mpeg4 -b:v 1000k test_A1.mp4ffmpeg -i test.mp4 -threads 8 -vcodec mpeg4 -b:v 800k test_A2.mp4ffmpeg -i test.mp4 -threads 8 -vcodec mpeg4 -b 200k test_A3.mp4--開啟8個線程,壓縮碼率-crf越小清晰度越高ffmpeg -i test.mp4 -threads 8 -crf 22 -y -vcodec mpeg4 -strict experimental test_B1.mp4ffmpeg -i test.mp4 -threads 8 -crf 26 -y -vcodec mpeg4 -strict experimental test_B2.mp4ffmpeg -i test.mp4 -threads 8 -crf 28 -y -vcodec mpeg4 -strict experimental test_B3.mp4ffmpeg -i test.mp4 -threads 8 -crf 30 -y -vcodec mpeg4 -strict experimental test_B4.mp4--轉h264。-s 640*360--用的:ffmpeg -i test.mp4 -c:v libx264 -b 600k -r 25 -s 640*360 -ab 48k -strict -2 test_ok.mp4 ffmpeg -i test.mp4 -threads 8 -c:v libx264 -movflags faststart -b 200k -r 25 -ab 48k -strict -2 test_C1.mp4ffmpeg -i test.mp4 -c:v libx264 -movflags faststart -b 600k -r 25 -ab 48k -strict -2 test_C2.mp4ffmpeg -i test.mp4 -threads 2 -c:v libx264 -movflags faststart -b 600k -r 25 -ab 48k -strict -2 test_C3.mp4--發現threads加了沒什麼用,反而感覺有點慢似的ffmpeg -i test.mp4 -c:v libx264 -movflags faststart -b 600k -r 25 -s 640*360 -ab 48k -strict -2 test_C4.mp4ffmpeg -i C:\Users\guestAdmin\Desktop\K空檔案夾\A00000592C0B5B\20180610\IMG_20180610104643.mp4 -c:v libx264 -b 600k -r 25 -s 1280*720 -ab 48k -strict -2 test_C5.mp4ffmpeg -i DreamItPossible.mp4 -c:v libx264 -movflags faststart -b 300k -r 25 -s 640*360 -ab 48k -strict -2 test_C5.mp4ffmpeg -i DreamItPossible.mp4 -threads 8 -c:v libx264 -movflags faststart -b 300k -r 25 -s 320*240 -ab 48k -strict -2 test_C6.mp4--支援邊下載邊放:qt-faststart test_c4.mp4 test_D1.mp4qt-faststart DreamItPossible.mp4 test_D2.mp4-- -movflags faststart -- http://saas.ihaihong.cn/YinShiPin/upload/FTP/862107034362822/20180615/filesIMG_20180615193440.mp4ffmpeg -i 862107034362822\20180615\filesIMG_20180615193440-old.mp4 -c:v libx264 862107034362822\20180615\filesIMG_20180615193440-264.mp4qt-faststart 862107034362822\20180615\filesIMG_20180615193440-264.mp4 862107034362822\20180615\filesIMG_20180615193440.mp4ffmpeg -i 862107034362822\20180615\filesIMG_20180615193440-old.mp4 -c:v libx264 -movflags faststart 862107034362822\20180615\filesIMG_20180615193440.mp4--轉載請註明,海宏軟體,iHaihong.cnffmpeg -i 862107034362822\20180615\filesIMG_20180615183646-old.mp4 -c:v libx264 -movflags faststart 862107034362822\20180615\filesIMG_20180615183646.mp4
mp4看著是mp4副檔名,但是編碼格式有很多,比如3gp、MP4、MP42、avc、xvid等等,MP4要在html5網頁上用<video src="xxx.mp4" />播放,需要這兩點:
1:moov中繼資料要放在前面,通過 -movflags faststart 實現。
2:格式需要是h264的。
這樣隨便用個<video src="xxx.mp4" autoplay="autoplay"/>就能播放了。
ffmpeg轉成h264編碼格式、moov(meta資料)移動到頭部、碼率做一定壓縮、解析度也降下來