1. 程式人生 > >HTML5網頁上播放mp4失敗的原因

HTML5網頁上播放mp4失敗的原因

 

HTML5網頁上播放mp4失敗的原因

這個不錯:

https://blog.csdn.net/huangchao064/article/details/46553871

解決方法1:

FFMPEG  -i  3333.mp4 -c:v libx264 -strict -2 1111.mp4

 

mp4 convert

https://github.com/chief8192/python-tools/blob/ab01e66d83ad6915bc9dafed43b6ca28ab9cbe59/chromecast_converter_test.py

 

ffmpeg轉:

https://github.com/kbubnicki/test/blob/2f54d355a7d659a22fd85cf426916ba760847a7b/trapper/tools/video.py

 

https://github.com/wicak29/jarConv/blob/f809cb9a60e812c54a262ed579645f88eba4e2aa/vidConf.py

 

https://github.com/vblaker/My_Tutorials/blob/eb53c9ae7b93300febe0709aca070264e82b4d64/Tutorials/ConvertToMP4.py

 

https://blog.csdn.net/liwb1987/article/details/46877481

轉載:https://jalena.bcsytv.com/archives/1202

http://ffmpeg.org/

現在Html5也逐漸普及了,裝置對於mp4/webm/ogv的支援也逐漸廣泛,但是Html5視訊的轉換軟體卻不是太多,這個Ffmpeg確實不錯。而且功能也強大。

HTML5先網頁直接開啟mp4 如果打不開 先用格式工廠轉化下格式 轉成標準mp4 就行了

訊捷視訊轉換器也可以

檢視原文:http://newmiracle.cn/?p=535

 
  1. <pre name="code" class="plain">REM “H.264 / ACC”

  2. "D:\Program Files\FFmpeg\bin\ffmpeg.exe" -y -i %1 -vcodec libx264 -vprofile high -preset slow -b:v 900k -maxrate 1200k -bufsize 1000k

  3. -vf scale=trunc(oh*a/2)*2:480 -threads 0 -acodec libvo_aacenc -b:a 128k %1.mp4

  4.  
  5. REM “Standard” web video (480p at 500kbit/s):

  6. "D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k

  7. -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k %1_Standard.mp4

  8.  
  9. REM 360p video for older mobile phones (360p at 250kbit/s in baseline profile):

  10. "D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k

  11. -vf scale=-1:360 -threads 0 -acodec libvo_aacenc -ab 96k %1_360p.mp4

  12.  
  13. REM 480p video for iPads and tablets (480p at 400kbit/s in main profile):

  14. "D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile main -preset slow -b:v 400k -maxrate 400k -bufsize 800k

  15. -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -ab 128k %1_480p.mp4

  16.  
  17. REM High-quality SD video for archive/storage (PAL at 1Mbit/s in high profile):

  18. "D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile high -preset slower -b:v 1000k -vf scale=-1:576 -threads 0

  19. -acodec libvo_aacenc -ab 196k %1_High.mp4

  20.  
  21. REM webm (VP8 / Vorbis)

  22. "D:\Program Files\FFmpeg\bin\ffmpeg.exe" -y -i %1 -vcodec libvpx -quality good -cpu-used 5 -b:v 700k -maxrate 700k -bufsize 1000k -qmin 10 -qmax 42

  23. -vf scale=trunc(oh*a/2)*2:480 -threads 4 -acodec libvorbis -f webm %1.webm

  24.  
  25. REM ogv (Theora / Vorbis)

  26. "D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -b 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 -s 640x360 %1.ogv


 

 

 

 

遍歷目錄下的所有mpg檔案,挨個轉換到該目錄!

1

for/r%1%%iin (*.mpg)do "D:\Program Files\FFmpeg\Convert.bat"%%i

程式碼很簡單,但是很實用,如果檔案格式太亂,可以使用檔案列表的形式來進行

1

for/r%1%%iin (list.txt)do "D:\Program Files\FFmpeg\Convert.bat"%%i

大概就這些了,更多方法可以檢視FFmpeg的使用說明